Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

sample setup for rendering geojson polygons out of couchdb

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.md
Octocat-spinner-32 couchmap.xml
Octocat-spinner-32 shapemap.xml
Octocat-spinner-32 world_merc.dbf
Octocat-spinner-32 world_merc.index
Octocat-spinner-32 world_merc.prj
Octocat-spinner-32 world_merc.shp
Octocat-spinner-32 world_merc.shx
README.md

CouchDB & Mapnik

Requirements

TODO

  • Track down the cause of this warning:
ERROR 1: FetchNextRowsSpatialFilter() failed : not_found, missing handler: _spatial
  • Add support for geocouch (which will likely remove the above warning)

Usage

Create a couch document for a given shapefile:

ogr2ogr -lco UPDATE_PERMISSIONS=ALL -f couchdb couchdb:http://127.0.0.1:5984 world_merc.shp

Then query the document to make sure the geojson is in there:

ogrinfo couchdb:http://127.0.0.1:5984/ -so -al world_merc

You should get:

$ ogrinfo couchdb:http://127.0.0.1:5984/ -so -al world_merc
INFO: Open of `couchdb:http://127.0.0.1:5984/'
      using driver `CouchDB' successful.

Layer name: world_merc
Geometry: Polygon
Feature Count: 245
Extent: (-20037508.342789, -8283343.693883) - (20037508.342789, 18365151.363070)
Layer SRS WKT:
PROJCS["Google Maps Global Mercator",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Mercator_2SP"],
    PARAMETER["standard_parallel_1",0],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
_id: String (0.0)
_rev: String (0.0)
FIPS: String (0.0)
ISO2: String (0.0)
ISO3: String (0.0)
UN: Integer (0.0)
NAME: String (0.0)
AREA: Integer (0.0)
POP2005: Integer (0.0)
REGION: Integer (0.0)
SUBREGION: Integer (0.0)
LON: Real (0.0)
LAT: Real (0.0)

Then try rendering with nik2img:

# install first
sudo easy_install nik2img

# then render
nik2img.py couchmap.xml world.png

Thanks

Even is the humble but brilliant fellow who added couch support to OGR virtually overnight.

Something went wrong with that request. Please try again.