Opened 12 years ago

Closed 12 years ago

#1953 closed defect (invalid)

ST_MakeValid don't work

Reported by: aperi2007 Owned by: strk
Priority: medium Milestone: PostGIS 2.1.0
Component: postgis Version: master
Keywords: Cc:

Description

Hi I notice the ST_MakeValid don't work on this geometry:

select ST_MakeValid('POLYGON((1.1 1.1, 2.2 1.1, 2.2 2.2, 1.1 2.1))');

it return:

ERROR: geometry contains non-closed rings

Instead I guess this should easily closed between the (1.1 1.1 ) and (1.1 2.1).

Don't ?

Just to know the postigs version I'm run :

select PostGIS_Full_Version();

POSTGIS="2.1.0SVN" GEOS="3.4.0dev-CAPI-1.8.0 r0" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.1, released 2012/05/15" LIBXML="2.7.8" LIBJSON="UNKNOWN" (core procs from "2.1.0SVN" need upgrade) TOPOLOGY (topology procs from "2.1.0SVN" need upgrade) RASTER (raster procs from "2.1.0SVN" need upgrade)

Change History (3)

comment:1 by strk, 12 years ago

Owner: changed from pramsey to strk
Status: newassigned

Sounds like a regression, also ST_IsValid is affected. Should return a boolean and instead throws an exception. I'm so sure it got fixed in the past ?!

comment:2 by strk, 12 years ago

Argh, it's back, the refusal of INPUT for invalid polygons !

SELECT 'POLYGON((1.1 1.1,2.2 1.1,2.2 2.2,1.1 2.1))'::geometry;

Now I'm not sure it's a regression anymore. It could be ok for WKT to behave like this.

comment:3 by strk, 12 years ago

Resolution: invalid
Status: assignedclosed

So I tested and it's the same back to 1.4 too. So this ticket is invalid. If you want an _enhancement_ (if you consider it such) you can file another.

I think we already discussed this with the rest of the crew and people (especially Mark) thought we'd better not easily let invalid geometries in, when the check is easy to perform. The loader would be using WKB, which we let in as invalid.

Indeed most testcases for MakeValid use WKB input. Not very readable, but works as a workaround.

I've to say I'd be in favor of allowing invalid WKT input. But could also become a run time configuration setting (GUC).

Anyway, closing this as invalid.

Note: See TracTickets for help on using tickets.