I want this in order to generate house numbers, odd or even depending on wether a feature is on one side of a street line or not . Thanks
In the end i think the most portable way is to use this( BTW line is actually 'linestring' not segment):
ST_LineCrossingDirection( linefromAtoB,streetline) <0 where A is the point , B is ST_ShortestPoint(thepoint,streetline); if <0 then linefromAtoB enters through the left of The streetline; if >0 the it enters from right side of streetline). You have to determine what street line is closest to each point first.
I made a mistake: C is the symmetric of A in relation to B= ST_ShortestPoint(thepoint,streetline). C's coordinates are XC=2*(XB-XA) -XA
and for y YC=2*(YB-YA) -YA
.
ST_LineCrossingDirection( linefromAtoC,streetline) <0 where A is the point , ; if <0 then linefromAtoC enters through the left of The streetline; if >0 the it enters from right side of streetline). You have to determine what street line is closest to each point first.
No comments:
Post a Comment