]> granicus.if.org Git - postgis/commitdiff
Add GetTopologySRID (#1182)
authorSandro Santilli <strk@keybit.net>
Mon, 5 Mar 2012 12:24:48 +0000 (12:24 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 5 Mar 2012 12:24:48 +0000 (12:24 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9399 b70326c6-7e19-0410-871a-916f4a2858ee

doc/extras_topology.xml
topology/topology.sql.in.c

index 77504c0fff2a4def5a053f3c7502ba0deb01cb97..5476ef4636da9bbeac0fef8dd3e8feef6c560792 100644 (file)
@@ -1819,7 +1819,57 @@ ERROR:  Two or more faces found</programlisting>
                        <!-- Optionally add a "See Also" section -->
                        <refsection>
                                <title>See Also</title>
-                               <para><xref linkend="CreateTopology"/>, <xref linkend="DropTopology"/>, <xref linkend="GetTopologyName"/></para>
+                               <para>
+       <xref linkend="CreateTopology"/>,
+       <xref linkend="DropTopology"/>,
+       <xref linkend="GetTopologyName"/>,
+       <xref linkend="GetTopologySRID"/>
+                               </para>
+                       </refsection>
+               </refentry>
+
+               <refentry id="GetTopologySRID">
+                       <refnamediv>
+                               <refname>GetTopologySRID</refname>
+                       
+                               <refpurpose>Returns the SRID of a topology in the topology.topology table given the name of the topology.</refpurpose>
+                       </refnamediv>
+               
+                       <refsynopsisdiv>
+                               <funcsynopsis>
+                                       <funcprototype>
+                                       <funcdef>integer <function>GetTopologyID</function></funcdef>
+                                       <paramdef><type>varchar</type> <parameter>toponame</parameter></paramdef>
+                                       </funcprototype>
+                               </funcsynopsis>
+                       </refsynopsisdiv>
+               
+                       <refsection>
+                <title>Description</title>
+            
+                <para>Returns the spatial reference id of a topology in the topology.topology table given the name of the topology.</para>
+              <!-- use this format if new function -->
+                <para>Availability: 2.0.0</para>
+                       </refsection>
+               
+               
+                       <refsection>
+                               <title>Examples</title>
+                               <programlisting>SELECT topology.GetTopologySRID('ma_topo') As SRID;
+ SRID
+-------
+  4326</programlisting>
+                       </refsection>
+               
+                       <!-- Optionally add a "See Also" section -->
+                       <refsection>
+                               <title>See Also</title>
+                               <para>
+       <xref linkend="CreateTopology"/>,
+       <xref linkend="DropTopology"/>,
+       <xref linkend="GetTopologyName"/>,
+       <xref linkend="GetTopologyID"/>
+                               </para>
                        </refsection>
                </refentry>
                
@@ -1859,7 +1909,12 @@ ERROR:  Two or more faces found</programlisting>
                        <!-- Optionally add a "See Also" section -->
                        <refsection>
                                <title>See Also</title>
-                               <para><xref linkend="CreateTopology"/>, <xref linkend="DropTopology"/>, <xref linkend="GetTopologyID"/></para>
+                               <para>
+       <xref linkend="CreateTopology"/>,
+       <xref linkend="DropTopology"/>,
+       <xref linkend="GetTopologyID"/>,
+       <xref linkend="GetTopologySRID"/>
+                               </para>
                        </refsection>
                </refentry>
                
index 0e0d5a2d1b482128140b34693084578c320dddb9..4273ece4d6420456cc8d8497a26cca47899f40a8 100644 (file)
@@ -53,6 +53,7 @@
 --    topology.topology table
 --
 -- FUNCTION GetTopologyId(name)
+-- FUNCTION GetTopologySRID(name)
 -- FUNCTION GetTopologyName(id)
 --    Return info about a Topology
 --
@@ -956,6 +957,8 @@ $$ LANGUAGE 'sql' VOLATILE STRICT;
 --{
 -- GetTopologyName(topology_id)
 --
+-- TODO: rewrite in SQL ?
+--
 CREATE OR REPLACE FUNCTION topology.GetTopologyName(topoid integer)
   RETURNS varchar
 AS
@@ -974,6 +977,8 @@ LANGUAGE 'plpgsql' STABLE STRICT;
 --{
 -- GetTopologyId(toponame)
 --
+-- TODO: rewrite in SQL ?
+--
 CREATE OR REPLACE FUNCTION topology.GetTopologyId(toponame varchar)
   RETURNS integer
 AS
@@ -988,6 +993,16 @@ END
 $$
 LANGUAGE 'plpgsql' STABLE STRICT;
 --} GetTopologyId(toponame)
+
+--{
+-- GetTopologySRID(toponame)
+--
+CREATE OR REPLACE FUNCTION topology.GetTopologySRID(toponame varchar)
+  RETURNS integer
+AS $$
+  SELECT SRID FROM topology.topology WHERE name = $1;
+$$ LANGUAGE 'sql' STABLE STRICT;
+--} GetTopologySRID(toponame)