]> granicus.if.org Git - postgis/commitdiff
Have ST_Summary advertise presence of known srid with an [S] flag
authorSandro Santilli <strk@keybit.net>
Fri, 18 Jan 2013 18:09:22 +0000 (18:09 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 18 Jan 2013 18:09:22 +0000 (18:09 +0000)
Closes #2178

git-svn-id: http://svn.osgeo.org/postgis/trunk@11004 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
liblwgeom/lwgeom_debug.c
regress/summary_expected
regress/tickets_expected

diff --git a/NEWS b/NEWS
index e146b602f1aee9b4b8024e68de5cd9112570888e..3f3e07cd21a694890e9a0ef522985699fd9ea010 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -112,6 +112,7 @@ PostGIS 2.1.0
     variant of ST_SetValues(rast).
   - Proper support for raster band's isnodata flag in core API and loader.
   - Additional default values for parameters of ST_Aspect and ST_HillShade
+  - #2178, ST_Summary now advertises presence of known srid with an [S] flag
 
 * Fixes *
 
index 2464645cce0a3c5ad5aff9872a447dd6f337a1c0..97a69ead8f488470b262e257d7c0ab144efbbe30 100644 (file)
 #include <string.h>
 
 /* Place to hold the ZM string used in other summaries */
-static char tflags[5];
+static char tflags[6];
 
 static char *
-lwtype_flagchars(uint8_t flags)
+lwgeom_flagchars(LWGEOM *lwg)
 {
        int flagno = 0;
-       if ( FLAGS_GET_Z(flags) ) tflags[flagno++] = 'Z';
-       if ( FLAGS_GET_M(flags) ) tflags[flagno++] = 'M';
-       if ( FLAGS_GET_BBOX(flags) ) tflags[flagno++] = 'B';
-       if ( FLAGS_GET_GEODETIC(flags) ) tflags[flagno++] = 'G';
+       if ( FLAGS_GET_Z(lwg->flags) ) tflags[flagno++] = 'Z';
+       if ( FLAGS_GET_M(lwg->flags) ) tflags[flagno++] = 'M';
+       if ( FLAGS_GET_BBOX(lwg->flags) ) tflags[flagno++] = 'B';
+       if ( FLAGS_GET_GEODETIC(lwg->flags) ) tflags[flagno++] = 'G';
+       if ( lwg->srid != SRID_UNKNOWN ) tflags[flagno++] = 'S';
        tflags[flagno] = '\0';
 
        LWDEBUGF(4, "Flags: %s - returning %p", flags, tflags);
@@ -42,7 +43,7 @@ lwpoint_summary(LWPOINT *point, int offset)
 {
        char *result;
        char *pad="";
-       char *zmflags = lwtype_flagchars(point->flags);
+       char *zmflags = lwgeom_flagchars((LWGEOM*)point);
 
        result = (char *)lwalloc(128+offset);
 
@@ -57,7 +58,7 @@ lwline_summary(LWLINE *line, int offset)
 {
        char *result;
        char *pad="";
-       char *zmflags = lwtype_flagchars(line->flags);
+       char *zmflags = lwgeom_flagchars((LWGEOM*)line);
 
        result = (char *)lwalloc(128+offset);
 
@@ -78,7 +79,7 @@ lwcollection_summary(LWCOLLECTION *col, int offset)
        int i;
        static char *nl = "\n";
        char *pad="";
-       char *zmflags = lwtype_flagchars(col->flags);
+       char *zmflags = lwgeom_flagchars((LWGEOM*)col);
 
        LWDEBUG(2, "lwcollection_summary called");
 
@@ -116,7 +117,7 @@ lwpoly_summary(LWPOLY *poly, int offset)
        int i;
        char *pad="";
        static char *nl = "\n";
-       char *zmflags = lwtype_flagchars(poly->flags);
+       char *zmflags = lwgeom_flagchars((LWGEOM*)poly);
 
        LWDEBUG(2, "lwpoly_summary called");
 
index fe2ba7dddccf116ea49aa6ad52e938427596176c..1a2c48529b4d24d70ae115e52e63b9b888d19c44 100644 (file)
@@ -1,14 +1,14 @@
 T1|Point[]
 T1B|Point[B]
-T1S|Point[]
+T1S|Point[S]
 T1M|Point[M]
 T1Z|Point[Z]
 T1ZM|Point[ZM]
 T1ZMB|Point[ZMB]
-T1ZMBS|Point[ZMB]
+T1ZMBS|Point[ZMBS]
 T3|MultiPoint[B] with 1 elements
   Point[]
-T4|MultiPoint[B] with 1 elements
+T4|MultiPoint[BS] with 1 elements
   Point[]
 T5|GeometryCollection[B] with 2 elements
   MultiLineString[] with 2 elements
@@ -16,7 +16,7 @@ T5|GeometryCollection[B] with 2 elements
     LineString[] with 2 points
   MultiPoint[] with 1 elements
     Point[]
-T6|GeometryCollection[B] with 2 elements
+T6|GeometryCollection[BS] with 2 elements
   MultiLineString[] with 2 elements
     LineString[] with 2 points
     LineString[] with 2 points
index 7bcf711c908df68910bec3e74ee2d82ef8c1894e..ce3667b42308321a3e52fd47480d3c0bf9ead64e 100644 (file)
@@ -198,9 +198,9 @@ NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRA
 #1398b|POINT(-160.137654 77.091608)
 #1543|MULTILINESTRING((0 0,10 0,10 10,0 0),(0 0))|POLYGON((0 0,10 10,10 0,0 0))
 #1578|f|f
-#1580.1|Point[B]
+#1580.1|Point[BS]
 ERROR:  transform: couldn't project point (180 90 0): tolerance condition error (-20)
-#1580.3|Point[B]
+#1580.3|Point[BS]
 #1596.1|public.road_pg.roads_geom SRID:3395 TYPE:POINT DIMS:2 
 ERROR:  invalid SRID: 330000 not found in spatial_ref_sys
 #1596.3|3395
@@ -209,7 +209,7 @@ ERROR:  invalid SRID: 999000 not found in spatial_ref_sys
 NOTICE:  SRID value -1 converted to the officially unknown SRID value 0
 #1596.6|public.road_pg.roads_geom SRID changed to 0
 #1596.7|0
-#1596|Point[BG]
+#1596|Point[BGS]
 #1695|MULTIPOLYGON EMPTY
 #1697.1|0
 #1697.2|0