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

Düster Horst Horst.Duester at bd.so.ch
Wed Mar 23 01:51:19 PST 2005


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


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: snapping.zip
Type: application/octet-stream
Size: 59976 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050323/8b16b4e7/attachment.obj>


More information about the postgis-users mailing list