You are not logged in.

#1 2020-09-18 09:37:02

Shohreh
Member
Registered: 2012-12-15
Posts: 209

Python script to only keep waypoints within x km from track?

Hello,

I need to write a script in Python that can read a track and a set of waypoints, and only keep waypoints that lie within x kilometers from the track.

In pseudo-code:

from geopy.distance import distance

read track.gpx and waypoints.gpx
for each waypoint:
	get lat,lon
	compute distance from track
	if < 5km
		add waypoint to array
write array to file

Before I take a deeper look, does someone have some code I could use?

Thank you.

Last edited by Shohreh (2020-09-18 09:37:23)

Offline

Board footer

Powered by FluxBB