Mapping pycsw Deployments

As the number of pycsw deployments increase, we’ve started to keep a living document of live deployments on the pycsw wiki. Being a geogeek, naturally I said to myself, “hmm, would be cool to plot these all on a map”.  Embedding maps has become easier than ever, and projects like MapServer and GeoServer have cool maps right on their homepages, which demo their maps against a theme like the next FOSS4G conference, etc.

pycsw is a bit different in that it doesn’t do maps, but certainly catalogues them and makes them discoverable via OGC:CSW, OpenSearch and SRU.  And putting a sample GetRecords output on the website as a demo is boring.  So mapping live deployments seemed like a cool idea for a quick hack with reproducible workflow so it doesn’t become a pain to keep things up to date.

The pycsw website is managed using reStructuredText and Sphinx; source code, issue tracker and wiki are hosted on GitHub.  The first thing was to update each deployment on the wiki page with a lat/long pair (the lat/long pair being loosely based the location of the CSW itself, or the content of the CSW.  Aside: it would be cool if CSW Capabilities XML specified a BBOX like WMS does to give folks an idea of the location of records).

After this, I wrote a Python script to fetch (and cache) the raw wiki page content.  Then, using Leaflet, setup a simple map and create markers foreach live deployment.

So now I have a JavaScript snippet, now how do I add this to a page?  Using the Sphinx Makefile, I update the html target to run the Python script and save it to an area where I embed it using a rST include.

That’s pretty much it.  So now whenever the live deployment page is updated, a simple make clean && make html will keep things up to date.  Reproducible workflow!

I’ve published this to the pycsw community page.  Do you have a pycsw install?  Add it to and we’ll put it on the map!

Leave a Comment

Name: (Required)

E-mail: (Required)



Modified: 8 June 2013 21:00:10 EST