A simple wrapper around MapServer (http://mapserver.org/) to enable
- MapServer map files to be written in JSON and stored in CouchDB
- MapServer to be managed and run in an Erlang OTP supervision process
- GDAL CouchDB OGR driver to serve GeoJSON directly from CouchDB as a WFS or rendered through WMS
MapServer is an Open Source platform for publishing spatial data and interactive mapping applications to the web.
- Couchbase trunk
https://github.com/couchbase/couchdb-manifest (I used the preview branch and set up rake / ruby using RVM)
(currently GeoCouch uses couch_file:flush which isn't in couchdb trunk yet)
GDAL OGR couchdb driver can perform client side filtering, however in ogrcouchdbtablelayer if couchdb isn't present then the error is written to stderr which causes MapServer to raise an error.
- GDAL trunk
- MapServer trunk with CouchDB wrapper
browse here https://github.com/normanb/mapserver/tree/master/mapserver
Configure as follows
./configure --with-wms --with-wfs --with-wcs --with-gdal --with-ogr --with-proj --with-couchdb
Edit config/couchmaps.ini and copy to local.d and add couchmaps ebin files to path
and copy beam files there.
note: currently map files are writting to tmp, but this can be override with a mapserver section in the ini file
tmp = /myothertmp
- Populate database
ogr2ogr -f couchdb -lco "UPDATE_PERMISSIONS=ALL" "couchdb:http://localhost:8000" bcpos_trails.shp
- Create a database called mapserver
Add sample mapserver map
curl -X PUT --data-binary @sample.map http://localhost:8000/mapserver/_mapserv/sample.map
this will convert the sample.map in mapfile format to JSON.
Note you can lock down http client browsing of sample.map with a redirect in couchdb that will not affect server operation.
- Test WFS GetCapabilities
- Test WFS GetFeature
if using geocouch, then test directly first
The geojson data in CouchDB (step 6) is now returned as GML
- Test WMS GetMap
and open up the returned geotiff to see a rendering of the geojson data in (6).