[postgis-users] Need help detecting lassos

pcreso at pcreso.com pcreso at pcreso.com
Sat Feb 18 16:58:17 PST 2012


Hi,

Not having tried this, but perhaps:

Use ST_Polygonize() on the linestrings as in the example here:
http://postgis.org/docs/ST_Polygonize.html

You could use ST_Dump() to return the polygons & wrap it up in count() for the where clause, so only linestrings able to generate one or more polygons are returned.

This should identify the self-crossing linestrings, as only such linestrings can form a closed polygon boundary.

HTH,

  Brent Wood


--- On Sun, 2/19/12, Hilton Long <seldomseen at scinternet.net> wrote:

From: Hilton Long <seldomseen at scinternet.net>
Subject: [postgis-users] Need help detecting lassos
To:
 postgis-users at postgis.refractions.net
Date: Sunday, February 19, 2012, 11:58 AM

I’d like to be able to detect all line loops that are not closed, but where one end of the line loops around and terminates on another line (a lasso).  Querying a table containing several of these returns no ST_IsClosed=true, or ST_IsValid=false, or ST_IsSimple=false.  Ultimately, I’d like to split the original loop into a line segment = two loop halves.  Thanks In Advance.    
-----Inline Attachment Follows-----

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120218/5342dba9/attachment.html>


More information about the postgis-users mailing list