kartotherian/osm-bright.tm2source

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

osm-bright.tm2source

Data source for Kartotherian's fork of OSM Bright

Install

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();'

Editing

To see the data in style

Layers

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.