[postgis-users] Is it pipe segment or manhole?

iheanyi Okeh simflex at hotmail.com
Wed Apr 7 06:17:49 PDT 2004


Is there any way to just capture only one manhole id if address is on a 
manhole and 2 manhole ids if the address is on a pipe or line segment 
between 2 manhole ids?

We have a requirement that asks us to do a radius search using our spatial 
database engine.

During this search, an x/y coordinate pair is passed as a where predicate.
It captures an address that either lies on a line segment/pipe segment or it 
lies on a manhole.
If it lies on a manhole, only one manhole ID needs to be captured and 
displayed.
If the address lies on a pipe or line segment, then two manholes, one on 
either side of the address like this example below, need to be captured and 
displayed.

manholeID---------------*-----------------------------------manholeID.

The star (*) represents an address that lie on a line or pipe segment 
between 2 manhole ids.

I used an expand function to write this query.

Problem is it doesn't matter whether the address lies on a line/pipe segment 
or on a manhole, two manhole ids are always returned.
Any help will be greatly appreciated.
here is the current code I am using.

select ident as manhole_ID,
    distance(shape,'POINT(2354123.1234 6533241.231)'::geometry) as dist
    from iLandMan
    where shape && expand('POINT(2354123.1234 6533241.231)'::geometry,150)   
  order by dist limit 2

Thanks for any help

_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar – FREE! 
http://toolbar.msn.com/go/onm00200414ave/direct/01/




More information about the postgis-users mailing list