Comments (4)
Thank you, I have actually originally started with gpxpy
and utm
(I'm already using utm
to convert back to latlon to plot in ipyleaflet
), but it was comparatively much slower (speaking about 60k+ points, which represents over 900km of tracks) when loading all raw GPX files each time:
def read_segments():
for path in sorted(Path(".").glob("gpx/*.gpx")):
gpx = gpxpy.parse(path.read_text())
for track in gpx.tracks:
for segment in track.segments:
if len(segment.points) < 5:
continue
yield [
(point.time_difference(segment.points[0]),
utm.from_latlon(point.latitude, point.longitude, 32, "U")[:2])
for point in segment.points
]
segments = list(read_segments())
UTM system is perfect for local geometry and distances, but maybe with GeoPandas the expensive conversion could be skipped.
The performance problem is also the conversion of ALL points, which could be solved by some simplifying methods of gpxpy.
Or some sort of database/cache for all converted points. And we're back at CSVs, which offer the user a stable and reviewable step in data processing.
from pygohome.
Another option is to run gpsbabel in the Jupyter notebook with Unix commands (!)
https://intro.syzygy.ca/unix-tricks/#unix-and-magic-in-a-notebook
(Would have to run with ‘wget’ or ‘git clone’ to get local ‘gpsbabel’ binary.)
from pygohome.
utm
can do NumPy
arrays, it is just too shy about it. That's why I added it to its docs: Turbo87/utm#50
Converting 1M points in a loop takes 90 seconds, a 1M numpy array needs 0.26s. Now it's an option again.
from pygohome.
gpxpy
and utm
used to load GPX files in 1a30a69
Thanks @philshem
from pygohome.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygohome.