Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

geojson-mapnikify

mapbox12ISCdeprecated0.7.2

This module is now under the @mapbox namespace: install @mapbox/geojson-mapnikify instead

transform geojson with simplestyle-spec into mapnik xml

geojson, mapnik, xml, simplestyle

readme

Build Status Coverage Status Code Climate

geojson-mapnikify

Transform GeoJSON objects into Mapnik XML stylesheets with embedded GeoJSON data and simplestyle-spec-derived styles.

install

As a dependency:

npm install --save geojson-mapnikify

As a binary:

npm install -g geojson-mapnikify

api

Assumptions:

  • GeoJSON is valid, and in EPSG:4326
  • Styles, if any, are expressed in simplestyle-spec
  • Mapnik 3.x is the rendering engine

binary

If you install -g, you can use geojson-mapnikify as a binary that takes a single GeoJSON file as an argument and writes a Mapnik XML stylesheet to stdout.

$ geojson-mapnikify test/data/point-retina.geojson > stylesheet.xml
$ geojson-mapnikify test/data/point-retina.geojson retina > stylesheet-retina.xml

mapnikify(geojson, retina, callback)

Transform GeoJSON into Mapnik XML.

  • geojson is a GeoJSON object.
  • retina is true or false for whether the style should be optimized for 2x rendering.
  • callback called with (err, xml) where xml is a string

changelog

changelog

0.7.1

  • Fix bug which tinted all url markers to #7e7e7e unless marker-color was specified.

0.7.0

  • Updated mapnik to 3.5.0

0.5.0

  • Updates node-agentkeepalive dependency to v2.0.2. This is a breaking change for node 0.8.x users.

0.4.3

  • Fixed handling of multipoint geometries