From: Regina Obe Date: Sun, 14 Oct 2012 05:13:50 +0000 (+0000) Subject: updategeometrysrid was describing old behavior. Update to new and provide alternative... X-Git-Tag: 2.1.0beta2~540 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da2ccce9de9e7dfe34cfbe919bcab8da91ec9805;p=postgis updategeometrysrid was describing old behavior. Update to new and provide alternative syntax git-svn-id: http://svn.osgeo.org/postgis/trunk@10427 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_management.xml b/doc/reference_management.xml index f95fc6506..afc2a827f 100644 --- a/doc/reference_management.xml +++ b/doc/reference_management.xml @@ -948,7 +948,8 @@ Check constraints: UpdateGeometrySRID Updates the SRID of all features in a geometry - column, geometry_columns metadata and srid table constraint + column, geometry_columns metadata and srid. If it was enforced with constraints, the constraints will be updated with new srid constraint. + If the old was enforced by type definition, the type definition will be changed. @@ -1013,11 +1014,26 @@ Check constraints: &Z_support; &curve_support; - + + Examples + This will change the srid of the roads table to 4326 from whatever it was before + SELECT UpdateGeometrySRID('roads','geom',4326); + + The prior example is equivalent to this DDL statement + ALTER TABLE roads + ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 4326) + USING ST_SetSRID(geom,4326); + + If you got the projection wrong (or brought it in as unknown) in load and you wanted to transform to web mercator all in one shot + You can do this with + DDL but there is no equivalent PostGIS management function to do so in one go. + ALTER TABLE roads + ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 3857) USING ST_Transform(ST_SetSRID(geom,4326),3857) ; + See Also - - + + ,