Skip to content

Instantly share code, notes, and snippets.

@mbertrand
Last active August 29, 2015 14:22
Show Gist options
  • 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

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