Opened 8 years ago

Closed 8 years ago

#3424 closed enhancement (fixed)

Implement ST_MinimumClearance

Reported by: dbaston Owned by: dbaston
Priority: medium Milestone: PostGIS 2.3.0
Component: postgis Version: master
Keywords: Cc:

Description

It would be helpful to have a PostGIS implementation of the JTS MinimumClearance capability (described at http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/precision/MinimumClearance.html). This would be useful to find geometries that pass ST_IsValid, but only barely.

Change History (9)

comment:1 by dbaston, 8 years ago

I think this capability could be added fairly compactly directly in liblwgeom (and I'd be happy to do so). Alternatively, it could be added to GEOS first as a direct port, though it would require several other classes to come along for the ride.

comment:2 by strk, 8 years ago

It would be nice to get that code in GEOS first. I take it you're NOT happy to do that ? :)

comment:3 by dbaston, 8 years ago

I understand the appeal of getting it into GEOS, it's just a much bigger project. And the last time I wrote anything in C++ was 2002.

comment:4 by robe, 8 years ago

The other reason not to add it into GEOS first is then in order to use this feature, only GEOS 3.6 users could use it, and we've already gone down those battles.

comment:5 by dbaston, 8 years ago

Hmm, looking into it more I realized we'd want the STRtree::nearestNeighbour methods to be implemented first, wherever the minimum clearance logic ends up. (And if we're going to need GEOS 3.6 for nearestNeighbour, the whole MinimumClearance thing may as well be a straight JTS→GEOS port.)

I'm willing to try implementing the nearestNeighbour methods if you're available for support strk.

comment:6 by robe, 8 years ago

Owner: changed from pramsey to dbaston

If you are willing to port anything from JTS to GEOS he will support you whole heartedly. He's been trying to get me to do that for years and you're just offering without much nudging.

comment:7 by dbaston, 8 years ago

OK, I've completed the work to port this from JTS to GEOS: https://trac.osgeo.org/geos/ticket/776

I've also done the work to expose it in PostGIS and will commit that once the GEOS work is merged.

comment:8 by pramsey, 8 years ago

Wow, good work, Dan!

comment:9 by dbaston, 8 years ago

Resolution: fixed
Status: newclosed

Thanks! Committed this to trunk at r14856.

Note: See TracTickets for help on using tickets.