-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
36 lines (27 loc) · 1.44 KB
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from GeoJSONParser import GeoJSONParser
from GpxReader import gpxReader
from FindShortestPath import FindShortestPath
from CoordinateConversion import WGS84Coordinates
def main():
start_end_points = "YOUR_GPX_FILE"
route_gpx = "YOUR_GPX_FILE"
geojson = "YOUR_GEOJSON_FILE"
geometries = GeoJSONParser.parse_geo_json(geojson)
gpx_points = gpxReader.read_gpx(start_end_points)
wgs84_coordinates_list = [{
"Latitude": point["Latitude"],
"Longitude": point["Longitude"],
"Elevation": point["Elevation"]
} for point in gpx_points]
wgs84_coordinates_list = [WGS84Coordinates(longitude=point["Longitude"],
latitude=point["Latitude"],
elevation=point["Elevation"]) for point in gpx_points]
first_point = wgs84_coordinates_list[0]
last_point = wgs84_coordinates_list[-1]
loksodrom_distance = FindShortestPath.find_loksordom_curve_from_gpx(first_point, last_point)
geodesic_line = FindShortestPath.find_geodesic_distance_from_gpx(first_point, last_point)
geodesic_line_with_route = FindShortestPath.calculate_total_geodesic_distance_from_gpx(wgs84_coordinates_list)
high_way_line = FindShortestPath.find_shortest_path_from_geojson(first_point, last_point, geojson)
print(loksodrom_distance, geodesic_line, geodesic_line_with_route, high_way_line)
if __name__ == "__main__":
main()