#2145, ST_Segmentize(geography, dist) fails with redundant coordinates

git-svn-id: http://svn.osgeo.org/postgis/trunk@10820 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Paul Ramsey 2012-12-09 19:59:42 +00:00
parent b6117968e6
commit 4fee20abd3
3 changed files with 11 additions and 0 deletions

View file

@ -1540,7 +1540,13 @@ ptarray_segmentize_sphere(const POINTARRAY *pa_in, double max_seg_length)
/* Skip duplicate points (except in case of 2-point lines!) */
if ( (pa_in->npoints > 2) && p4d_same(&p1, &p2) )
{
/* Move one offset forward */
p1 = p2;
g1 = g2;
pa_in_offset++;
continue;
}
/* How long is this edge? */
d = sphere_distance(&g1, &g2);

View file

@ -804,5 +804,9 @@ SELECT '#2117', ST_AsEWKT(ST_PointOnSurface('SRID=3395;MULTIPOLYGON M EMPTY'::ge
SELECT '#2130', ST_NPoints(ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,32],[-117,32],[-117,32],[-117,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-117,32],[-117,32],[-117,32],[-117,32]],[[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,32],[-117,33]]]]}'));
SELECT '#2145',
round(ST_Length(St_Segmentize(ST_GeographyFromText('LINESTRING(-89.3000030518 28.2000007629,-89.1999969482 89.1999969482,-89.1999969482 89.1999969482)'), 10000))::numeric,0);
-- Clean up
DELETE FROM spatial_ref_sys;

View file

@ -236,3 +236,4 @@ ERROR: invalid GML representation
#2108|SRID=3395;POINTM EMPTY
#2117|SRID=3395;POINTM EMPTY
#2130|8
#2145|6792004