Pages

Monday, May 20, 2013

New __geo_interface__ for PyShp



Christian Ledermann took the initiative to fork pyshp and add the __geo_interface__ convention.
http://twitter.com/GeoJSON


The __geo_interface__ is a community standard riding the current "less is more" entropy wave to get away from heavy data exchange standards, make software compatible, and get some work done.

This standard is very pythonic and well thought out which is no surprise because Sean Gillies and Howard Butler are a driving forces behind it.  The goal is to make moving data around among libraries with different specialties, like Shapely and PySAL, easier.  It is closely tied to GeoJSON which is getting a lot of traction and shaking up the industry and community.

Christian's  __geo_interface__ implementation for PyShp is here:

https://github.com/cleder/pyshp

He also wrote some ogr2ogr-style conversion samples to show you how to use it here:
https://github.com/cleder/geo_file_conv

I'm 100% behind these ideas and will roll this interface into the main trunk.  But there's nothing stopping you from using Christian's fork today.

Enjoy!

1 comment:

  1. Hello, Joel! Thanks for all your posts and examples. I took some of your work and created a method to export an ArcGIS Server query results to shapefile. Since there is no way to export ArcGIS Server services to shapefile w/o the use of publishing a GP service, I thought one was needed. I am not familiar with python, so I did what I could, but I'm open to others perfecting the code. You can fork it from here:
    https://github.com/hcervantes/shpExport.git

    ReplyDelete