You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export LD_LIBRARY_PATH=/opt/glfw-3.1.1/glfw-build/src:$LD_LIBRARY_PATHexport CPLUS_INCLUDE_PATH=/opt/glfw-3.1.1/include:$CPLUS_INCLUDE_PATHexport PKG_CONFIG_PATH=/opt/glfw-3.1.1/glfw-build/src:$PKG_CONFIG_PATH#may symlinking of /usr/lib/libglfw3.a -> /opt/glfw-3.1.1/glfw-build/src/libglfw3.a is required
make linux
Make your own GPS device with Tangram-es and RaspberryPi
A couple of months ago the nice folks at RaspberryPi published a blog post about Tangram-ES, Mapzen's native 2D/3D map rendering engine running on their hardware. The feedback was great and people seemed to be very excited to start using it for their own projects.
Tangram-ES is a work-in-progress map engine written in C++ and openGL ES 2.0, so it can be a little intimidating to start from scratch. That's why we thought this small weekend project could get the ball rolling and ignite some ideas in the community.
Then, just to make sure it is working, compile tangram and then run it.
export CXX=/usr/bin/g++-4.8
cd build
cmake ..
make
cd bin
./pi-gps -m
Note: we are running tangram with the -m flag to display the mouse.
Configure Tangram-ES to fetch tiles locally
Getting fast internet access to your RaspberryPi could be a problem, especially if you are planning to use this GPS device on your bicycle. Let’s see what you need to do to download the map tiles locally making your map network-independent.
We installed Tangram-ES and tested it in the previous section. Now is time for us to make some changes so Tangram-ES will search for local files instead of fetching them from a server. Lucky us, we just need to change that from the configuration YAML file. As the web version of Tangram, this engine is super flexible and you can customize most of it from this file.
Go and open the ~/PI-GPS/tangram-es/core/resources/config.yaml file. And edit the following line:
Now is the time to download some vector tiles. For that we need the OpenStreetMap ID of the place we want to download. Go to OpenStreetMap Website and search for a location and check its ID (the number between brackets).
For example:
Buenos Aires (1224652)
London (65606)
Manhattan (3954665)
New York City (175905)
Paris (7444)
Rio de Janeiro (2697338)
Rome (41485)
Sydney (13766899)
Tokyo (4479121)
Tucson (253824)
Note: To change the initial coordinates of the map, open ~/PI-GPS/tangram-es/core/resources/config.yaml again and add a line to the camera block so that it looks like this:
Substitute your own longitude and latitude in the position values. Once we choose a place, tangram will start fetching the vector tiles that we will need. For that we will use the python script we downloaded with the given OSM ID and the zoom level we are interested (in our case all of them are from 1 to 18).
python landgrab.py 3954665 1-18
This may take a while. Go get a coffee.
Finally! Run it and enjoy your 3D map!
Well done! Everything is ready, unplug your internet connection and run tangram on your RaspberryPi!
cd~/PI-GPS/build/bin
./pi-gps -m
I hope you are excited about all the possibilities of having cool 3D maps on your projects. Send us your opinions, feedback or photos of your work!