Skip to content

Commit

Permalink
Add changes for 75e8f14
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 15, 2023
1 parent 4985381 commit a7922c0
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 113 deletions.
54 changes: 54 additions & 0 deletions _sources/api/spatial-functions.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,60 @@ st_difference
+-----------------------------------------------------------+


st_dimension
************

.. function:: st_dimension(col)

Compute the dimension of the geometry.

:param col: Geometry
:type col: Column
:rtype: Column: IntegerType

:example:

.. tabs::
.. code-tab:: py

>>> df = spark.createDataFrame([{'wkt': 'POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))'}])
>>> df.select(st_dimension('wkt')).show()
+-----------------+
|st_dimension(wkt)|
+-----------------+
| 2|
+-----------------+

.. code-tab:: scala

>>> val df = List("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))").toDF("wkt")
>>> df.select(st_dimension(col("wkt"))).show()
+-----------------+
|st_dimension(wkt)|
+-----------------+
| 2|
+-----------------+

.. code-tab:: sql

>>> SELECT st_dimension("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))")
+-----------------+
|st_dimension(wkt)|
+-----------------+
| 2|
+-----------------+

.. code-tab:: r R

>>> df <- createDataFrame(data.frame(wkt = "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"))
>>> showDF(select(df, st_dimension(column("wkt"))))
+-----------------+
|st_dimension(wkt)|
+-----------------+
| 2|
+-----------------+


st_distance
***********

Expand Down
1 change: 1 addition & 0 deletions api/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ <h1>API Documentation<a class="headerlink" href="#api-documentation" title="Perm
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-centroid">st_centroid</a></li>
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-convexhull">st_convexhull</a></li>
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-difference">st_difference</a></li>
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-dimension">st_dimension</a></li>
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-distance">st_distance</a></li>
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-dump">st_dump</a></li>
<li class="toctree-l2"><a class="reference internal" href="spatial-functions.html#st-envelope">st_envelope</a></li>
Expand Down
Loading

0 comments on commit a7922c0

Please sign in to comment.