more examples to demonstrate its not just limited to 1 point snapping

git-svn-id: http://svn.osgeo.org/postgis/trunk@6283 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Regina Obe 2010-12-07 12:02:00 +00:00
parent 623c10a8df
commit 3cdc711a41
4 changed files with 60 additions and 8 deletions

View file

@ -87,6 +87,8 @@ IMAGES= \
../images/st_snap01.png \
../images/st_snap02.png \
../images/st_snap03.png \
../images/st_snap04.png \
../images/st_snap05.png \
../images/st_split01.png \
../images/st_split02.png \
../images/st_split03.png \

View file

@ -0,0 +1,2 @@
Style1;LINESTRING (5 107, 54 84, 101 100)
Style3;MULTIPOLYGON(((5 107,26 200,126 200,126 125,101 100,54 84,5 107),(51 150,101 150,76 175,51 150)),((151 100,151 200,176 175,151 100)))

View file

@ -0,0 +1,2 @@
Style3;LINESTRING(26 125,54 84,101 100)
Style1;MULTIPOLYGON ((( 26 125, 26 200, 126 200, 126 125, 26 125 ),( 51 150, 101 150, 76 175, 51 150 )), (( 151 100, 151 200, 176 175, 151 100 )))

View file

@ -1459,10 +1459,13 @@ SELECT ST_AsEWKT(ST_SnapToGrid(ST_GeomFromEWKT('LINESTRING(-1.1115678 2.123 3 2.
<refsection>
<title>Examples</title>
<informaltable>
<tgroup cols="1">
<tgroup cols="2">
<colspec colname="column1" />
<colspec colname="column2" />
<spanspec namest="column1" nameend="column2" spanname="span-horiz" align="center" />
<tbody>
<row>
<entry><informalfigure>
<entry spanname="span-horiz"><informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="images/st_snap01.png" />
@ -1491,11 +1494,34 @@ FROM (SELECT ST_GeomFromText('MULTIPOLYGON ((( 26 125, 26 200, 126 200, 126 125,
) As foo;
polysnapped
-------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
MULTIPOLYGON(((26 125,26 200,126 200,126 125,101 100,26 125),
(51 150,101 150,76 175,51 150)),((151 100,151 200,176 175,151 100)))
</programlisting>
</para></entry>
</programlisting></para>
</entry>
<entry><para><informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="images/st_snap04.png" />
</imageobject>
<caption><para>A multipolygon snapped to linestring to tolerance: 1.25 of distance.
The new multipolygon is shown with reference linestring</para></caption>
</mediaobject>
</informalfigure>
<programlisting>
SELECT ST_AsText(ST_Snap(poly,line, ST_Distance(poly,line)*1.25)) AS polysnapped
FROM (SELECT ST_GeomFromText('MULTIPOLYGON ((( 26 125, 26 200, 126 200, 126 125, 26 125 ),
( 51 150, 101 150, 76 175, 51 150 )), (( 151 100, 151 200, 176 175, 151 100 )))') As poly,
ST_GeomFromText('LINESTRING (5 107, 54 84, 101 100)') As line
) As foo;
polysnapped
------------------------------------------------------------------------------------------
MULTIPOLYGON(((5 107,26 200,126 200,126 125,101 100,54 84,5 107),
(51 150,101 150,76 175,51 150)),((151 100,151 200,176 175,151 100)))
</programlisting></para>
</entry>
</row>
<row>
<entry><para><informalfigure>
@ -1519,9 +1545,29 @@ FROM (SELECT ST_GeomFromText('MULTIPOLYGON ((( 26 125, 26 200, 126 200, 126 125,
----------------------------------------
LINESTRING(5 107,26 125,54 84,101 100)
</programlisting>
</para></entry>
</row>
</para>
</entry>
<entry><para><informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="images/st_snap05.png" />
</imageobject>
<caption><para>The linestring snapped to the original multipolygon at tolerance 1.25 of distance.
The new linestring is shown with reference multipolygon</para></caption>
</mediaobject>
</informalfigure>
<programlisting>
SELECT ST_AsText(ST_Snap(line, poly, ST_Distance(poly,line)*1.25)) AS linesnapped
FROM (SELECT ST_GeomFromText('MULTIPOLYGON ((( 26 125, 26 200, 126 200, 126 125, 26 125 ),
( 51 150, 101 150, 76 175, 51 150 )), (( 151 100, 151 200, 176 175, 151 100 )))') As poly,
ST_GeomFromText('LINESTRING (5 107, 54 84, 101 100)') As line
) As foo;
linesnapped
---------------------------------------
LINESTRING(26 125,54 84,101 100)
</programlisting></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>