<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre wrap="">Hi,
As it works now the method will not add the "missing" vertices between the two defining the line segment which must be snapped. It is a pure "snap to nearest point on line segment" kind of method.
I'll look into the adding new vertices function.
/martin
Message: 3
Date: Wed, 23 Mar 2005 10:51:19 +0100
From: D?ster Horst <a class="moz-txt-link-rfc2396E"
href="mailto:Horst.Duester@bd.so.ch"><Horst.Duester@bd.so.ch></a>
Subject: AW: AW: [postgis-users] Re:PHP access to PostGIS
To: 'PostGIS Users Discussion' <a class="moz-txt-link-rfc2396E"
href="mailto:postgis-users@postgis.refractions.net"><postgis-users@postgis.refractions.net></a>
Message-ID:
<a class="moz-txt-link-rfc2396E"
href="mailto:5B025B1F39D6D4119F5700508BEEEC66F94D7D@srsofaioi4546.ktso.ch"><5B025B1F39D6D4119F5700508BEEEC66F94D7D@srsofaioi4546.ktso.ch></a>
Content-Type: text/plain; charset="iso-8859-1"
Hi Martin
I made some tests with the new snapShape method and got the attached
results.
case1.jpg: shows the situation at the outset. Polygon B
should snap to polygon A.
case1_result.jpg: shows the situation after snapping with the new
snapShape method.
case1_expected_result.jpg: shows the expected result (created by myself).
You see, that snapping linesegments is required. Perhaps my hints could be
helpful for you.
With best regards
Horst
---------------------------------
Dr. Horst Düster
GIS-Koordinator /Amtschef Stv.
Kanton Solothurn
Amt für Geoinformation
Abteilung SO!GIS Koordination
Werkhofstr. 65
CH-4509 Solothurn
Tel.: ++41 (0)32 627 25 32
Fax: ++41 (0)32 627 22 14
<a class="moz-txt-link-abbreviated" href="mailto:horst.duester@bd.so.ch">horst.duester@bd.so.ch</a>
<a class="moz-txt-link-abbreviated" href="http://www.sogis.so.ch">www.sogis.so.ch</a>
-----Ursprüngliche Nachricht-----
Von: "Martin Høgh" [<a class="moz-txt-link-freetext"
href="mailto:mh@svaj.dk">mailto:mh@svaj.dk</a>]
Gesendet am: Montag, 21. März 2005 15:06
An: <a class="moz-txt-link-abbreviated"
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
Betreff: AW: AW: [postgis-users] Re:PHP access to PostGIS
Hi Horst,
I've written a tentative snap method which can do line snap.
snapShape(shapeId,snapTolerance,pointString,[arrayWithLineSegments])
As you see, where is a new optional arg called 'arrayWithLineSegments'. This
must be an array with point strings representing line segments (that is
linestrings or polygons)
e.g:
Array ( [0] => 1 1,2 2,3 3 [1] => 20 20,30 30,40 40 [2] => 283 167,114 151,3
3,283 167)
if you've a geometry object called $geo you can do
$arrayWithLineSegments=$geo->getShapeArray()
A bug: If a point don't have a perpendicular projection on to a the line
segment it will snap to the imaginary extention of the line segment.
Therefore I have made vertex snap priority one meaning that vertex snap will
occure even if a line segment is closer.
I'll try to figure this out.
You can pass FALSE instead of pointString to the method and it will only do
line snap with the risk of the imaginary extention bug.
I've updates CVS.
You can also try it on my demo web site
http: slashslash 193.88.249.111/kortbrowser/maplink_itasca/wmsclient.phtml
/martin
***
Hi Martin
</pre>
<blockquote type="cite">
<pre wrap=""><span class="moz-txt-citetags">> </span>By line snap do you mean snap to an arbitrary point on a
<span class="moz-txt-citetags">> </span>line string belonging to a polyline or polygon?
</pre>
</blockquote>
<pre wrap=""><!---->
That's what I meant. The point should snap to the closest point on a line
belonging to a polyline or polygon. Take a look at the attached image.
With best regards
Horst
---------------------------------
Dr. Horst Düster
GIS-Koordinator /Amtschef Stv.
Kanton Solothurn
Amt für Geoinformation
Abteilung SO!GIS Koordination
Werkhofstr. 65
CH-4509 Solothurn
Tel.: ++41 (0)32 627 25 32
Fax: ++41 (0)32 627 22 14
horst.duester at bd.so.ch
<a class="moz-txt-link-abbreviated" href="http://www.sogis.so.ch">www.sogis.so.ch</a></pre>
<pre class="moz-signature" cols="72">--
Martin Høgh
Sven Allan Jensen as
Sankelmarksgade 9
9000 Aalborg
Tlf. 98129300
Direkte tlf. 96314082</pre>
</body>
</html>