- #1856, tiger geocoder: reverse geocoder rating setting for prefer numbered highway name
- #1938, Refactor basic ST_AddBand to add multiple new bands in one call
- #1978, wrong answer when calculating length of a closed circular arc (circle)
+ - #1780, support ST_GeoHash for geography
* Fixes *
gbox_init(&gbox);
gbox_init(&gbox_bounds);
- result = lwgeom_calculate_gbox(lwgeom, &gbox);
+ result = lwgeom_calculate_gbox_cartesian(lwgeom, &gbox);
if ( result == LW_FAILURE ) return NULL;
/* Return error if we are being fed something outside our working bounds */
AS 'MODULE_PATHNAME', 'LWGEOM_summary'
LANGUAGE 'c' IMMUTABLE STRICT;
+-- Availability: 2.1.0
+CREATE OR REPLACE FUNCTION ST_GeoHash(geog geography, maxchars int4 DEFAULT 0)
+ RETURNS TEXT
+ AS 'MODULE_PATHNAME', 'ST_GeoHash'
+ LANGUAGE 'c' IMMUTABLE STRICT;
+
-----------------------------------------------------------------------------
GSERIALIZED *geom = NULL;
int precision = 0;
- int len = 0;
char *geohash = NULL;
- char *result = NULL;
+ text *result = NULL;
if ( PG_ARGISNULL(0) )
{
if ( ! geohash )
PG_RETURN_NULL();
- len = strlen(geohash) + VARHDRSZ;
- result = palloc(len);
- SET_VARSIZE(result, len);
- memcpy(VARDATA(result), geohash, len-VARHDRSZ);
+ result = cstring2text(geohash);
pfree(geohash);
- PG_RETURN_POINTER(result);
-
+
+ PG_RETURN_TEXT_P(result);
}
PG_FUNCTION_INFO_V1(ST_CollectionExtract);