We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I went through the test.py, but didn't find if it's possible.
I was wondering if gpxpy provides a way to remove a waypoint from the array while in a loop:
import gpxpy import gpxpy.gpx stations_file = open("input.gpx", mode='rt', encoding='utf-8') stations_gpx = gpxpy.parse(stations_file) stations_file.close() print("Number of stations: ",len(stations_gpx.waypoints)) for waypoint in stations_gpx.waypoints: if waypoint.name = "Dummy": #How to remove waypoint from array?
Thank you.
The text was updated successfully, but these errors were encountered:
stations_gpx.waypoints is a normal list. You remove an item like you remove an item from any other list. For example with filter:
stations_gpx.waypoints
>>> l = [1, 2, 3, 4, 5, 6, 7, 8] >>> list(filter(lambda e: e % 2 == 0, l)) [2, 4, 6, 8]
Sorry, something went wrong.
No branches or pull requests
Hello,
I went through the test.py, but didn't find if it's possible.
I was wondering if gpxpy provides a way to remove a waypoint from the array while in a loop:
Thank you.
The text was updated successfully, but these errors were encountered: