Skip to content

Instantly share code, notes, and snippets.

@mbertrand
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbertrand/6137b5f5e6f3d3290da3 to your computer and use it in GitHub Desktop.
Save mbertrand/6137b5f5e6f3d3290da3 to your computer and use it in GitHub Desktop.
Windshaft mapconfig example
{
"version": "1.2.0",
"layers": [
{
"type": "mapnik",
"options": {
"sql": "select * from jsoncn3857",
"geom_column": "wkb_geometry",
"geom_type": "geometry",
"cartocss": "#layer {line-color:black; line-width:2;polygon-fill:green}",
"cartocss_version": "2.1.0"
}
},
{
"type": "mapnik",
"options": {
"sql": "select * from air2013082815_3857_raster",
"geom_column": "rast",
"geom_type": "raster",
"cartocss": "#style{ raster-opacity: 0.5;}",
"cartocss_version": "2.0.0"
}
}
]
}
ogr2ogr -f PostgreSQL PG:"host=localhost user=geonode password=geonode dbname=gndata" -nln jsoncn3857 -a_srs EPSG:4326 -t_srs EPSG:3857 countries.json
@mbertrand
Copy link
Author

Compiling Mapnik on OSX:

./configure INPUT_PLUGINS=all FRAMEWORK_SEARCH_PATH=/usr/local/Cellar/python/2.7.9/Frameworks/ ICU_INCLUDES=/usr/local/Cellar/icu4c/55.1/include ICU_LIBS=/usr/local/Cellar/icu4c/55.1/lib

@mbertrand
Copy link
Author

reprojection always seems to be from whatever is specified as srid in grainstore to EPSG:3857. So assumption seems to be that all layers in database will be in same projection.

    grainstore: {
                 datasource: {user:'postgres', host: '127.0.0.1', port: 5432, srid: 4326}
    }, //see grainstore npm for other options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment