I've gathered a lot of gpx files on my hard drive, coming from various sources, and would like to give each a standardized and useful name. Something like "Region - Locality - BeginDate - EndDate.gpx". Do you know of a tool that could help me with that ? asked 01 Jul '11, 22:40 Vincent de P... ♦ |
Uploading GPX TracksThe easiest thing for you to do to sort out your GPX tracks is to upload them to OSM. OSM has multiple mechanisms for handling GPX data, including setting privacy policies on your data, including setting the GPX tracks to private, if that's what you want to do. Once your tracks are uploaded to OSM, you can access them at any time from any computer, and you can retrieve them at any time. You can also tag them for later recall, as well as using them within either Josm or Potlatch. Renaming the GPX Track FilesFrom your comment, it sounds like you want a tool to look at your tracks, extrapolate a location and rename the file accordingly. As far as I know, no tool exists to do that. What you can do is write your own. Here are some ideas to get you started: gdalThe gdal library support GPX and so you should be able to use it to open your GPX track and find the envelope/bbox extents. From there you can get the centroid of your bounding box. You may also be able to do more complex analysis, such as the area you're in most nominatimOnce you know the location you want to reverse geo-code, you can use nominatim to reverse geocode the location, and use whichever fields you feel are appropriate in your result (street, city, country, etc.). Once you have the fields, you can just concatenate the field names as you like and rename the file. Lastly, this is an OpenStreetMap specific forum. Since your question is more general, you may also have better luck on a more general programming forum such as Stack Overflow. answered 04 Jul '11, 02:41 emacsen Thanks for quality answer. I knew one fix for may issue was to upload the GPX and let OSM do the sorting, but I also use my traces in non-OSM contexts. I might still do that, my tracesw can be usefull to others, after all. Thanks for the gdal and nominatim pointers, I'll try to find time to hack that up :)
(09 Jul '11, 20:44)
Vincent de P... ♦
|
Do you mean for uploading in OSM or on your hard drive? And do you mean you want it to geocode your GPX data? I'm not sure how this relates to OSM. Can you elaborate on your question?
I'm talking about files on my hard drive. Since I edit with JOSM, I never bother with an "upload" step. And I want to change the file names, not the file contents.
I was hoping for something that would look inside the file for the date of the first/last record and for the average position, lookup that position on OSM (say "which boundary=administrative,admin_level=8 relation does this point belong to ?"), and rename the file accordingly.