Commit bd29820
committed
Fix #89: Do not generate the geojson data for each request
The current code uses the omnivore plugin to display gpx data.
Once the gpx data are retrieved, the parse.gpx (or whatever) function
will generate a geojson structure to display the polygon.
If you have a lot of gpx files, this method could be a high
time-consuming process.
This patch suggests a new manual workflow to manage the gps traces:
1/ Upload/synchronize a gpx file (/path/to/galleries/dir/file.gpx)
2/ Generate a geojson file from this gpx file:
On a debian-based linux distribution:
% sudo apt-get install npm
% sudo npm install -f togeojson
% sudo n latest
% togeojson file.gpx > file.geojson
% perl -p -i -n -e 's/\s//g' file.geojson # To remove space characters
You can also simplify the gpx file, to make it lighter, using gpxbabel:
% sudo apt-get install gpsbabel
% gpsbabel -i gpx \
-f file.gpx \
-x simplify,crosstrack,error=0.001k \
-i gpx -F file_simplified.gpx
It will remove points if they are no farther than 1 metre.
For more details, see:
https://wiki.openstreetmap.org/wiki/GPSBabel/Using_filters#Simplifying_tracks
3/ Put the geojson file in the same directory, with the same name but the
geojson extension (/path/to/galleries/dir/file.geojson).
Now the geojson file will be used instead of the gpx file.1 parent eb408a2 commit bd29820
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
517 | | - | |
518 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
519 | 523 | | |
520 | 524 | | |
521 | 525 | | |
| |||
0 commit comments