Skip to content

Commit

Permalink
[sfcgal][doc]: add sfcgal methods reintroduced
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Feb 19, 2024
1 parent cc03dd5 commit e36ffa9
Show file tree
Hide file tree
Showing 11 changed files with 443 additions and 3 deletions.
11 changes: 11 additions & 0 deletions doc/postgis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@
<!ENTITY list_window_functions SYSTEM "list_window_functions.xsl.xml">
<!ENTITY table_body_function_support_matrix SYSTEM "table_body_function_support_matrix.xsl.xml">

<!-- SFCGAL functions -->
<!ENTITY CG_Intersection SYSTEM "sfcgal/CG_Intersection.xml">
<!ENTITY CG_Intersects SYSTEM "sfcgal/CG_Intersects.xml">
<!ENTITY CG_3DIntersects SYSTEM "sfcgal/CG_3DIntersects.xml">
<!ENTITY CG_Difference SYSTEM "sfcgal/CG_Difference.xml">
<!ENTITY CG_Distance SYSTEM "sfcgal/CG_Distance.xml">
<!ENTITY CG_3DDistance SYSTEM "sfcgal/CG_3DDistance.xml">
<!ENTITY CG_Area SYSTEM "sfcgal/CG_Area.xml">
<!ENTITY CG_Union SYSTEM "sfcgal/CG_Union.xml">
<!ENTITY CG_Triangulate SYSTEM "sfcgal/CG_Triangulate.xml">

]>

<!-- Converted by db4-upgrade version 1.1 -->
Expand Down
15 changes: 12 additions & 3 deletions doc/reference_sfcgal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,16 @@
</section>

<section xml:id="sfcgal_processing">
<title>SFCGAL Processing and Relationship Functions</title>
<title>SFCGAL Processing and Relationship Functions</title>

&CG_Intersection;
&CG_Intersects;
&CG_3DIntersects;
&CG_Difference;
&CG_Distance;
&CG_3DDistance;
&CG_Area;

<refentry xml:id="ST_3DConvexHull">
<refnamediv>
<refname>ST_3DConvexHull</refname>
Expand Down Expand Up @@ -387,7 +396,7 @@
<title>See Also</title>
<para><xref linkend="ST_Letters"/>, <xref linkend="ST_AsX3D"/></para>
</refsection>
</refentry>
</refentry>

<refentry xml:id="ST_3DIntersection">
<refnamediv>
Expand Down Expand Up @@ -1809,4 +1818,4 @@

</refentry>
</section>
</chapter>
</chapter>
46 changes: 46 additions & 0 deletions doc/sfcgal/CG_3DDistance.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<refentry xml:id="CG_3DDistance">
<refnamediv>
<refname>CG_3DDistance</refname>
<refpurpose>Computes the minimum 3D distance between two geometries</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>double precision <function>CG_3DDistance</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geomA</parameter>
</paramdef>
<paramdef>
<type>geometry</type>
<parameter>geomB</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Computes the minimum 3D distance between two geometries.</para>
<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this function returns a double precision value representing the 3D distance.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
<!-- Optionally mention support for Triangles and TINS -->
<para>&T_support;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT CG_3DDistance('LINESTRING(-1.0 0.0 2.0,1.0 0.0 3.0)', 'TRIANGLE((-4.0 0.0 1.0,4.0 0.0 1.0,0.0 4.0 1.0,-4.0 0.0 1.0))');
cg_3ddistance
----------------
1
(1 row)</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="CG_Distance"/>, <xref linkend="ST_3DDistance"/></para>
</refsection>
</refentry>

46 changes: 46 additions & 0 deletions doc/sfcgal/CG_3DIntersects.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<refentry xml:id="CG_3DIntersects">
<refnamediv>
<refname>CG_3DIntersects</refname>
<refpurpose>Tests if two 3D geometries intersect</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>boolean <function>CG_3DIntersects</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geomA</parameter>
</paramdef>
<paramdef>
<type>geometry</type>
<parameter>geomB</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Tests if two 3D geometries intersect. 3D geometries intersect if they have any point in common in the three-dimensional space.</para>
<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this is the "allowable" version that returns a boolean, not an integer.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
<!-- Optionally mention support for Triangles and TINS -->
<para>&T_support;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT CG_3DIntersects('POINT(1.2 0.1 0)','POLYHEDRALSURFACE(((0 0 0,0.5 0.5 0,1 0 0,1 1 0,0 1 0,0 0 0)),((1 0 0,2 0 0,2 1 0,1 1 0,1 0 0),(1.2 0.2 0,1.2 0.8 0,1.8 0.8 0,1.8 0.2 0,1.2 0.2 0)))');
cg_3dintersects
---------------
t
(1 row)
</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="CG_Intersects"/>, <xref linkend="ST_3DIntersects"/>, <xref linkend="ST_Intersects"/>, <xref linkend="ST_Disjoint"/></para>
</refsection>
</refentry>
40 changes: 40 additions & 0 deletions doc/sfcgal/CG_Area.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<refentry xml:id="CG_Area">
<refnamediv>
<refname>CG_Area</refname>
<refpurpose>Calculates the area of a geometry</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>double precision <function>CG_Area</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geom</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Calculates the area of a geometry.</para>
<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this function returns a double precision value representing the area.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT CG_Area('Polygon ((0 0, 0 5, 5 5, 5 0, 0 0), (1 1, 2 1, 2 2, 1 2, 1 1), (3 3, 4 3, 4 4, 3 4, 3 3))');
cg_area
--------
25
(1 row)</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="ST_3DArea"/>, <xref linkend="ST_Area"/></para>
</refsection>
</refentry>

