Have ideas to improve npm?Join in the discussion! »

    @kartotherian/osm-bright-source

    1.0.6-wmf.0 • Public • Published

    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:

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

    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

    Then some custom functions and indexes

    cd .. # return to osm-bright.tm2source directory
    npm install
    psql -Xqd gis -f node_modules/@kartotherian/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 -Xqd gis -f sql/names.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.

    • landuse - various uses for land: wood, park, industrial zone, etc. Mostly corresponds to OSM's landuse 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: tarmacs, taxiing lines, etc.
    • building - buildings.
    • road - roads and other similar transport ways: streets, bridges and tunnels.
    • admin - 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.

    Install

    npm i @kartotherian/osm-bright-source

    DownloadsWeekly Downloads

    14

    Version

    1.0.6-wmf.0

    License

    GPL-2.0

    Unpacked Size

    82.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar