Skip to content

bonham/gpx_track_neighborhood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPX Proximator

  • You have a set of gpx tracks
  • You want to display them on a map
  • You want color coding depending on how often you passed the same roads

The project does calculate proximity of multiple tracks from gpx files. It does prepare static and mobile friendly html pages, including all gps data.

Howto

  • Download the project from github
  • Install dependencies from below
  • Put all your gpx tracks in a directory Run all python commands below. Use --help to learn what arguments to provide
  • Define env variable GPX_SNIP_COORDS with space separated list of lat lon locations for all points in 1km distance to cut out: 'D.dddd,D.dddd D.dddd,D.dddd'
  • Initialize database. Run these commands
    • initdb cd <datbase-name>
    • initdb cs <datbase-name> <schema>
    • initdb_proximator <datbase-name> <schema>
  • calculate intersections of gpx tracks and export color coded geojson for html pages. Your geojson dataset will be in subdir html/static/geojson/
    • proximity_calc <directory> <datbase-name> <schema>
    • export_geojson <datbase-name> <schema> <dataset_label>
  • Read about different export modes
  • Repeat steps from above for each dataset you have. Each new dataset_label will create a new subdirectory and a new button on the webpage.
  • cd to subdirectory html and run npm run build. See details here

The finished web pages are in subdirectory html/dist. Push all files from that folder to a webserver and open it in browser. To view the files locally, use npm start. This will start the parcel server.

Platforms

Developed and tested on Windows. Will very likely run on linux too.

Dependencies

  • Install postgres from https://www.postgresql.org ( tested with version 12, should also run with 10 or 11)
  • Install postgis 3.0.3 from https://postgis.net. Should also work with older versions e.g. 2.4.2
  • Install python 3.6 or higher
  • Install python requirements:
    • cd python
    • pip install -e .
  • Install node.js 12.x.x ( with npm )
  • cd to html subdir. Then install all dependencies in package.json by running npm install