<html>
<head>
<title></title>
<meta content="MSHTML 6.00.2900.5726" name="GENERATOR"></meta>
</head>
<body>
<div>I dived into the source code. It was surprisingly readable even if I have never studied c-code before. </div>
<div>My problem is that I don't know anything about compiling and things like that so I can't test what I want to do, and I haven't found any easy "howto"-compile postgis on the net. </div>
<div> </div>
<div>I have put my conclusions in a html-file here:</div>
<div><a href="http://jordogskog.no/distance.html">http://jordogskog.no/distance.html</a></div>
<div> </div>
<div>As I understand it shouldn't be a very big thing to implement this and I even think the handling would be more</div>
<div id="result_box" dir="ltr" style="TEXT-ALIGN: left">consistently with my suggestion of changing in function
<span style="FONT-SIZE: 12pt">distance2d_pt_seg.</span></div>
<div dir="ltr" style="TEXT-ALIGN: left">
<span style="FONT-SIZE: 12pt"> </span></div>
<div dir="ltr" style="TEXT-ALIGN: left">
<span style="FONT-SIZE: 12pt">But as I have said, I'm just an amateur but I was so glad I understod some of the source-code so I have to try :-)</span></div>
<div dir="ltr" style="TEXT-ALIGN: left">
<span style="FONT-SIZE: 12pt"> </span></div>
<div dir="ltr" style="TEXT-ALIGN: left">
<span style="FONT-SIZE: 12pt">If someone have an easy how-to compile postgis for windows it would be great.</span></div>
<div dir="ltr" style="TEXT-ALIGN: left">
<span style="FONT-SIZE: 12pt"> </span></div>
<div dir="ltr" style="TEXT-ALIGN: left">
<span style="FONT-SIZE: 12pt">/Nicklas</span></div>
<div> </div>
<div><br />
2009-02-13 Paragon Corporation wrote:<br />
<br />
Typo. Of course I meant<br />
><br />
>SELECT ST_Intersection(A, ST_Buffer(B, ST_Distance(A,B) + 0.001) )<br />
><br />
>Then if you really wanted the points -- you would use the imaginary not yet<br />
>invented ST_DumpPoints should the result not be point or be a geometry<br />
>collection of some sort.<br />
><br />
><br />
><br />
>-----Original Message-----<br />
>From: Paragon Corporation [mailto:lr@pcorp.us] <br />
>Sent: Thursday, February 12, 2009 10:49 PM<br />
>To: 'PostGIS Users Discussion'<br />
>Subject: RE: [postgis-users] points from st_distance<br />
><br />
>More on this topic.<br />
><br />
>In my comment<br />
><br />
>SELECT ST_Intersection(A, ST_Buffer(B, ST_Distance(A,B))) <br />
><br />
>I forgot to add that generally you need to add a bit of a tolerance. <br />
><br />
>SELECT ST_Intersection(A, ST_Buffer(B, ST_Distance(A,B)) + 0.001) <br />
><br />
>As has been mentioned before because of the floating point issues and so<br />
>forth the above without tolerance often returns nothing.<br />
><br />
>Note to Martin,<br />
><br />
>Is this JTS code you added in GEOS already? Doing a quick glance at the GEOS<br />
>operation.distance.DistanceOp class, I noticed some functions that look like<br />
>they may return minimum distance points - DistanceOp::closestPoints(Geometry<br />
>*g0,Geometry *g1)<br />
><br />
>So does that just need to be exposed via CAPI?<br />
><br />
>Thanks,<br />
>Regina<br />
><br />
><br />
><br />
> <br />
><br />
>-----Original Message-----<br />
>From: postgis-users-bounces@postgis.refractions.net<br />
>[mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of Martin<br />
>Davis<br />
>Sent: Thursday, February 12, 2009 11:51 AM<br />
>To: PostGIS Users Discussion<br />
>Subject: Re: [postgis-users] points from st_distance<br />
><br />
><br />
>><br />
>> On the topic itself, this is doable, but note that distance does not <br />
>> calculate the shortest distance points (sometimes they are between <br />
>> vertices, note) it just calculates the segmentA/segmentB distances and <br />
>> finds the minimum.<br />
>> <br />
>This is how the JTS algorithm works as well. It is possible to identify the<br />
>points which determine the shortest distance, and it's not too hard to do.<br />
>I added this to JTS once I realized that this is quite useful for<br />
>visualizing the distance.<br />
>> <br />
><br />
>--<br />
>Martin Davis<br />
>Senior Technical Architect<br />
>Refractions Research, Inc.<br />
>(250) 383-3022<br />
><br />
>_______________________________________________<br />
>postgis-users mailing list<br />
>postgis-users@postgis.refractions.net<br />
>http://postgis.refractions.net/mailman/listinfo/postgis-users<br />
><br />
><br />
><br />
>_______________________________________________<br />
>postgis-users mailing list<br />
>postgis-users@postgis.refractions.net<br />
>http://postgis.refractions.net/mailman/listinfo/postgis-users<br />
><br />
></div>
</body>
</html>