jonthesquirrel / geojson2png

GeoJSON to PNG example with Mapnik and NodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert GeoJSON to image

Example 3

node example3.js geojsonfile <width> <height>

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

About

GeoJSON to PNG example with Mapnik and NodeJS


Languages

Language:JavaScript 100.0%