Commit 558c064f authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Fix longitudes and latitudes

In KML files coordinates must be given the order longitude, latitude, altitude.
parent 546ba337
......@@ -121,7 +121,7 @@ def build_rectangle(root, lat, lon, length, width, height, rotation,
for x, y in ((min_x, min_y), (max_x, min_y), (max_x, max_y), (min_x, max_y), (min_x, min_y)):
rotated_x, rotated_y = rotate(x, y, local_x, local_y, rotation)
corner_lon, corner_lat = convert_to_geo_coordinates(rotated_x, rotated_y, map_info)
polygone_coordinates.append((corner_lat, corner_lon, height))
polygone_coordinates.append((corner_lon, corner_lat, height))
add_polygone(root, polygone_coordinates, style_map_id)
......@@ -137,11 +137,11 @@ def write_kml(filename, map_dict):
add_style_map(document, name, style_dict)
add_polygone(document, (
(map_dict['min_lat'], map_dict['min_lon'], 0),
(map_dict['min_lat'], map_dict['max_lon'], 0),
(map_dict['max_lat'], map_dict['max_lon'], 0),
(map_dict['max_lat'], map_dict['min_lon'], 0),
(map_dict['min_lat'], map_dict['min_lon'], 0),
(map_dict['min_lon'], map_dict['min_lat'], 0),
(map_dict['min_lon'], map_dict['max_lat'], 0),
(map_dict['max_lon'], map_dict['max_lat'], 0),
(map_dict['max_lon'], map_dict['min_lat'], 0),
(map_dict['min_lon'], map_dict['min_lat'], 0),
), 'terrain')
depth = lat_lon_distance(map_dict['min_lat'], map_dict['min_lon'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment