[postgis-users] Help with Query

Martin Davis mtnclimb at telus.net
Fri Jan 11 21:17:07 PST 2013


Be aware that Points have only an interior, not a boundary.  So 
ST_Touches(line, point) is only true if the point coincides with an 
endpoint of the line.

Perhaps ST_Touches(s1.geom, s2.geom)  might produce some results?

On 1/11/2013 4:20 PM, Clifford Snow wrote:
> First off, I'm a new at Postgis so please let me know if the right 
> response to my question is RTFM.
>
> I have the NHD streams for my state that I want to import into 
> OpenStreetMap. When I select just the streams that I'm interested in I 
> find that there are numerous short linestrings (2 nodes) that I'd like 
> to get rid of. These linestrings are only connected at one end.  It 
> seems like ST_Touches() would find them. I did a simple query of
>
> SELECT s1.gid, s2.gid from flowlines s1, flowlines s2 WHERE 
> ST_Touches(s1.geom,ST_PointN(s2.geom,1) and s2.pointcount = 2;
>
> It returns 0 rows. Changing the point on s2.geom to 0 makes no 
> difference.
>
> Anyone have a suggestion of how I find 2 node streams that connect to 
> another stream?
>
> -- 
> Clifford
>
> OpenStreetMap: Maps with a human touch
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2013.0.2805 / Virus Database: 2637/6000 - Release Date: 12/31/12
> Internal Virus Database is out of date.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130111/49da026b/attachment.html>


More information about the postgis-users mailing list