Giter VIP home page Giter VIP logo

osm-carto-alternative-colors's Introduction

OSM-Carto alternative colors map style

screenshot

This is a fork of the OpenStreetMap Carto map style implementing a different color scheme, various improvements regarding path, road and water feature rendering and overall a different approach to cartographic design.

screenshot2 screenshot3 screenshot4 screenshot5 screenshot6

Features

The following are the major design differences of this style compared to OpenStreetMap Carto:

  • a different low to mid zoom color scheme that is used without algorithmic color fading and that therefore allows more conscious color design choices.
  • various changes in the landcover color scheme matching the cartographic principles (see below).
  • a three color system for waterbody rendering.
  • low zoom waterbody rendering based on preprocessed data.
  • extensive redesign of waterbody rendering in general including distinct rendering of intermittent and saltwater waterbodies and waterways.
  • different color for administrative boundaries, distinct rendering of maritime boundaries.
  • changed road colors with purple motorways and yellow tertiary roads
  • different color scheme and different design of path/footway/cycleway rendering as well as track rendering at mid zoom levels.
  • more sophisticated rendering of waterway barriers (dams, lock gates, weirs and waterfalls) as well as fords.
  • different rendering of springs and addition of rendering of other water related point features.
  • different color for transportation and accomodation related point symbols.
  • different patterns for woodland and differentiated rendering of leaf_cycle.
  • rendering of implicit embankments and cuttings (embankment=yes/cutting=yes) in highways, railways and waterways
  • rendering of archipelagos based on convex hull
  • rendering of various farmland and orchard types with special patterns
  • rendering of landuse=salt_pond
  • rendering of natural=ridge and natural=arete with a linear structure pattern
  • golf course rendering derived from the French style
  • rendering sport type on pitches using single symbol patterns
  • rendering of entrances in barriers mapped with nodes
  • complete re-design of the road rendering framework with:
    • ground unit width rendering of roads
    • lane depiction on roads
    • rendering of implicitly mapped sidewalks on roads
    • rendering of implicitly mapped streetside parkings and parking/cycle/bus lanes
    • differentiated rendering of turning circles, turning loops, mini roundabouts and passing places
    • rendering of details on steps
    • differentiation of unpaved roads
    • new access restriction semantics based on primary mode of transport and additional permissions
    • display of additional permissions on road classes with implicit access restrictions
  • rendering of natural=tree, natural=shrub, natural=tree_row and natural=hedge differentiated by leaf_type/leaf_cycle
  • embankment like illustration of hedge=hedge_bank
  • a modular style definition with different layers in separate files and the possibility to define style variants like with simplified versions of specific high complexity layers.
  • script generated MSS/SQL code for the POI symbol and label rendering making the style scale better with a large number of POI types.
  • regionally differentiated font lists for label rendering to better conform with different regional typographic conventions (using preprocessed administrative area polygons for lookup).
  • rendering of compound name labels in multilingual regions based on matching name:<lang> tags with parts of the name tag and interpreting default_language tags.
  • rendering of natural=earth_bank, natural=gully and natural=crevasse
  • differentiated rendering of natural=earth_bank with earth_bank=grassy_steep_slope and natural=cliff with surface=ice
  • rendering of man_made=dyke with line signature parametrized according to width tagging
  • differentiated rendering of barrier=fence, barrier=guard_rail, barrier=wall, barrier=retaining_wall and barrier=ditch.
  • rendering of barrier=wall, barrier=retaining_wall and barrier=ditch and barrier=city_wall/historic=citywalls parametrized according to width tagging
  • distinct rendering of barrier=wall and barrier=retaining_wall for height<=0.5
  • rendering of different types of parking spaces using single symbol patterns
  • rendering of surface type on parkings using a structure pattern
  • symbol augmentation for parkings illustrating secondary tags
  • symbol augmentation for bus/tram stops with a shelter
  • rendering some types of buildings with a distinct design at high zoom levels (building=roof, building=greenhouse, building=garages, building=garage, building=carport)
  • rendering of street lights with a design derived from the french style

Samples

There is a collection of sample rendering available for a more extensive impression of the looks of this style on https://imagico.de/map/ac_samples_en.php

Cartographic principles

CARTOGRAPHY.md outlines the guiding principles of cartographic design in this project.

Upstream changes

This style is not regularly synchronized with upstream changes but I occasionally integrate changes that fit into the design concept here.

Installation

See INSTALL.md for the generic OSM-Carto installation instructions. In addition you need to install the a number of functions in PostGIS supplied in:

  • sql/z.sql
  • sql/line-widths-generated.sql
  • sql/map_functions.sql
  • sql/roads.sql
  • sql/names.sql
  • sql/symbols.sql

Be aware that this style does not work well together with Postgresql JIT optimization. It is highly advisable to turn that feature off in your Postgresql configuration.

Also the newest changes depend on a custom version of Carto. If you don't want to use that you can remove the XML code within CartoCSS code in symbols-labels.yaml but you will loose the features that depend on that of course. How you can modify kosmtik to use a custom local version of carto can be found here.

