[postgis-users] PostGIS Capabilities

Tyler Mitchell TMitchell at lignum.com
Thu Feb 19 14:23:13 PST 2004


Hi Jong,

> Wow... Amazing PostGIS!!

That's the spirit!

> Question:     How to select points on the line?  For example, how to 
> select the bridges on the highway?

Good practical question - I get excited thinking about just how easy this 
is to do (with no licensing fees involved!).

I think it will depend on how you define "on the line".  Do the bridge 
share the same point as a node in your line?  Or (as I assume is the case) 
are your points within a certain distance from a line (i.e. < 10 metres)? 

If the latter, then something like this should do the trick:

SELECT bridges.name
FROM bridges, highways
WHERE DISTANCE(bridges.geometrycolumn, highways.geometrycolumn) < 10;

There are ways to optimize this query, I just gave you the most basic.

Hope that helps you out.

Tyler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040219/47c6504f/attachment.html>


More information about the postgis-users mailing list