]> granicus.if.org Git - postgis/commitdiff
Move over ST_IsValid and provide example
authorRegina Obe <lr@pcorp.us>
Wed, 10 Sep 2008 11:28:37 +0000 (11:28 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 10 Sep 2008 11:28:37 +0000 (11:28 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2952 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference.xml
doc/reference_new.xml

index 952c121d2469f599e11883ca927940174a3fa979..8bc9cf3e4d727b53b92dd36370e456dd2a291d85 100644 (file)
@@ -1552,14 +1552,6 @@ WHERE n*100.00/length &lt; 1;
           </listitem>
         </varlistentry>
 
-        <varlistentry id="IsValid">
-          <term>ST_isvalid(geometry)</term>
-
-          <listitem>
-            <para>returns true if this geometry is valid.</para>
-          </listitem>
-        </varlistentry>
-
         <varlistentry>
           <term>ST_expand(geometry, float)</term>
 
@@ -1942,23 +1934,6 @@ WHERE n*100.00/length &lt; 1;
         </listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term>ST_IsValid</term>
-
-        <listitem>
-          <para>Test if an ST_Geometry value is well formed.</para>
-
-          <note>
-            <para>SQL-MM defines the result of ST_IsValid(NULL) to be 0, while
-            PostGIS returns NULL.</para>
-          </note>
-
-          <para>SQL-MM defines the result of ST_IsValid(NULL) to be 1</para>
-
-          <para>SQL-MM 3: 5.1.9</para>
-        </listitem>
-      </varlistentry>
-
       <varlistentry>
         <term>ST_LineFromText</term>
 
index 9be6d61a23931df8abce83a803d9acb90ff33a4c..e9672aa7901c4a2bf0f26ffbbf2f2dde63eaf9c7 100644 (file)
@@ -1926,7 +1926,22 @@ postgis=# SELECT ST_EndPoint('POINT(1 1)'::geometry) IS NULL AS is_null;
                        <para><xref linkend="GeometryType" /></para>
                </refsection>
        </refentry>
-       
+       <varlistentry>
+        <term>ST_IsValid</term>
+
+        <listitem>
+          <para>Test if an ST_Geometry value is well formed.</para>
+
+          <note>
+            <para>SQL-MM defines the result of ST_IsValid(NULL) to be 0, while
+            PostGIS returns NULL.</para>
+          </note>
+
+          <para>SQL-MM defines the result of ST_IsValid(NULL) to be 1</para>
+
+          <para>SQL-MM 3: 5.1.9</para>
+        </listitem>
+    </varlistentry>
     <refentry id="ST_IsClosed">
       <refnamediv>
         <refname>ST_IsClosed</refname>
@@ -2014,6 +2029,72 @@ postgis=# SELECT ST_IsClosed('MULTIPOINT((0 0), (1 1))'::geometry);
         <para><xref linkend="ST_IsRing" /></para>
       </refsection>
     </refentry>
+
+    <refentry id="ST_IsValid">
+      <refnamediv>
+        <refname>ST_IsValid</refname>
+    
+        <refpurpose>Returns <varname>true</varname> if the 
+        <varname>ST_Geometry</varname> is well formed.
+        </refpurpose>
+      </refnamediv>
+    
+      <refsynopsisdiv>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>boolean <function>ST_IsValid</function></funcdef>
+    
+            <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
+      </refsynopsisdiv>
+    
+      <refsection>
+        <title>Description</title>
+    
+        <para>Test if an ST_Geometry value is well formed.  For geometries that are invalid,
+                       the PostgreSQL NOTICE will provide details of why it is not valid.</para>
+               <note>
+                       <para>SQL-MM defines the result of ST_IsValid(NULL) to be 0, while
+                       PostGIS returns NULL.</para>
+               </note>
+    
+        <para><inlinemediaobject>
+            <imageobject>
+              <imagedata fileref="images/check.png" />
+            </imageobject>
+          </inlinemediaobject> This method implements the <ulink
+        url="http://www.opengeospatial.org/standards/sfs">OpenGIS Simple Features
+        Implementation Specification for SQL.</ulink></para>
+    
+        <para><inlinemediaobject>
+            <imageobject>
+              <imagedata fileref="images/check.png" />
+            </imageobject>
+          </inlinemediaobject> This method implements the SQL/MM specification:
+        SQL-MM 3: 5.1.9</para>
+
+      </refsection>
+    
+      <refsection>
+        <title>Examples</title>
+    
+        <programlisting>SELECT ST_IsValid(ST_GeomFromText('LINESTRING(0 0, 1 1)')) As good_line,
+       ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) As bad_poly
+--results
+NOTICE:  Self-intersection at or near point 0 0
+ good_line | bad_poly
+-----------+----------
+ t         | f
+</programlisting>
+      </refsection>
+    
+      <refsection>
+        <title>See Also</title>
+    
+        <para><xref linkend="ST_Summary" /></para>
+      </refsection>
+    </refentry>
                
        <refentry id="ST_NDims">
                <refnamediv>