Name: osm-bright.tm2source
Owner: kartotherian
Description: Mapbox studio source files for osm2pgsql imported database
Created: 2015-04-28 02:57:15.0
Updated: 2018-05-03 14:35:03.0
Pushed: 2018-05-03 14:35:02.0
Homepage: null
Size: 4478
Language: SQLPL
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Data source for Kartotherian's fork of OSM Bright
This style requires an osm2pgsql database with ocean data, custom indexes, and custom functions.
It's probably easiest to grab an PBF of OSM data from geofabrik. Once you've installed PostgreSQL and PostGIS, create a database and import with osm2pgsql:
tedb gis
-d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;'
pgsql -d gis -E 3857 --hstore ~/path/to/data.osm.pbf
You can find a more detailed guide to setting up a database and loading data with osm2pgsql at switch2osm.org.
Next we need some shapefiles
-O http://data.openstreetmapdata.com/water-polygons-split-3857.zip
p water-polygons-split-3857.zip && rm water-polygons-split-3857.zip
ater-polygons-split-3857
pgsql -I -s 3857 -g way water_polygons.shp water_polygons | psql -Xqd gis
Then some custom functions and indexes
. # return to osm-bright.tm2source directory
install
-Xqd gis -f node_modules/postgis-vt-util/lib.sql
-Xqd gis -f sql/admin.sql
-Xqd gis -f sql/functions.sql
-Xqd gis -f sql/create-indexes.sql
-Xqd gis -f sql/names.sql
-d gis -c 'select populate_admin();'
To see the data in style
source:
to "tmsource:///home/user/.../osm-bright.tm2source"
directory.
Open it in the Mapbox Studio.The order of layers in this style matters because that's the default order that they will be drawn on map. Note that the list of layers goes from bottom to top, opposite to the order in files.
landuse
- various uses for land: wood, park, industrial zone, etc. Mostly corresponds to OSM's landuse
key.waterway
- [http://wiki.openstreetmap.org/wiki/Key:waterway](streams, rivers on low zoom, etc).water
- water bodies (oceans, lakes, rivers wide enough on a given zoom level to be represented by areas as opposed to lines).aeroway
- both areas and lines related to airports: [http://wiki.openstreetmap.org/wiki/Key:aeroway](tarmacs, taxiing lines, etc).building
- buildings.road
- roads and other similar transport ways: streets, bridges and tunnels.admin
- [http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative](administrative borders) between countries and regions.country_label
- country labels.place_label
- city/neighborhood/district labels.poi_label
- places of interest. Currently, only transport stations are implemented.road_label
- road labels, including highway number shields.