48 changes: 48 additions & 0 deletions doc/sfcgal/CG_Difference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<refentry xml:id="CG_Difference">
<refnamediv>
<refname>CG_Difference</refname>
<refpurpose>Computes the geometric difference between two geometries</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>geometry <function>CG_Difference</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geomA</parameter>
</paramdef>
<paramdef>
<type>geometry</type>
<parameter>geomB</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Computes the geometric difference between two geometries.
The resulting geometry is a set of points that are present in geomA but not in geomB.</para>
<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this function returns a geometry.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
<para>&sqlmm_compliant; SQL-MM 3: 5.1.27</para>
<para>&curve_support;</para>
<!-- Optionally mention support for Triangles and TINS -->
<para>&T_support;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT ST_AsText(CG_Difference('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::geometry, 'LINESTRING(0 0, 2 2)'::geometry));
cg_difference
---------------
POLYGON((0 0,1 0,1 1,0 1,0 0))
(1 row)</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="geometry_intersects"/>, <xref linkend="CG_Intersects"/>, <xref linkend="ST_Intersects"/>, <xref linkend="ST_Difference"/></para>
</refsection>
</refentry>
45 changes: 45 additions & 0 deletions doc/sfcgal/CG_Distance.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<refentry xml:id="CG_Distance">
<refnamediv>
<refname>CG_Distance</refname>
<refpurpose>Computes the minimum distance between two geometries</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>double precision <function>CG_Distance</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geomA</parameter>
</paramdef>
<paramdef>
<type>geometry</type>
<parameter>geomB</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Computes the minimum distance between two geometries.</para>
<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this function returns a double precision value representing the distance.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
<!-- Optionally mention support for Triangles and TINS -->
<para>&T_support;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT CG_Distance('LINESTRING(0.0 0.0,-1.0 -1.0)', 'LINESTRING(3.0 4.0,4.0 5.0)');
cg_distance
-------------
2.0
(1 row)</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="CG_3DDistance"/>, <xref linkend="ST_Distance"/></para>
</refsection>
</refentry>
44 changes: 44 additions & 0 deletions doc/sfcgal/CG_Intersection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<refentry xml:id="CG_Intersection">
<refnamediv>
<refname>CG_Intersection</refname>
<refpurpose>Computes the intersection of two geometries</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>geometry <function>CG_Intersection</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geomA</parameter>
</paramdef>
<paramdef>
<type>geometry</type>
<parameter>geomB</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Computes the intersection of two geometries.</para>
<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this function returns a geometry representing the intersection.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT ST_AsText(CG_Intersection('LINESTRING(0 0, 5 5)', 'LINESTRING(5 0, 0 5)'));
cg_intersection
-----------------
POINT(2.5 2.5)
(1 row)</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="CG_3DIntersection"/>, <xref linkend="ST_Intersection"/></para>
</refsection>
</refentry>

68 changes: 68 additions & 0 deletions doc/sfcgal/CG_Intersects.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<refentry xml:id="CG_Intersects">
<refnamediv>
<refname>CG_Intersects</refname>

<refpurpose>Tests if two geometries intersect (they have at least one point in common)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>boolean <function>CG_Intersects</function></funcdef>
<paramdef>
<type>geometry</type>
<parameter>geomA</parameter>
</paramdef>
<paramdef>
<type>geometry</type>
<parameter>geomB</parameter>
</paramdef>
</funcprototype>
<funcprototype>
<funcdef>boolean <function>CG_Intersects</function></funcdef>
<paramdef>
<type>geography</type>
<parameter>geogA</parameter>
</paramdef>
<paramdef>
<type>geography</type>
<parameter>geogB</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>Returns <varname>true</varname> if two geometries intersect.
Geometries intersect if they have any point in common.
</para>

<para>Performed by the SFCGAL module</para>
<note>
<para>NOTE: this is the "allowable" version that returns a
boolean, not an integer.</para>
</note>
<para role="availability" conformance="3.5.0">Availability: 3.5.0</para>
<para>&sfcgal_required;</para>
<para>&sqlmm_compliant; SQL-MM 3: 5.1.27</para>
<!-- Optionally mention support for Triangles and TINS -->
<para>&T_support;</para>
</refsection>
<refsection>
<title>Geometry Examples</title>
<programlisting>SELECT CG_Intersects('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
cg_intersects
---------------
f
(1 row)
SELECT CG_Intersects('POINT(0 0)'::geometry, 'LINESTRING ( 0 0, 0 2 )'::geometry);
cg_intersects
---------------
t
(1 row)
</programlisting>
</refsection>
<refsection>
<title>See Also</title>
<para><xref linkend="CG_3DIntersects"/>, <xref linkend="ST_3DIntersects"/>, <xref linkend="ST_Intersects"/>, <xref linkend="ST_Disjoint"/></para>
</refsection>
</refentry>
Loading

0 comments on commit e36ffa9

Please sign in to comment.