Princi Vershwal: Vector Tile Support for OpenStreetMap’s iD Editor |
Protocolbuffer Binary Format(.pbf) and Mapbox Vector Tiles(.mvt) are two popular formats for sharing map data. Prior to this GSoC project, the iD editor in OSM supported GPX data. GPX is an XML schema designed as a common GPS data format for software applications. It can be used to describe waypoints, tracks, and routes.
The main objective of the project was to add support for vector tile data to iD. MVT and PBF contain data of a particular tile. These files contain data in Protocolbuffer binary format and can have various sets of data like name of cities, or train stations etc. This data can be in the form of points, lines or polygons. A vector tile looks something like this :
The goal is to draw the data of these tile on iD and it should show up on the screen like this :
For implementing the feature the following steps were followed:
All the work related to the above steps is here.
4. Next step was writing the tests for the above code. Tests for the code are here.
Performance Testing
4. This URL when passed to iD draws the vector tile like this :
URL used : http://preview.ideditor.com/master/#background=Bing&disable_features=boundaries&map=9.00/39.7225/-74.0153&mvt=https://a.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7/12/1207/1541.vector.pbf?access_token= ‘pk.0000.1111’
# replace value with your mapbox public access token
Some More Interesting Stuff
There is much more that can be done with vector tiles. One thing is better styling of the drawings. A very next step is to provide different colors to different layers of the tile data.
For more discussion, you can follow here.
My earlier blogs can be found here.
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |