Skip to content

Commit 1f3068c

Browse files
committed
Merge branch 'STGeometryTypeTweak'
2 parents 807efa4 + acb348f commit 1f3068c

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

docs/functions.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
| [`ST_GeomFromHEXWKB`](#st_geomfromhexwkb) | Creates a GEOMETRY from a HEXWKB string |
4848
| [`ST_GeomFromText`](#st_geomfromtext) | Deserializes a GEOMETRY from a WKT string, optionally ignoring invalid geometries |
4949
| [`ST_GeomFromWKB`](#st_geomfromwkb) | Deserializes a GEOMETRY from a WKB encoded blob |
50-
| [`ST_GeometryType`](#st_geometrytype) | Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type. |
50+
| [`ST_GeometryType`](#st_geometrytype) | Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type. Possible enum return types are: `POINT`, `LINESTRING`, `POLYGON`, `MULTIPOINT`, `MULTILINESTRING`, `MULTIPOLYGON`, and `GEOMETRYCOLLECTION`. |
5151
| [`ST_HasM`](#st_hasm) | Check if the input geometry has M values. |
5252
| [`ST_HasZ`](#st_hasz) | Check if the input geometry has Z values. |
5353
| [`ST_Hilbert`](#st_hilbert) | Encodes the X and Y values as the hilbert curve index for a curve covering the given bounding box. |
@@ -610,14 +610,14 @@ Returns if two geometries are within a target distance of each-other
610610
#### Signature
611611

612612
```sql
613-
DOUBLE ST_DWithin_Spheroid (col0 POINT_2D, col1 POINT_2D, col2 DOUBLE)
613+
BOOLEAN ST_DWithin_Spheroid (col0 POINT_2D, col1 POINT_2D, col2 DOUBLE)
614614
```
615615

616616
#### Description
617617

618618
Returns if two POINT_2D's are within a target distance in meters, using an ellipsoidal model of the earths surface
619619

620-
The input geometry is assumed to be in the [EPSG:4326](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate system (WGS84), with [latitude, longitude] axis order and the distance is returned in meters. This function uses the [GeographicLib](https://geographiclib.sourceforge.io/) library to solve the [inverse geodesic problem](https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid#Solution_of_the_direct_and_inverse_problems), calculating the distance between two points using an ellipsoidal model of the earth. This is a highly accurate method for calculating the distance between two arbitrary points taking the curvature of the earths surface into account, but is also the slowest.
620+
The input geometry is assumed to be in the [EPSG:4326](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate system (WGS84), with [latitude, longitude] axis order and the distance is returned in meters. This function uses the [GeographicLib](https://geographiclib.sourceforge.io/) library to solve the [inverse geodesic problem](https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid#Solution_of_the_direct_and_inverse_problems), calculating the distance between two points using an ellipsoidal model of the earth. This is a highly accurate method for calculating the distance between two arbitrary points taking the curvature of the earths surface into account, but is also the slowest.
621621

622622
----
623623

@@ -1059,7 +1059,15 @@ ANY ST_GeometryType (col0 WKB_BLOB)
10591059

10601060
#### Description
10611061

1062-
Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type.
1062+
Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type. Possible enum return types are: `POINT`, `LINESTRING`, `POLYGON`, `MULTIPOINT`, `MULTILINESTRING`, `MULTIPOLYGON`, and `GEOMETRYCOLLECTION`.
1063+
1064+
#### Example
1065+
1066+
```sql
1067+
SELECT DISTINCT ST_GeometryType(ST_GeomFromText('POINT(1 1)'));
1068+
----
1069+
POINT
1070+
```
10631071

10641072
----
10651073

@@ -2342,7 +2350,7 @@ SELECT * FROM ST_Drivers();
23422350
#### Signature
23432351

23442352
```sql
2345-
ST_Read (col0 VARCHAR, keep_wkb BOOLEAN, max_batch_size INTEGER, sequential_layer_scan BOOLEAN, layer VARCHAR, sibling_files VARCHAR[], spatial_filter WKB_BLOB, spatial_filter_box BOX_2D, allowed_drivers VARCHAR[], open_options VARCHAR[])
2353+
ST_Read (col0 VARCHAR, keep_wkb BOOLEAN, max_batch_size INTEGER, sequential_layer_scan BOOLEAN, layer VARCHAR, spatial_filter WKB_BLOB, spatial_filter_box BOX_2D, sibling_files VARCHAR[], allowed_drivers VARCHAR[], open_options VARCHAR[])
23462354
```
23472355

23482356
#### Description

spatial/src/spatial/core/functions/scalar/st_geometrytype.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,14 @@ static void WKBTypeFunction(DataChunk &args, ExpressionState &state, Vector &res
8484
// Documentation
8585
//------------------------------------------------------------------------------
8686
static constexpr const char *DOC_DESCRIPTION = R"(
87-
Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type.
87+
Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type. Possible enum return types are: `POINT`, `LINESTRING`, `POLYGON`, `MULTIPOINT`, `MULTILINESTRING`, `MULTIPOLYGON`, and `GEOMETRYCOLLECTION`.
8888
)";
8989

90-
static constexpr const char *DOC_EXAMPLE = R"()";
90+
static constexpr const char *DOC_EXAMPLE = R"(
91+
SELECT DISTINCT ST_GeometryType(ST_GeomFromText('POINT(1 1)'));
92+
----
93+
POINT
94+
)";
9195

9296
static constexpr DocTag DOC_TAGS[] = {{"ext", "spatial"}, {"category", "property"}};
9397
//------------------------------------------------------------------------------

0 commit comments

Comments
 (0)