mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add data for lat/lon conversions.
This commit is contained in:
38
resources/tools/coord_export.lua
Normal file
38
resources/tools/coord_export.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
local function dump_coords()
|
||||
local coordinates = {}
|
||||
local bases = world.getAirbases()
|
||||
for i = 1, #bases do
|
||||
local base = bases[i]
|
||||
point = Airbase.getPoint(base)
|
||||
lat, lon, alt = coord.LOtoLL(point)
|
||||
coordinates[Airbase.getName(base)] = {
|
||||
["point"] = point,
|
||||
["LL"] = {
|
||||
["lat"] = lat,
|
||||
["lon"] = lon,
|
||||
["alt"] = alt,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
zero = {
|
||||
["x"] = 0,
|
||||
["y"] = 0,
|
||||
["z"] = 0,
|
||||
}
|
||||
lat, lon, alt = coord.LOtoLL(zero)
|
||||
coordinates["zero"] = {
|
||||
["point"] = zero,
|
||||
["LL"] = {
|
||||
["lat"] = lat,
|
||||
["lon"] = lon,
|
||||
["alt"] = alt,
|
||||
},
|
||||
}
|
||||
|
||||
local fp = io.open(lfs.writedir() .. "\\coords.json", 'w')
|
||||
fp:write(json:encode(coordinates))
|
||||
fp:close()
|
||||
end
|
||||
|
||||
dump_coords()
|
||||
Reference in New Issue
Block a user