Opened 7 years ago

Closed 7 years ago

#2496 closed defect (fixed)

St_OffsetCurve bug for Geometry with duplicated points

Reported by: francob Owned by: strk
Priority: medium Milestone: PostGIS GEOS
Component: postgis Version: 2.0.x
Keywords: st_offsetcurve offset repeated points Cc:

Description

St_OffsetCurve doesn't work if geometry have:

1)Duplicated Points. To fix this you can use St_OffsetCurve (ST_RemoveRepeatedPoints(geom), 10)

2)Duplicated Points not consequential. I cannot fix this

Geometry example: "0102000020BB0B000013000000F49BB3FCAA3037413033606B9C3253412FD60B7D61303741EDE29F4E9B3253416842DD0745303741DD30E3C89A3253417776B8621830374149B42AE399325341EDC13D130430374122AE490A983253415FAF500FFC2F37410A84A0DD943253415500A09BFE2F3741D62BEB178532534166ECD670FF2F3741F01372E67A3253417713ABF605303741CE2AF9FC77325341BBA13CB0283037415C422E6F713253410B10133F2E303741256D85F770325341A024E9F33330374115D50563713253414B75A9D4363037419868B9B8723253410DFDE549353037415AF87C3177325341CAF46320303037411170B9E88F325341536848BF2F30374135F86EA19532534180088DD2363037417D62C985983253416842DD0745303741DD30E3C89A3253412FD60B7D61303741EDE29F4E9B325341"

Change History (7)

comment:1 Changed 7 years ago by pramsey

Milestone: PostGIS 2.0.5
Owner: changed from pramsey to strk

comment:2 Changed 7 years ago by strk

What I get with the example geometry:

ERROR:  GEOSOffsetCurve: TopologyException: assigned depths do not match at 1519684.2983950516 5032565.1120155975

ST_IsSimple returns false.

Duplicated points don't seem to harm in themselves:

strk=# select st_astext(st_offsetcurve('LINESTRING(0 0, 0 0, 5 0, 5 0, 10 0)'::geometry, 10));
       st_astext        
------------------------
 LINESTRING(0 10,10 10)
(1 row)

These tests have been performed with:

POSTGIS="2.1.1dev r11987" GEOS="3.4.0-CAPI-1.8.0 r3949"

And

POSTGIS="2.1.1dev r11987" GEOS="3.4.3dev-CAPI-1.8.3 r3958"

comment:3 Changed 7 years ago by strk

Also just tried with POSTGIS="2.0.5SVN r11955" GEOS="3.4.3dev-CAPI-1.8.3 r3958", same results (no crash)

comment:4 Changed 7 years ago by francob

select st_astext(st_offsetcurve('LINESTRING(0 0, 0 0, 5 0, 5 0, 10 0)'::geometry,10))

using: "POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5"

crash.

So this bug can be fixed updating the system

comment:5 Changed 7 years ago by strk

Yep, most likely by simply upgrading GEOS. Please confirm.

comment:6 Changed 7 years ago by francob

Hi. I update my system to "POSTGIS="2.1.0 r11822" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.7.1, 23 September 2009"

Now select st_astext(st_offsetcurve('LINESTRING(0 0, 0 0, 5 0, 5 0, 10 0)'::geometry,10)) doesn't crash.

Now st_offsetcurve works with all geometry where st_isisimple='t'

You think that can be considered a bug if st_offsetcurve doesn't work with geometry like this (st_issimple return false)

geom: "0102000020BB0B000010000000FBB019D1AD1537414A733C4E5333534167CE8F06B815374151F4926C4D335341C4899405B61537413DB009254A335341513EE234AD1537413689A27947335341E38CCA31AB1537415D00E28E44335341951F7F0BB315374104E4CA2441335341A581F041BF153741D46F9F8A3F33534100C27968CD153741C6CAAFE83F335341493DB10CDA1537418919897142335341FCA312FCE01537415D1A1F8045335341C62D3822DD153741554B118E483353411B98FE61D1153741FC35CEE14A33534106DCFDA5C5153741573BD3584B33534167CE8F06B815374151F4926C4D335341FBB019D1AD1537414A733C4E533353414AEB33644E153741595A854786335341"

SELECT st_offsetcurve (geom,10) give this error GEOSOffsetCurve: TopologyException?: assigned depths do not match at 1512895.9378084207 5033276.5839699283

comment:7 Changed 7 years ago by strk

Milestone: PostGIS 2.0.5PostGIS GEOS
Resolution: fixed
Status: newclosed

Yes, I think the lattest can be considered a bug, but needs another ticket.

Note: See TracTickets for help on using tickets.