[postgis-users] Drawing line between point and nearest neighbour

ahmed at elegantdesigns.ca ahmed at elegantdesigns.ca
Thu Sep 24 06:08:04 PDT 2009


Hello All,

So far in my endeavor to create a line between a point and its projected
location on a line has been long but I'm almost there. As of yesterday, and
before including any nearest neighbor analysis, I got the results shown in
this image: http://imgur.com/iq2Bh.jpg . As you can see, each point in pink
is connecting to all the projected points, whereas, I only want to connect
each pink x to its respective projection.

On IRC, It was recommended that I use BostonGIS's nearest neighbor method
[1]. I inputed the function to PostgreSQL and tried it unsuccessfully as
outlined in Mysource [2]. I am assuming that my error is due the wrong
parameter type. I played around with that, changed some of the columns'
type to varchar, but still I can't get it to work.

Any Ideas on what I'm doing wrong? any suggestions on how to fix it?

thank you,
dassouki


[1] BostonGIS Nearest Neighbor:
http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_nearest_neighbor_generic
[2] MY source Code: http://pastie.org/627865



More information about the postgis-users mailing list