Thursday 4 August 2016

Raspberry Pi GPS Tracker with Openstreetmap offline tiles

1) save OSM tiles to raspberry pi using maperitive in mbtiles format
  I needed to use the windows version to download the tiles, then copy to raspberry pi

2) use Tilestache to serve the tiles
my config file is in the previous post. The layer I called "osm" and is used in the map config in Traccar.
I needed to bind the tilestache server to my pi LAN IP for traccar to connect: start tilstache with the command
tilestache-server.py -i 192.168.1.19 -p 8080
adjust as necessary for your ip and port.

3) edit Traccar in TWO places
  run traccar, login as admin, then click

Settings-->Server--> Map Layer: custom map
custom map :http://192.168.1.19:8080/osm/{z}/{x}/{y}.png

change ip and port to suit, and layer name (osm) if needed if you called your tilestache layer something else

you also need to change the USER to use the custom map
Settings-->USERS-->click on your user, click edit (pencil icon)
change map layer to Custom map.

back on the tilestache console you should then see requests being logged for different zooms.







No comments:

Post a Comment