From: Paul Ramsey Date: Wed, 5 Jun 2013 20:38:56 +0000 (+0000) Subject: #2165, ST_NumPoints regression failure with CircularString X-Git-Tag: 2.1.0beta3~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ccaeae61930da98e2f5655fa91f0cb0c8344555;p=postgis #2165, ST_NumPoints regression failure with CircularString git-svn-id: http://svn.osgeo.org/postgis/trunk@11528 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index fb29634a3..491223172 100644 --- a/NEWS +++ b/NEWS @@ -184,6 +184,7 @@ PostGIS 2.1.0 - #2019, ST_FlipCoordinates does not update bbox - #2100, ST_AsRaster may not return raster with specified pixel type - #2126, Better handling of empty rasters from ST_ConvexHull() + - #2165, ST_NumPoints regression failure with CircularString - #2182, Fix issue with outdb rasters with no SRID and ST_Resize - #2188, Fix function parameter value overflow that caused problems when copying data from a GDAL dataset diff --git a/postgis/lwgeom_ogc.c b/postgis/lwgeom_ogc.c index 447e73f57..10dd65747 100644 --- a/postgis/lwgeom_ogc.c +++ b/postgis/lwgeom_ogc.c @@ -204,7 +204,7 @@ Datum LWGEOM_numpoints_linestring(PG_FUNCTION_ARGS) LWGEOM *lwgeom = lwgeom_from_gserialized(geom); int count = -1; - if ( lwgeom->type == LINETYPE ) + if ( lwgeom->type == LINETYPE || lwgeom->type == CIRCSTRINGTYPE ) count = lwgeom_count_vertices(lwgeom); lwgeom_free(lwgeom); diff --git a/regress/sql-mm-circularstring.sql b/regress/sql-mm-circularstring.sql index f97a168e8..28fcd6eea 100644 --- a/regress/sql-mm-circularstring.sql +++ b/regress/sql-mm-circularstring.sql @@ -278,4 +278,4 @@ SELECT DropGeometryColumn('public', 'circularstring', 'the_geom_3dm'); SELECT DropGeometryColumn('public', 'circularstring', 'the_geom_2d'); DROP TABLE public.circularstring; SELECT ST_AsText(st_snaptogrid(box2d('CIRCULARSTRING(220268.439465645 150415.359530563,220227.333322076 150505.561285879,220227.353105332 150406.434743975)'::geometry),0.0001)); -SELECT 'npoints_is_null',ST_NumPoints(ST_GeomFromEWKT('CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3)')); +SELECT 'npoints_is_five',ST_NumPoints(ST_GeomFromEWKT('CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3)')); diff --git a/regress/sql-mm-circularstring_expected b/regress/sql-mm-circularstring_expected index 8ce1708b1..66b3c8156 100644 --- a/regress/sql-mm-circularstring_expected +++ b/regress/sql-mm-circularstring_expected @@ -105,4 +105,4 @@ public.circularstring.the_geom_3dz effectively removed. public.circularstring.the_geom_3dm effectively removed. public.circularstring.the_geom_2d effectively removed. POLYGON((220187.3821 150406.4347,220187.3821 150506.7171,220288.8159 150506.7171,220288.8159 150406.4347,220187.3821 150406.4347)) -npoints_is_null| +npoints_is_five|5