From f7e12b7efe28dcfb335de3dff1e74c63b4c8e7d5 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Mon, 16 Mar 2015 18:38:09 +0000 Subject: [PATCH] #3061, do not drop repeated points when reading JSON/GML/KML git-svn-id: http://svn.osgeo.org/postgis/trunk@13340 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 2 ++ liblwgeom/lwin_geojson.c | 2 +- postgis/lwgeom_in_gml.c | 2 +- postgis/lwgeom_in_kml.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d45467e52..8cc291615 100644 --- a/NEWS +++ b/NEWS @@ -90,6 +90,8 @@ PostGIS 2.2.0 - #2822, Use @ operator instead of ST_CoveredBy() for raster max extent constraint - #3020, ST_AddBand out-db bug where height using width value + - #3061, Allow duplicate points in JSON, GML, GML ST_GeomFrom* functions + * Code refactoring * diff --git a/liblwgeom/lwin_geojson.c b/liblwgeom/lwin_geojson.c index 8987cd591..60b728a34 100644 --- a/liblwgeom/lwin_geojson.c +++ b/liblwgeom/lwin_geojson.c @@ -122,7 +122,7 @@ parse_geojson_coord(json_object *poObj, int *hasz, POINTARRAY *pa) } - return ptarray_append_point(pa, &pt, LW_FALSE); + return ptarray_append_point(pa, &pt, LW_TRUE); } static LWGEOM* diff --git a/postgis/lwgeom_in_gml.c b/postgis/lwgeom_in_gml.c index eee270dc1..4fd0ef618 100644 --- a/postgis/lwgeom_in_gml.c +++ b/postgis/lwgeom_in_gml.c @@ -601,7 +601,7 @@ static POINTARRAY* parse_gml_coordinates(xmlNodePtr xnode, bool *hasz) *hasz = false; } - ptarray_append_point(dpa, &pt, LW_FALSE); + ptarray_append_point(dpa, &pt, LW_TRUE); digit = false; q = p+1; diff --git a/postgis/lwgeom_in_kml.c b/postgis/lwgeom_in_kml.c index 3180c2d4d..d2cf12ceb 100644 --- a/postgis/lwgeom_in_kml.c +++ b/postgis/lwgeom_in_kml.c @@ -334,7 +334,7 @@ static POINTARRAY* parse_kml_coordinates(xmlNodePtr xnode, bool *hasz) else if ( seen_kml_dims != kml_dims ) { lwerror("invalid KML representation: mixed coordinates dimension"); } - ptarray_append_point(dpa, &pt, LW_FALSE); + ptarray_append_point(dpa, &pt, LW_TRUE); kml_dims = 0; } p = q-1; /* will be incrementedon next iteration */ -- 2.50.1