Opened 7 years ago

Closed 7 years ago

#3781 closed defect (fixed)

st_contains cannot handle curvepolygon / compoundcurve consisting of only straight lines

Reported by: rtukker Owned by: pramsey
Priority: low Milestone: PostGIS 2.3.3
Component: postgis Version: 2.3.x
Keywords: Cc:

Description

The following query:

SELECT st_contains(ST_GeomFromText('POLYGON ((0 0,0 10,10 0,0 0))'), ST_GeomFromText('CURVEPOLYGON (COMPOUNDCURVE ((1 1,1 9),(1 9,9 1),(9 1,1 1)))'))

results in:

Unknown geometry type: 10 - CurvePolygon

Compare that with the following two queries that _do_ succeed (the first one by adding a circularstring, the second one by using a polygon instead of a curvepolygon):

SELECT st_contains(ST_GeomFromText('POLYGON ((0 0,0 10,10 0,0 0))'), ST_GeomFromText('CURVEPOLYGON( COMPOUNDCURVE((1 1,1 9), (1 9,9 1), CIRCULARSTRING(9 1,5 2,1 1)))'))
SELECT st_contains(ST_GeomFromText('POLYGON ((0 0,0 10,10 0,0 0))'), ST_GeomFromText('POLYGON ((1 1,1 9,9 1,1 1))'))

I think this is a bug, because afaik there is no obligation to have arcs in a compoundcurve.

PostGIS_full_version() = POSTGIS="2.3.2 r15302" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="0.11.99" RASTER

Change History (2)

comment:1 by pramsey, 7 years ago

In 15814:

st_contains cannot handle curvepolygon / compoundcurve consisting of only straight lines (References #3781)

comment:2 by pramsey, 7 years ago

Resolution: fixed
Status: newclosed

In 15815:

Not-quite curved CurvePolygon rejected by ST_Contains (Closes #3781)

Note: See TracTickets for help on using tickets.