Skip to content

Script to collect public GPS data from the OSM API (0.6) around a given area.

License

Notifications You must be signed in to change notification settings

tiphaine/osm2gpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osm2gpx.py: public GPS traces collection from OSM

Script to collect public GPS data from the OSM API (0.6) around a given area.

Requirements

  • Python 3.7

  • Click

  • requests

  • tqdm

      $ pip install -r requirements.txt
    

Usage

Usage: osm2gpx.py [OPTIONS]

Options:
  --nb_traces INTEGER  Number of gpx traces.
  --city_name TEXT     City name / examples: [ile-de-france, paris, lyon,
                       bourg-saint-maurice].
  --output_dir TEXT    Directory for downloaded traces [gpx_traces].
  --offset INTEGER     Pagination offset for OSM requests [0].
  --help               Show this message and exit.

We can find traces in the gpx_traces directory by default. Traces naming follows this pattern:

{output_dir}/trace_{city_name}_{uuid}.gpx

where uuid is based on the host ID and current time. We use uuid to avoid overwriting previous traces.

Note: as of now, bounding box coordinates are hardcoded in the script. An evolution could take them as parameters :)

Example

  • Get 5 gpx traces in Paris from OSM with an offset on 500 (you get the traces 500 to 504)

      python osm2gpx.py --nb_traces 5 --city_name paris --offset 500
    

About

Script to collect public GPS data from the OSM API (0.6) around a given area.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages