From: Sandro Santilli Date: Wed, 11 Jan 2012 11:17:03 +0000 (+0000) Subject: Unlease higher dimensions in ST_AsBinary, using SQL/MM (#288) X-Git-Tag: 2.0.0alpha1~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2b342f3a61dad1cda37176c4f6b12445e024bbd;p=postgis Unlease higher dimensions in ST_AsBinary, using SQL/MM (#288) git-svn-id: http://svn.osgeo.org/postgis/trunk@8769 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index 9782e6b3a..c36d1b76d 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,8 @@ PostGIS 2.0.0 - #817 Renaming old 3D functions to the convention ST_3D (Nicklas Avén) - #548 (sorta), ST_NumGeometries,ST_GeometryN now returns 1 (or the geometry) instead of null for single geometries (Sandro Santilli, Maxime van Noppen) + - #287, #288 ST_AsText and ST_AsBinary don't force 2d anymore, using SQL/MM + notation for higher dimensions * New Features * @@ -103,7 +105,6 @@ PostGIS 2.0.0 (Regina Obe, Leo Hsu / Paragon Corporation / funding provided by Hunter Systems Group) - Overall Documentation proofreading and corrections. (Kasif Rasul) - - ST_AsText support for higher dimensions (#287) * Bug Fixes * - #1335 ST_AddPoint returns incorrect result on Linux (Even Rouault) diff --git a/postgis/lwgeom_ogc.c b/postgis/lwgeom_ogc.c index 2fee53616..9fec072b8 100644 --- a/postgis/lwgeom_ogc.c +++ b/postgis/lwgeom_ogc.c @@ -850,21 +850,12 @@ Datum LWGEOM_asBinary(PG_FUNCTION_ARGS) uint8_t *wkb; size_t wkb_size; bytea *result; - /* By default we are currently emitting OGC WKB (2D) only */ - uint8_t variant = WKB_SFSQL; + uint8_t variant = WKB_ISO; /* Get a 2D version of the geometry */ geom = (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); lwgeom = lwgeom_from_gserialized(geom); - /* Get a 2D version of the geometry if necessary */ - if ( lwgeom_ndims(lwgeom) > 2 ) - { - LWGEOM *lwgeom2d = lwgeom_force_2d(lwgeom); - lwgeom_free(lwgeom); - lwgeom = lwgeom2d; - } - /* If user specified endianness, respect it */ if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) ) {