C implementation for GeoHash input
|Reported by:||darkpanda||Owned by:||pramsey|
As discussed briefly at http://postgis.refractions.net/pipermail/postgis-devel/2012-April/020364.html , I took a couple of hours over the weekend and wrote up an implementation of some functions for converting from GeoHash strings to box2ds and geometries and such. I've attached a patch that adds a few functions for GeoHash input along with some regression tests. I haven't written up any documentation yet as this is really kind of a first-pass and my first attempt at a PostGIS patch, so have at it and see if it's relatively sane and I'll get to the documentation next. I've made the patch against the current svn head at r9732 via strk's github repository.
The patch itself contains the following functions:
ST_Box2dFromGeoHash(geohash text [, precision int4 default null]) ST_GeomFromGeoHash(geohash text [, precision int4 default null]) ST_PointFromGeoHash(geohash text [, precision int4 default null])
Where the default precision is the full precision of the GeoHash.