]> granicus.if.org Git - postgis/commitdiff
updategeometrysrid was describing old behavior. Update to new and provide alternative...
authorRegina Obe <lr@pcorp.us>
Sun, 14 Oct 2012 05:13:50 +0000 (05:13 +0000)
committerRegina Obe <lr@pcorp.us>
Sun, 14 Oct 2012 05:13:50 +0000 (05:13 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10427 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_management.xml

index f95fc6506708afcaf71129555eb5cd06f49ec668..afc2a827f42d684f9a5ea2e96befae77cc1eecbf 100644 (file)
@@ -948,7 +948,8 @@ Check constraints:
                <refname>UpdateGeometrySRID</refname>
 
                <refpurpose>Updates the SRID of all features in a geometry
-               column, geometry_columns metadata and srid table constraint</refpurpose>
+               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.</refpurpose>
          </refnamediv>
 
          <refsynopsisdiv>
@@ -1013,11 +1014,26 @@ Check constraints:
                <para>&Z_support;</para>
                <para>&curve_support;</para>
          </refsection>
-
+         <refsection>
+               <title>Examples</title>
+               <para>This will change the srid of the roads table to 4326 from whatever it was before</para>
+               <programlisting>SELECT UpdateGeometrySRID('roads','geom',4326);</programlisting>
+               
+               <para>The prior example is equivalent to this DDL statement</para>
+               <programlisting>ALTER TABLE roads 
+  ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 4326) 
+    USING ST_SetSRID(geom,4326);</programlisting>
+    
+       <para>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.</para>
+       <programlisting>ALTER TABLE roads 
+ ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 3857) USING ST_Transform(ST_SetSRID(geom,4326),3857) ;</programlisting>
+         </refsection>
          <refsection>
                <title>See Also</title>
-
-               <para><xref linkend="ST_SetSRID"/></para>
+               
+               <para><xref linkend="ST_SetSRID"/> , <xref linkend="ST_Transform"/></para>
          </refsection>
        </refentry>
   </sect1>