From ae71ac49d496c3e87767330f3ad1d70cd3d8aebc Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Mon, 25 Jul 2011 12:13:12 +0000 Subject: [PATCH] need more pictures :), visual examples for st_offsetcurve git-svn-id: http://svn.osgeo.org/postgis/trunk@7668 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/html/image_src/Makefile.in | 4 ++ doc/html/image_src/st_offsetcurve01.wkt | 2 + doc/html/image_src/st_offsetcurve02.wkt | 2 + doc/html/image_src/st_offsetcurve03.wkt | 2 + doc/html/image_src/st_offsetcurve04.wkt | 2 + doc/reference_processing.xml | 89 ++++++++++++++++++++++++- 6 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 doc/html/image_src/st_offsetcurve01.wkt create mode 100644 doc/html/image_src/st_offsetcurve02.wkt create mode 100644 doc/html/image_src/st_offsetcurve03.wkt create mode 100644 doc/html/image_src/st_offsetcurve04.wkt diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in index 5886bdf97..846c62e33 100644 --- a/doc/html/image_src/Makefile.in +++ b/doc/html/image_src/Makefile.in @@ -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 index 000000000..0fd8237ba --- /dev/null +++ b/doc/html/image_src/st_offsetcurve01.wkt @@ -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 index 000000000..5de6f9ba1 --- /dev/null +++ b/doc/html/image_src/st_offsetcurve02.wkt @@ -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 index 000000000..10ac62a5e --- /dev/null +++ b/doc/html/image_src/st_offsetcurve03.wkt @@ -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 index 000000000..d0276d28b --- /dev/null +++ b/doc/html/image_src/st_offsetcurve04.wkt @@ -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); diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml index b557efd41..1dda97941 100644 --- a/doc/reference_processing.xml +++ b/doc/reference_processing.xml @@ -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 ST_OffsetCurve -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 @@ -359,12 +359,95 @@ This function ignores the third dimension (z) and will always give a Compute an open buffer around roads 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; + + + + + + + + + + 15, 'quad_segs=4 join=round' original line and its offset 15 units to the left. + + + +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) + + + + + + + + + -15, 'quad_segs=4 join=round' original line and its offset 15 units to the right. + + + +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); + + + + + + + + + + 15, 'quad_segs=4 join=bevel' showm with original line + + + +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) + + + + + + + + + 15,-15 collected, join=mitre mitre_limit=2.1 + + + +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)) + + + + + + + -- 2.50.1