From: Regina Obe Date: Fri, 3 Oct 2008 09:22:13 +0000 (+0000) Subject: Add more examples of 3d use and annotate more 3d functions X-Git-Tag: 1.4.0b1~662 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00f971e34bf0b8b2988279f6c5cd1f30d762f98d;p=postgis Add more examples of 3d use and annotate more 3d functions git-svn-id: http://svn.osgeo.org/postgis/trunk@3058 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_new.xml b/doc/reference_new.xml index add8039f2..dd2847867 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -700,8 +700,8 @@ Check constraints: constraints and reference in geometry_columns. Note: uses current_schema() on schema-aware pgsql installations if schema is not provided. - - + + @@ -1830,6 +1830,13 @@ NOTICE: Self-intersection at or near point 0 0 Returns the coordinate dimension of the geometry. PostGIS supports 2 - (x,y) , 3 - (x,y,z) or 2D with measure - x,y,m, and 4 - 3D with measure space x,y,z,m + + + + + + + This function supports 3d and will not drop the z-index. @@ -1869,6 +1876,12 @@ NOTICE: Self-intersection at or near point 0 0 Description Return the number of points in a geometry. Works for all geometries. + + + + + + This function supports 3d and will not drop the z-index. @@ -1877,6 +1890,11 @@ NOTICE: Self-intersection at or near point 0 0 SELECT ST_NPoints(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)')); --result 4 + + --Polygon in 3d space + SELECT ST_NPoints(ST_GeomFromEWKT('LINESTRING(77.29 29.07 1,77.42 29.26 0,77.27 29.31 -1,77.29 29.07 3)')) + --result + 4 @@ -2104,22 +2122,40 @@ FROM (SELECT 'LINESTRING(0 0, 0 1, 1 0, 1 1, 0 0)'::geometry AS the_geom) AS foo This method implements the SQL/MM specification: SQL-MM 3: 7.1.3 + + + + + + + + This function supports 3d and will not drop the z-index. + Examples - postgis=# SELECT ST_AsText(ST_StartPoint('LINESTRING(0 1, 0 2)'::geometry)); + SELECT ST_AsText(ST_StartPoint('LINESTRING(0 1, 0 2)'::geometry)); st_astext ------------ POINT(0 1) (1 row) -postgis=# SELECT ST_StartPoint('POINT(0 1)'::geometry) IS NULL AS is_null; +SELECT ST_StartPoint('POINT(0 1)'::geometry) IS NULL AS is_null; is_null ---------- t -(1 row) +(1 row) + +--3d line +SELECT ST_AsEWKT(ST_StartPoint('LINESTRING(0 1 1, 0 2 2)'::geometry)); + st_asewkt +------------ + POINT(0 1 1) +(1 row) + + @@ -2151,6 +2187,14 @@ postgis=# SELECT ST_StartPoint('POINT(0 1)'::geometry) IS NULL AS is_null; Description Returns a text summary of the contents of the geometry. + + + + + + + This function supports 3d and will not drop the z-index. + @@ -2166,6 +2210,19 @@ postgis=# SELECT ST_StartPoint('POINT(0 1)'::geometry) IS NULL AS is_null; Line[B] with 2 points : Polygon[B] with 1 rings : ring 0 has 5 points : + +--3d polygon +SELECT ST_Summary(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)')) As good_line, + ST_Summary(ST_GeomFromEWKT('POLYGON((0 0 1, 1 1 2, 1 2 3, 1 1 1, 0 0 1))')) As poly + +--results + good_line | poly +----------------------+------------------------- + | +Line[ZB] with 2 points : Polygon[ZB] with 1 rings + : ring 0 has 5 points + : + @@ -2211,6 +2268,14 @@ Line[B] with 2 points : Polygon[B] with 1 rings (0-based index). Third parameter can be omitted or set to -1 for appending. Availability: 1.1.0 + + + + + + + This function supports 3d and will not drop the z-index. + @@ -2223,6 +2288,14 @@ Line[B] with 2 points : Polygon[B] with 1 rings SET the_geom = ST_AddPoint(the_geom, ST_StartPoint(the_geom)) FROM sometable WHERE ST_IsClosed(the_geom) = false; + + --Adding point to a 3-d line + SELECT ST_AsEWKT(ST_AddPoint(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)'), ST_MakePoint(1, 2, 3))); + + --result + st_asewkt + ---------- + LINESTRING(0 0 1,1 1 1,1 2 3)