From: Regina Obe Date: Mon, 16 Oct 2017 06:18:08 +0000 (+0000) Subject: Add Paul Ramsey's example, get rid of more obsolete statements about 4326 is only... X-Git-Tag: 2.5.0alpha~395 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d8235c97e9c646752da648364dcd1442a0d1177;p=postgis Add Paul Ramsey's example, get rid of more obsolete statements about 4326 is only srid supported for geography References #3902 for PostGIS 2.5.0 git-svn-id: http://svn.osgeo.org/postgis/trunk@15988 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/using_postgis_dataman.xml b/doc/using_postgis_dataman.xml index d2048580e..6aec6e67a 100644 --- a/doc/using_postgis_dataman.xml +++ b/doc/using_postgis_dataman.xml @@ -346,8 +346,7 @@ CREATE TABLE lgeognad27(gid serial PRIMARY KEY, geog geography(POLYGON,4267) );< Note that the location column has type GEOGRAPHY and that geography type supports two optional modifier: a type modifier that restricts the kind of shapes and dimensions allowed in the column; an SRID modifier that restricts the coordinate reference identifier to a particular number. Allowable values for the type modifier are: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON. The modifier also supports dimensionality restrictions through suffixes: Z, M and ZM. So, for example a modifier of 'LINESTRINGM' would only allow line strings with three dimensions in, and would treat the third dimension as a measure. Similarly, 'POINTZM' would expect four dimensional data. - The SRID modifier is currently of limited use: only 4326 (WGS84) is allowed as a value. If you do not specify an SRID, the a value 0 (undefined spheroid) will be used, and all calculations will proceed using WGS84 anyways. - In the future, alternate SRIDs will allow calculations on spheroids other than WGS84. + If you do not specify an SRID, the SRID will default to 4326 WGS 84 long/lat will be used, and all calculations will proceed using WGS84. Once you have created your table, you can see it in the GEOGRAPHY_COLUMNS table: -- See the contents of the metadata view @@ -383,6 +382,30 @@ INSERT INTO global_points (name, location) VALUES ('London', ST_GeogFromText('SR SELECT ST_Distance('LINESTRING(-122.33 47.606, 0.0 51.5)'::geometry, 'POINT(-21.96 64.15)':: geometry); +-- Testing different lon/lat projects, requires PostGIS 2.2+. +-- Any long lat spatial reference system in spatial_ref_sys table is allowed. + -- NAD 83 lon/lat +SELECT 'SRID=4269;POINT(-123 34)'::geography; + geography +---------------------------------------------------- + 0101000020AD1000000000000000C05EC00000000000004140 +(1 row) + +-- NAD27 lon/lat +SELECT 'SRID=4267;POINT(-123 34)'::geography; + + geography +---------------------------------------------------- + 0101000020AB1000000000000000C05EC00000000000004140 +(1 row) + +-- NAD83 UTM zone meters, yields error since its a meter based projection +SELECT 'SRID=26910;POINT(-123 34)'::geography; + +ERROR: Only lon/lat coordinate systems are supported in geography. +LINE 1: SELECT 'SRID=26910;POINT(-123 34)'::geography; + + The GEOGRAPHY type calculates the true shortest distance over the sphere between Reykjavik and the great circle flight path between Seattle and London. Great Circle mapper