Giter Site home page Giter Site logo

maxsem / osm-bright.tm2source Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kartotherian/osm-bright.tm2source

0.0 3.0 0.0 4.35 MB

Mapbox studio source files for osm2pgsql imported database

License: GNU General Public License v2.0

Shell 17.45% PLpgSQL 82.55%

osm-bright.tm2source's Introduction

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 Mapzen or geofabrik. Once you've installed PostgreSQL and PostGIS, create a database and import with osm2pgsql:

createdb gis
psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;'
osm2pgsql -d gis -E 900913 --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

curl -O http://data.openstreetmapdata.com/water-polygons-split-3857.zip
unzip water-polygons-split-3857.zip && rm water-polygons-split-3857.zip
cd water-polygons-split-3857
shp2pgsql -I -s 3857 -g way water_polygons.shp water_polygons | psql -Xqd gis
psql -Xqd gis -c "select UpdateGeometrySRID('', 'water_polygons', 'way', 900913);"

Then some custom functions and indexes

cd .. # return to osm-bright.tm2source directory
npm install
psql -Xqd gis -f node_modules/postgis-vt-util/lib.sql
psql -Xqd gis -f sql/admin.sql
psql -Xqd gis -f sql/functions.sql
psql -Xqd gis -f sql/create-indexes.sql
psql -d gis -c 'select populate_admin();'

Editing

  • Clone osm-bright.tm2source repository (this one)
  • Install the latest Mapbox Studio Classic Open Mapbox Studio and open the data source. You should see your data as "x-ray" outlines. Don't edit just data.yml or data.xml - they must be in sync; editing this project in MBS only ensures that.

To see the data in style

  • Clone osm-bright.tm2 repository
  • Edit style's project.yml - change the source: to "tmsource:///home/user/.../osm-bright.tm2source" directory. Open it in the Mapbox Studio.

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.

osm-bright.tm2source's People

Contributors

maxsem avatar nyurik avatar pnorman avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.