/geojson2png

GeoJSON to PNG example with Mapnik and NodeJS

Primary LanguageJavaScript

Convert GeoJSON to image

Usage:

npm install
node example1.js
node example2.js

Example 1

Source data: countries.geojson from here

Converts the JSON file into XML intermediately and then renders it without any style information, uses the geojson-mapnikify defaults which are specified in geojson-mapnikify/lib/defaults.js.

Output:

countries.geojson rendered 1

Example 2

Source data: Same as above

Loads a stylesheet XML countries-stylesheet.xml file, which then fetches its data from the same countries.geojson. Specifies some filters, styling rules and the projection.

Output:

countries.geojson rendered with stylesheet