]> granicus.if.org Git - postgis/commitdiff
NL warning and add regression test
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 10 Sep 2018 22:27:01 +0000 (22:27 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 10 Sep 2018 22:27:01 +0000 (22:27 +0000)
References #4164

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

liblwgeom/cunit/cu_in_geojson.c
liblwgeom/lwin_geojson.c
regress/tickets.sql
regress/tickets_expected

index d2daacd5188647c5de7dde801a87efc4297115da..bb3ce749d16a7a09fc4e713e0a9c8239b64a9ff0 100644 (file)
@@ -151,13 +151,6 @@ static void in_geojson_test_bbox(void)
 
 static void in_geojson_test_geoms(void)
 {
-       
-       /* Incorrect Polygon (#4164) */
-       // do_geojson_test(
-       //     "POLYGON((0 0,0 5,5 5,5 0,0 0))",
-       //      "{\"type\": \"Polygon\", \"coordinates\": [[0,0],[0,5],[5, 5],[5,0],[0,0]]}",
-       //      NULL);
-
        /* Linestring */
        do_geojson_test(
            "LINESTRING(0 1,2 3,4 5)",
index 6f7afcc8d46b6bcbe3b4df3ad1897a8f3bc47f52..bea570b077abdfd021bc6e538b86604a3775faae 100644 (file)
@@ -282,7 +282,7 @@ parse_geojson_polygon(json_object *geojson, int *hasz, int root_srid)
                                }
                                lwfree(ppa);
                                geojson_lwerror("The 'coordinates' in GeoJSON polygon are not sufficiently nested", 4);
-                               return NULL;                            
+                               return NULL;
                        }
                }
        }
index e4d8bbd3a3aefdca04bf2a0207d6be60deabf4f0..8c1784e18d692400e6b856dec23d1a5b5f2e879d 100644 (file)
@@ -1098,6 +1098,8 @@ from (
     select ST_GeogFromText('SRID=4326;POINT(1.0 2.0)') as a, ST_GeogFromText('SRID=4326;POINT(1.0 1.0)') as b
 ) as points;
 
+-- #4164
+SELECT ST_AsText(ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [[0,0],[0,5],[5, 5],[5,0],[0,0]]}'));
 
 -- Clean up
 DELETE FROM spatial_ref_sys;
index f41f2301ee46c7f3dd33f8157b4db40d1f66fadb..45f44e60217f230809f25132f3adfe45c3a75c13 100644 (file)
@@ -335,3 +335,4 @@ ERROR:  lwgeom_union: GEOS Error: TopologyException: Input geom 0 is invalid: Se
 #4089|LINESTRING Z (1 1 1,3 3 1)
 ERROR:  lwgeom_pointonsurface: GEOS Error: TopologyException: Input geom 1 is invalid: Self-intersection
 #4081|f|t
+ERROR:  The 'coordinates' in GeoJSON polygon are not sufficiently nested