tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
1.01k stars 223 forks source link

coordinate bounding box #245

Closed darrepac closed 2 years ago

darrepac commented 2 years ago

Hi

I have tons of GPX files and would like to select only the one that are part of predefined bounding box. For doing so I would like to open each GPX and check if their bounding box is inside a predefined one and do something. Is there a function to do that?

thx

darrepac commented 2 years ago

if (gpx.get_bounds().min_longitude > minlongitude and gpx.get_bounds().min_latitude > minlatitude and gpx.get_bounds().max_longitude < maxlongitude and gpx.get_bounds().max_latitude < maxlatitude):

tkrajina commented 2 years ago

Exactly, that's how to do it.