NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%20de%20Phily's gravatar image

Vincent de P... ♦
17.3k18152249
accept rate: 19%

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?

(03 Jul '11, 02:07) emacsen

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.

(03 Jul '11, 23:30) Vincent de P... ♦

Uploading GPX Tracks

The 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 Files

From 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:

gdal

The 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

nominatim

Once 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.

permanent link

answered 04 Jul '11, 02:41

emacsen's gravatar image

emacsen
1.2k1623
accept rate: 13%

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... ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×255
×68
×35
×13
×2

question asked: 01 Jul '11, 22:40

question was seen: 8,152 times

last updated: 09 Jul '11, 20:44

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum