More on this topic. In my comment
SELECT ST_Intersection(A, ST_Buffer(B, ST_Distance(A,B))) I forgot to add that generally you need to add a bit of a tolerance. SELECT ST_Intersection(A, ST_Buffer(B, ST_Distance(A,B)) + 0.001) As has been mentioned before because of the floating point issues and so forth the above without tolerance often returns nothing. Note to Martin, Is this JTS code you added in GEOS already? Doing a quick glance at the GEOS operation.distance.DistanceOp class, I noticed some functions that look like they may return minimum distance points - DistanceOp::closestPoints(Geometry *g0,Geometry *g1) So does that just need to be exposed via CAPI? Thanks, Regina -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Martin Davis Sent: Thursday, February 12, 2009 11:51 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] points from st_distance > > On the topic itself, this is doable, but note that distance does not > calculate the shortest distance points (sometimes they are between > vertices, note) it just calculates the segmentA/segmentB distances and > finds the minimum. > This is how the JTS algorithm works as well. It is possible to identify the points which determine the shortest distance, and it's not too hard to do. I added this to JTS once I realized that this is quite useful for visualizing the distance. > -- Martin Davis Senior Technical Architect Refractions Research, Inc. (250) 383-3022 _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
