[PostGIS] #5738: ST_OffsetCurve returns wrong geometry
PostGIS
trac at osgeo.org
Wed Jun 5 04:01:31 PDT 2024
#5738: ST_OffsetCurve returns wrong geometry
----------------------------+---------------------
Reporter: rkolka | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone:
Component: postgis | Version: 3.4.x
Keywords: st_offsetcurve |
----------------------------+---------------------
ST_OffsetCurve sometimes returns wrong geometry.
Seems to happen when source geometry has 2 vertices very close.
{{{
CREATE TABLE public.offsetcurve_bug
(
id serial primary key,
description text,
geometry geometry(LineString)
)
;
CREATE INDEX offsetcurve_bug_geometry_x ON public.offsetcurve_bug USING
gist (geometry);
INSERT INTO public.offsetcurve_bug(
description, geometry)
VALUES
('original', 'LINESTRING(544237.894288877
6588306.70972559,544226.9710250939 6588308.03375757,544220.8010926669
6588309.418844438)'::geometry(LineString))
,
('original', 'LINESTRING(544172.354706179
6588303.23414166,544174.671762133 6588304.55817364,544178.8093620511
6588306.2132136)'::geometry(LineString))
;
INSERT INTO public.offsetcurve_bug
(description, geometry)
SELECT
'substring' as description,
ST_LineSubstring(geometry, 0.35, 0.65) as geometry
FROM
public.offsetcurve_bug
WHERE
description = 'original'
;
INSERT INTO public.offsetcurve_bug
(description, geometry)
SELECT
'offset 6m' as description,
ST_OffsetCurve(geometry, -6, 'quad_segs=4 join=mitre
mitre_limit=1.1') as geometry
FROM
public.offsetcurve_bug
WHERE
description = 'substring'
;
}}}
POSTGIS=3.4.2
GEOS=3.11.1-CAPI-1.17.1
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5738>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list