]> granicus.if.org Git - postgis/commitdiff
need more pictures :), visual examples for st_offsetcurve
authorRegina Obe <lr@pcorp.us>
Mon, 25 Jul 2011 12:13:12 +0000 (12:13 +0000)
committerRegina Obe <lr@pcorp.us>
Mon, 25 Jul 2011 12:13:12 +0000 (12:13 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7668 b70326c6-7e19-0410-871a-916f4a2858ee

doc/html/image_src/Makefile.in
doc/html/image_src/st_offsetcurve01.wkt [new file with mode: 0644]
doc/html/image_src/st_offsetcurve02.wkt [new file with mode: 0644]
doc/html/image_src/st_offsetcurve03.wkt [new file with mode: 0644]
doc/html/image_src/st_offsetcurve04.wkt [new file with mode: 0644]
doc/reference_processing.xml

index 5886bdf97daa2186d700e0d33157168b07e0eba7..846c62e33bad733c0ae227eca22cc23eaa7dfe46 100644 (file)
@@ -83,6 +83,10 @@ IMAGES= \
        ../images/st_longestline01.png \
        ../images/st_longestline02.png \
        ../images/st_longestline03.png \
+       ../images/st_offsetcurve01.png \
+       ../images/st_offsetcurve02.png \
+       ../images/st_offsetcurve03.png \
+       ../images/st_offsetcurve04.png \
        ../images/st_minimumboundingcircle01.png \
        ../images/st_sharedpaths01.png \
        ../images/st_sharedpaths02.png \
diff --git a/doc/html/image_src/st_offsetcurve01.wkt b/doc/html/image_src/st_offsetcurve01.wkt
new file mode 100644 (file)
index 0000000..0fd8237
--- /dev/null
@@ -0,0 +1,2 @@
+Style1-thinline;LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)
+Style2-thinline;LINESTRING(154 -9,8 -9,2.25974851452365 -7.8581929876693,-2.60660171779821 -4.60660171779821,-4.60660171779821 -2.60660171779821,-7.85819298766932 2.2597485145237,-9 8,-9 185)
diff --git a/doc/html/image_src/st_offsetcurve02.wkt b/doc/html/image_src/st_offsetcurve02.wkt
new file mode 100644 (file)
index 0000000..5de6f9b
--- /dev/null
@@ -0,0 +1,2 @@
+Style1-thinline;LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)
+Style2-thinline;LINESTRING(21 185,21 21,154 21);
diff --git a/doc/html/image_src/st_offsetcurve03.wkt b/doc/html/image_src/st_offsetcurve03.wkt
new file mode 100644 (file)
index 0000000..10ac62a
--- /dev/null
@@ -0,0 +1,2 @@
+Style1-thinline;LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)
+Style2-thinline;LINESTRING(154 -9,8 -9,-2.60660171779821 -4.60660171779821,-4.60660171779821 -2.60660171779821,-9 8,-9 185);
diff --git a/doc/html/image_src/st_offsetcurve04.wkt b/doc/html/image_src/st_offsetcurve04.wkt
new file mode 100644 (file)
index 0000000..d0276d2
--- /dev/null
@@ -0,0 +1,2 @@
+Style1-thinline;LINESTRING(154 -9,1.78679656440358 -9,-9 1.78679656440358,-9 185)
+Style1-thinline;LINESTRING(21 185,21 21,154 21);
index b557efd411faffaf17ffb3d678edf57c455a7f22..1dda97941ef6673b2a5fd8ac89a2fd906b2aaeae 100644 (file)
@@ -288,7 +288,7 @@ MULTIPOLYGON(((-1 2,3 4,5 6,-1 2)),((-1 2,2 3,5 6,-1 2))) | POLYGON((-1 2,5 6,3
                                <refname>ST_OffsetCurve</refname>
 
                                <refpurpose>
-Return an offset line at a given distance and side from an input line.
+Return an offset line at a given distance and side from an input line. Useful for computing parallel lines about a center line
                        </refpurpose>
                        </refnamediv>
 
@@ -359,12 +359,95 @@ This function ignores the third dimension (z) and will always give a
 <para>Compute an open buffer around roads</para>
                                <programlisting>
 SELECT ST_Union(
- ST_OffsetCurve(f.the_geom,  f.width/2, "quad_segs=4 join=round"),
- ST_OffsetCurve(f.the_geom, -f.width/2, "quad_segs=4 join=round")
+ ST_OffsetCurve(f.the_geom,  f.width/2, 'quad_segs=4 join=round'),
+ ST_OffsetCurve(f.the_geom, -f.width/2, 'quad_segs=4 join=round')
 ) as track
 FROM someroadstable;
 
                                </programlisting>
+                               <informaltable>
+                                 <tgroup cols="2">
+                                       <tbody>
+                                         <row>
+                                               <entry><para><informalfigure>
+                                                       <mediaobject>
+                                                         <imageobject>
+                                                               <imagedata fileref="images/st_offsetcurve01.png" />
+                                                         </imageobject>
+                                                         <caption><para>15, 'quad_segs=4 join=round' original line and its offset 15 units to the left.</para></caption>
+                                                       </mediaobject>
+                                                 </informalfigure>
+                               <programlisting>
+SELECT ST_AsText(ST_OffsetCurve(ST_GeomFromText(
+'LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 
+8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)'), 15, 'quad_segs=4 join=round'));
+--output --
+LINESTRING(154 -9,8 -9,2.25974851452365 -7.8581929876693,
+-2.60660171779821 -4.60660171779821,-4.60660171779821 -2.60660171779821,
+-7.85819298766932 2.2597485145237,-9 8,-9 185)
+                               </programlisting>
+                                                 </para></entry>
+
+                                               <entry><para><informalfigure>
+                                                       <mediaobject>
+                                                         <imageobject>
+                                                               <imagedata fileref="images/st_offsetcurve02.png" />
+                                                         </imageobject>
+                                                         <caption><para>-15, 'quad_segs=4 join=round' original line and its offset 15 units to the right.</para></caption>
+                                                       </mediaobject>
+                                                 </informalfigure>
+                               <programlisting>
+SELECT ST_AsText(ST_OffsetCurve(ST_GeomFromText(
+'LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 
+8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)'), -15, 'quad_segs=4 join=round'));
+-- output --
+LINESTRING(21 185,21 21,154 21);
+                               </programlisting>
+                                               </para></entry>
+                                         </row>
+                                         <row>
+                                               <entry><para><informalfigure>
+                                                       <mediaobject>
+                                                         <imageobject>
+                                                               <imagedata fileref="images/st_offsetcurve03.png" />
+                                                         </imageobject>
+                                                         <caption><para>15, 'quad_segs=4 join=bevel' showm with original line</para></caption>
+                                                       </mediaobject>
+                                                 </informalfigure>
+                               <programlisting>
+SELECT ST_AsText(ST_OffsetCurve(ST_GeomFromText(
+'LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 
+8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)'), 15, 'quad_segs=4 join=bevel'));
+-- output --
+LINESTRING(154 -9,8 -9,-2.60660171779821 -4.60660171779821,-4.60660171779821 -2.60660171779821,-9 8,-9 185)
+                               </programlisting>
+                                                </para></entry>
+
+                                               <entry><para><informalfigure>
+                                                       <mediaobject>
+                                                         <imageobject>
+                                                               <imagedata fileref="images/st_buffer04.png" />
+                                                         </imageobject>
+                                                         <caption><para>15,-15 collected, join=mitre mitre_limit=2.1</para></caption>
+                                                       </mediaobject>
+                                                 </informalfigure>
+                               <programlisting>
+SELECT ST_AsText(ST_Collect(
+       ST_OffsetCurve(geom, 15, 'quad_segs=4 join=mitre mitre_limit=2.2'),
+       ST_OffsetCurve(geom, -15, 'quad_segs=4 join=mitre mitre_limit=2.2')
+       ) )
+       FROM ST_GeomFromText(
+'LINESTRING (154 6, 134 6, 114 6, 94 6, 74 6, 54 6, 34 6, 14 6, 10 6, 
+8 6, 7 7, 6 8, 6 10, 6 30, 6 50, 6 70, 6 90, 6 110, 6 130, 6 150, 6 170, 6 185)') As geom;
+-- output --
+MULTILINESTRING((154 -9,1.78679656440358 -9,-9 1.78679656440358,-9 185),(21 185,21 21,154 21))
+                               </programlisting>
+                                                 </para></entry>
+                                         </row>
+                                       </tbody>
+                                 </tgroup>
+                       </informaltable>
+
                        </refsection>
 
                          <refsection>