Symbol augmentation used for rendering some symbols depends on a custom extension of Mapnik. You can use the style without it, but will get some warnings and will not be able to use the symbol augmentation.

For rendering all languages as intended you also need to download custom fonts - for which i adapted the get-fonts.sh from upstream. To get just the AC-Style specific fonts you can run the script without parameters, to get all the fonts used by OSM-Carto run get-fonts.sh all.

Simplified version for faster rendering

The style uses a new, modular concept for setting up the rendering layers that allows specifying different variants and simplified versions of layers that are expensive in rendering.

scripts/assemble_project.py -t simple

is going to be the way to invoke that. This feature has not been finalized yet.

License

Design components of the project are subject to the Creative Commons Attribution ShareAlike 4.0 (CC BY-SA 4.0) License.

Software components of the project are subject to the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See LICENSE.txt for details.

osm-carto-alternative-colors's People

Contributors

altoing avatar andrewhain avatar danstowell avatar dkniffin avatar erictheise avatar firefishy avatar floscher avatar gravitystorm avatar holgerjeromin avatar ian29 avatar imagico avatar ircama avatar jdhoek avatar kaldari avatar kocio-pl avatar kreed avatar matkoniecz avatar matthijsmelissen avatar meased avatar micahcochran avatar micechal avatar mkoniecz avatar mrwojo avatar nebulon42 avatar pnorman avatar polarbearing avatar sommerluk avatar styxman avatar vholten avatar woodpeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

infinatious

osm-carto-alternative-colors's Issues

Fails with PostgreSQL 10.x

Pg 10.x does no longer allow set returning functions in a CASE statement, as announced in the 10.x release notes:

Change the implementation of set-returning functions appearing in a query's SELECT list (Andres Freund)

Set-returning functions are now evaluated before evaluation of scalar expressions in the SELECT list, much as though they had been placed in a LATERAL FROM-clause item. This allows saner semantics for cases where multiple set-returning functions are present. If they return different numbers of rows, the shorter results are extended to match the longest result by adding nulls. Previously the results were cycled until they all terminated at the same time, producing a number of rows equal to the least common multiple of the functions' periods. In addition, set-returning functions are now disallowed within CASE and COALESCE constructs.

https://www.postgresql.org/docs/devel/release-10.html#id-1.11.6.14.4

This leads to the following error when trying to use the style in my test setup:

RuntimeError: Postgis Plugin: ERROR:  set-returning functions are not allowed in CASE
LINE 42:             (ST_Dump(ST_Collect(
                      ^
HINT:  You might be able to move the set-returning function into a LATERAL FROM item.
in executeQuery Full sql was: 'SELECT * FROM (SELECT
    way,
    way_pixels,
    feature,
    name,
    is_building
  FROM
    (SELECT
        way,
        way_area/NULLIF(0::real*0::real,0) AS way_pixels,
        COALESCE(
          'landuse_' || CASE WHEN landuse IN ('forest', 'military') THEN landuse ELSE NULL END,
          'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock') THEN "natural" ELSE NULL END,
          'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END,
          'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END,
          'leisure_' || CASE WHEN leisure IN ('nature_reserve') THEN leisure ELSE NULL END
        ) AS feature,
        name,
        'no' AS is_building
      FROM planet_osm_polygon
      WHERE (landuse IN ('forest', 'military')
          OR "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock')
          OR "place" IN ('island')
          OR boundary IN ('national_park')
          OR leisure IN ('nature_reserve'))
        AND building IS NULL
        AND name IS NOT NULL
     UNION ALL
     SELECT
        ST_ClosestPoint(oway,ST_PointOnSurface(way)),
        ST_Area(ST_Envelope(oway))/NULLIF(0::real*0::real,0) AS way_pixels,
        'place_archipelago' AS feature,
        name,
        'no' AS is_building
     FROM
       (SELECT
          -- this detects multipolygons extending over the 180 degree meridian to split them
          CASE WHEN (ST_XMax(way)-ST_XMin(way)) < 20037508 THEN
            ST_ConvexHull(way)
          ELSE
            -- splits the polygon into the two hemisphere parts
            (ST_Dump(ST_Collect(
              ST_ConvexHull(ST_Intersection(way, ST_SetSRID(ST_GeomFromText('POLYGON((-20037508 -20037508, -20037508 20037508, 0 20037508, 0 -20037508, -20037508 -20037508))'), 3857))),
              ST_ConvexHull(ST_Intersection(way, ST_SetSRID(ST_GeomFromText('POLYGON((0 -20037508, 0 20037508, 20037508 20037508, 20037508 -20037508, 0 -20037508))'), 3857)))
            ))).geom
          END AS way,
          way AS oway,
          name
        FROM planet_osm_polygon
        WHERE "place" IN ('archipelago')
          AND building IS NULL
          AND name IS NOT NULL
      ) AS archipelagos
    ) AS labels
  ORDER BY way_pixels DESC
) AS text_poly_low_zoom LIMIT 0'

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.