AW: AW: [postgis-users] Re:PHP access to PostGIS

Martin Høgh mh at svaj.dk
Wed Mar 23 04:14:37 PST 2005


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 <Horst.Duester at bd.so.ch>
Subject: AW: AW: [postgis-users] Re:PHP access to PostGIS
To: 'PostGIS Users Discussion' <postgis-users at postgis.refractions.net>
Message-ID:
	<5B025B1F39D6D4119F5700508BEEEC66F94D7D at srsofaioi4546.ktso.ch>
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

horst.duester at bd.so.ch 
www.sogis.so.ch



-----Ursprüngliche Nachricht-----
Von: "Martin Høgh" [mailto:mh at svaj.dk]
Gesendet am: Montag, 21. März 2005 15:06
An: postgis-users at postgis.refractions.net
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


>> By line snap do you mean snap to an arbitrary point on a
>> line string belonging to a polyline or polygon? 
>  
>

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 
www.sogis.so.ch

-- 
Martin Høgh
Sven Allan Jensen as
Sankelmarksgade 9
9000 Aalborg
Tlf. 98129300
Direkte tlf. 96314082

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050323/f4b68835/attachment.html>


More information about the postgis-users mailing list