]> granicus.if.org Git - postgis/commitdiff
#2145, ST_Segmentize(geography, dist) fails with redundant coordinates
authorPaul Ramsey <pramsey@cleverelephant.ca>
Sun, 9 Dec 2012 19:59:42 +0000 (19:59 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Sun, 9 Dec 2012 19:59:42 +0000 (19:59 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10820 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeodetic.c
regress/tickets.sql
regress/tickets_expected

index fc55a66e23720e83a1ae23d172c53a8335822051..c92d8ecc39b54bbb9f3827783ff73b82eb82510b 100644 (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);
index 8adfd72d97f839983b6469e6db46aa7a101b1f2d..6afba5fb9b0d58ee419635a42b31f3236ebd53a5 100644 (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;
index 5c19052cbd9316fffe3315d8f54af19d82ea5037..670ed1fe2bd672078882c53dd2020e8bd70bbd85 100644 (file)
@@ -236,3 +236,4 @@ ERROR:  invalid GML representation
 #2108|SRID=3395;POINTM EMPTY
 #2117|SRID=3395;POINTM EMPTY
 #2130|8
+#2145|6792004