Package 'sedonafns'

Title: Apache SedonaDB Function Definitions and Documentation
Description: Provides function definitions and documentation for use in 'SedonaDB'.
Authors: Dewey Dunnington [aut, cre]
Maintainer: Dewey Dunnington <[email protected]>
License: Apache License (>= 2)
Version: 0.3.0.9000
Built: 2026-06-04 03:01:34 UTC
Source: https://github.com/apache/sedona-db

Help Index


Returns the nodata value of the specified band as a double. Returns null if the band has no nodata value defined.

Description

Returns the nodata value of the specified band as a double. Returns null if the band has no nodata value defined.

Usage

rs_bandnodatavalue(rast = sd_missing_arg(), band = sd_missing_arg())

Arguments

rast

(raster): Input raster

band

(int): Band index (1-based). Defaults to 1 if not specified.

Value

(float64)

See Also

SedonaDB SQL documentation for RS_BANDNODATAVALUE


Retrieves the file path of an out-of-database (out-db) raster band, returning the external raster file location referenced by the raster.

Description

Primarily used with out-db rasters, where only raster path and geo-referencing metadata are stored in the database.

Usage

rs_bandpath(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(utf8)

See Also

SedonaDB SQL documentation for RS_BANDPATH


Returns the pixel data type of the specified band as a string.

Description

Returns the pixel data type of the specified band as a string.

Usage

rs_bandpixeltype(rast = sd_missing_arg(), band = sd_missing_arg())

Arguments

rast

(raster): Input raster

band

(int): Band index (1-based). Defaults to 1 if not specified.

Value

(utf8)

See Also

SedonaDB SQL documentation for RS_BANDPIXELTYPE


Returns true if the first argument's extent contains the second.

Description

Returns true if the convex hull of the first argument completely contains the second argument. Both rasters and geometries are accepted in either argument position. When two rasters are provided, their convex hulls are compared. If the arguments have different CRSes, the geometry is transformed into the raster's CRS before evaluating the predicate. For two rasters, the second raster's extent is transformed into the first raster's CRS. If the preferred transformation fails, the extent of both sides are transformed to WGS 84 as a fallback. If either argument has no CRS set, the comparison is performed directly without CRS transformation.

Usage

rs_contains(...)

Arguments

...

Supported combinations:

  • rast (raster), geom (geometry)

  • geom (geometry), rast (raster)

  • rast_a (raster), rast_b (raster)

Value

(boolean)

See Also

SedonaDB SQL documentation for RS_CONTAINS


Returns the convex hull geometry of a raster.

Description

Returns the convex hull geometry of a raster.

Usage

rs_convexhull(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_CONVEXHULL


Returns the CRS string for a raster.

Description

Returns the CRS string for a raster.

Usage

rs_crs(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(string)

See Also

SedonaDB SQL documentation for RS_CRS


Returns the envelope (bounding box) of a raster as a geometry.

Description

Returns the envelope (bounding box) of a raster as a geometry.

Usage

rs_envelope(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_ENVELOPE


Creates a simple example raster for testing and demos.

Description

Creates a simple example raster for testing and demos.

Usage

rs_example()

Value

(raster)

See Also

SedonaDB SQL documentation for RS_EXAMPLE


Creates an out-of-database raster from a raster file path.

Description

Loads raster metadata from the file at path and returns a raster whose bands reference the source file as out-db bands. This is useful when you want to work with rasters stored on disk without copying their pixel data into the raster value itself.

Usage

rs_frompath(path = sd_missing_arg())

Arguments

path

(string): Input string

Value

(raster)

See Also

SedonaDB SQL documentation for RS_FROMPATH


Returns the georeference metadata of raster as a string in GDAL or ESRI format as commonly seen in a world file. Default is GDAL if not specified. Both formats output six lines: scalex, skewy, skewx, scaley, upperleftx, upperlefty. In GDAL format the upper-left coordinates refer to the corner of the upper-left pixel, while in ESRI format they are shifted to the center of the upper-left pixel.

Description

Returns the georeference metadata of raster as a string in GDAL or ESRI format as commonly seen in a world file. Default is GDAL if not specified. Both formats output six lines: scalex, skewy, skewx, scaley, upperleftx, upperlefty. In GDAL format the upper-left coordinates refer to the corner of the upper-left pixel, while in ESRI format they are shifted to the center of the upper-left pixel.

Usage

rs_georeference(rast = sd_missing_arg(), format = sd_missing_arg())

Arguments

rast

(raster): Input raster

format

(utf8): Output format, either 'GDAL' (default) or 'ESRI'. GDAL reports the upper-left corner of the upper-left pixel; ESRI shifts the coordinates to the center of the upper-left pixel.

Value

(utf8)

See Also

SedonaDB SQL documentation for RS_GEOREFERENCE


Returns the height of a raster in pixels.

Description

Returns the height of a raster in pixels.

Usage

rs_height(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(bigint)

See Also

SedonaDB SQL documentation for RS_HEIGHT


Returns true if the extents of the two arguments intersect.

Description

Returns true if the convex hull of the first argument intersects the second argument. Both rasters and geometries are accepted in either argument position. When two rasters are provided, their convex hulls are compared. If the arguments have different CRSes, the geometry is transformed into the raster's CRS before evaluating the predicate. For two rasters, the second raster's extent is transformed into the first raster's CRS. If the preferred transformation fails, the extent of both sides are transformed to WGS 84 as a fallback. If either argument has no CRS set, the comparison is performed directly without CRS transformation.

Usage

rs_intersects(...)

Arguments

...

Supported combinations:

  • rast (raster), geom (geometry)

  • geom (geometry), rast (raster)

  • rast_a (raster), rast_b (raster)

Value

(boolean)

See Also

SedonaDB SQL documentation for RS_INTERSECTS


Returns the number of bands in the raster.

Description

Returns the number of bands in the raster.

Usage

rs_numbands(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(uint32)

See Also

SedonaDB SQL documentation for RS_NUMBANDS


Returns the centroid of the specified pixel as a Point geometry.

Description

Returns the centroid of the specified pixel as a Point geometry.

Usage

rs_pixelascentroid(
  rast = sd_missing_arg(),
  colX = sd_missing_arg(),
  rowY = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

colX

(integer): Input integer

rowY

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_PIXELASCENTROID


Returns the upper-left corner of the specified pixel as a Point geometry.

Description

Returns the upper-left corner of the specified pixel as a Point geometry.

Usage

rs_pixelaspoint(
  rast = sd_missing_arg(),
  colX = sd_missing_arg(),
  rowY = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

colX

(integer): Input integer

rowY

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_PIXELASPOINT


Returns the bounding polygon of the specified pixel.

Description

Returns the bounding polygon of the specified pixel.

Usage

rs_pixelaspolygon(
  rast = sd_missing_arg(),
  colX = sd_missing_arg(),
  rowY = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

colX

(integer): Input integer

rowY

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_PIXELASPOLYGON


Converts raster pixel coordinates to world coordinates as a point.

Description

Converts raster pixel coordinates to world coordinates as a point.

Usage

rs_rastertoworldcoord(
  rast = sd_missing_arg(),
  x = sd_missing_arg(),
  y = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

x

(integer): Input integer

y

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_RASTERTOWORLDCOORD


Converts raster pixel coordinates to world X coordinate.

Description

Converts raster pixel coordinates to world X coordinate.

Usage

rs_rastertoworldcoordx(
  rast = sd_missing_arg(),
  x = sd_missing_arg(),
  y = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

x

(integer): Input integer

y

(integer): Input integer

Value

(double)

See Also

SedonaDB SQL documentation for RS_RASTERTOWORLDCOORDX


Converts raster pixel coordinates to world Y coordinate.

Description

Converts raster pixel coordinates to world Y coordinate.

Usage

rs_rastertoworldcoordy(
  rast = sd_missing_arg(),
  x = sd_missing_arg(),
  y = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

x

(integer): Input integer

y

(integer): Input integer

Value

(double)

See Also

SedonaDB SQL documentation for RS_RASTERTOWORLDCOORDY


Returns the raster rotation in radians based on skew parameters.

Description

Returns the raster rotation in radians based on skew parameters.

Usage

rs_rotation(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_ROTATION


Returns the pixel width (scale X) of a raster.

Description

Returns the pixel width (scale X) of a raster.

Usage

rs_scalex(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_SCALEX


Returns the pixel height (scale Y) of a raster.

Description

Returns the pixel height (scale Y) of a raster.

Usage

rs_scaley(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_SCALEY


Sets the Coordinate Reference System (CRS) for a raster.

Description

Sets a CRS on a raster. This is metadata-only: raster cell values and geotransform are not transformed.

Usage

rs_setcrs(rast = sd_missing_arg(), target_crs = sd_missing_arg())

Arguments

rast

(raster): Input raster

target_crs

(string): Input string

Value

(raster)

See Also

SedonaDB SQL documentation for RS_SETCRS


Sets the SRID (spatial reference identifier) for a raster.

Description

Sets the SRID of a raster. This is metadata-only: raster cell values and geotransform are not transformed.

Usage

rs_setsrid(rast = sd_missing_arg(), srid = sd_missing_arg())

Arguments

rast

(raster): Input raster

srid

(integer): Input integer

Value

(raster)

See Also

SedonaDB SQL documentation for RS_SETSRID


Returns the X skew (rotation) parameter of a raster.

Description

Returns the X skew (rotation) parameter of a raster.

Usage

rs_skewx(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_SKEWX


Returns the Y skew (rotation) parameter of a raster.

Description

Returns the Y skew (rotation) parameter of a raster.

Usage

rs_skewy(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_SKEWY


Returns the SRID of a raster.

Description

Returns the SRID of a raster.

Usage

rs_srid(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(integer)

See Also

SedonaDB SQL documentation for RS_SRID


Returns the upper-left X coordinate of a raster.

Description

Returns the upper-left X coordinate of a raster.

Usage

rs_upperleftx(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_UPPERLEFTX


Returns the upper-left Y coordinate of a raster.

Description

Returns the upper-left Y coordinate of a raster.

Usage

rs_upperlefty(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(double)

See Also

SedonaDB SQL documentation for RS_UPPERLEFTY


Returns the width of a raster in pixels.

Description

Returns the width of a raster in pixels.

Usage

rs_width(rast = sd_missing_arg())

Arguments

rast

(raster): Input raster

Value

(bigint)

See Also

SedonaDB SQL documentation for RS_WIDTH


Returns true if the first argument's extent is within the second.

Description

Returns true if the convex hull of the first argument is completely within the second argument. This is the inverse of RS_Contains: RS_Within(A, B) is equivalent to RS_Contains(B, A). Both rasters and geometries are accepted in either argument position. When two rasters are provided, their convex hulls are compared. If the arguments have different CRSes, the geometry is transformed into the raster's CRS before evaluating the predicate. For two rasters, the second raster's extent is transformed into the first raster's CRS. If the preferred transformation fails, the extent of both sides are transformed to WGS 84 as a fallback. If either argument has no CRS set, the comparison is performed directly without CRS transformation.

Usage

rs_within(...)

Arguments

...

Supported combinations:

  • rast (raster), geom (geometry)

  • geom (geometry), rast (raster)

  • rast_a (raster), rast_b (raster)

Value

(boolean)

See Also

SedonaDB SQL documentation for RS_WITHIN


Converts world coordinates to raster coordinates as a point.

Description

Converts world coordinates to raster coordinates as a point.

Usage

rs_worldtorastercoord(
  rast = sd_missing_arg(),
  x = sd_missing_arg(),
  y = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

x

(double): Input double

y

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for RS_WORLDTORASTERCOORD


Converts world coordinates to raster X coordinate.

Description

Converts world coordinates to raster X coordinate.

Usage

rs_worldtorastercoordx(
  rast = sd_missing_arg(),
  x = sd_missing_arg(),
  y = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

x

(double): Input double

y

(double): Input double

Value

(integer)

See Also

SedonaDB SQL documentation for RS_WORLDTORASTERCOORDX


Converts world coordinates to raster Y coordinate.

Description

Converts world coordinates to raster Y coordinate.

Usage

rs_worldtorastercoordy(
  rast = sd_missing_arg(),
  x = sd_missing_arg(),
  y = sd_missing_arg()
)

Arguments

rast

(raster): Input raster

x

(double): Input double

y

(double): Input double

Value

(integer)

See Also

SedonaDB SQL documentation for RS_WORLDTORASTERCOORDY


Applies an affine transformation to a geometry.

Description

Applies an affine transformation to a geometry.

Usage

sd_affine(...)

Arguments

...

Supported combinations:

  • geom (geometry), a (double), b (double), d (double), e (double), xOff (double), yOff (double)

  • geom (geometry), a (double), b (double), c (double), d (double), e (double), f (double), g (double), h (double), i (double), xOff (double), yOff (double), zOff (double)

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_AFFINE


Computes the statistics of geometries for the input geometry or geography.

Description

ST_Analyze_Agg() provides a high-level summary of its input geometries. The fields of its struct return type are: - count: Number of input geometries - minx, miny, maxx, maxy: Minimum bounding rectangle (envelope). For geography, this represents geographical bounds such that minx may be greater than maxx where this represents more compact bounds (e.g., a small feature crossing the antimeridian). - mean_size_in_bytes - mean_points_per_geometry - puntal_count: Number of point or multipoint geometries - lineal_count: Number of line or multilinestring geometries - polygonal_count: Number of polygon or multipolygon geometries - geometrycollection_count: Number of geometrycollection geometries - mean_envelope_width - mean_envelope_height - mean_envelope_area

Usage

sd_analyze_agg(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(struct)

See Also

SedonaDB SQL documentation for ST_ANALYZE_AGG


Returns the area of a geometry or geography.

Description

ST_Area() Returns the area of a polygon or multi-polygon. For geometry, returns the area in the units of the coordinate reference system (squared); for geography, returns the area in square meters, calculated on a spherical Earth model.

Usage

sd_area(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_AREA


Converts a geometry or geography to Well-Known Binary (WKB) format.

Description

ST_AsBinary() Returns the Well-Known Binary representation of a geometry or geography. This function also has the alias ST_AsWKB. ST_AsBinary() may preserve the underlying Arrow storage type of the input geometry. For example, when the input geometry is backed by Arrow BinaryView storage, the WKB output may also use BinaryView storage. If a downstream consumer requires simpler Arrow storage such as Binary, wrap the result with sd_simplifystorage().

Usage

sd_asbinary(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(binary)

See Also

SedonaDB SQL documentation for ST_ASBINARY


Returns the EWKB representation of a geometry or geography.

Description

EWKB extends WKB to include SRID information in the binary header and is useful for PostGIS compatibility. This function preserves item-level CRSes or will repeat a type-level CRS for all elements if present.

Usage

sd_asewkb(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(binary)

See Also

SedonaDB SQL documentation for ST_ASEWKB


Returns the GeoJSON representation of a geometry.

Description

Returns the GeoJSON representation of a geometry.

Usage

sd_asgeojson(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(string)

See Also

SedonaDB SQL documentation for ST_ASGEOJSON


Returns the Well-Known Text string representation of a geometry or geography.

Description

Alias: ST_AsWKT.

Usage

sd_astext(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(string)

See Also

SedonaDB SQL documentation for ST_ASTEXT


Returns the azimuth between two points in radians, or NULL if not available.

Description

Returns the azimuth (angle) from the first point to the second point, measured in radians clockwise from north. Returns NULL if either input is not a point.

Usage

sd_azimuth(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_AZIMUTH


Returns the closure of the combinatorial boundary of this geometry or geography.

Description

For a polygon, the boundary is the exterior and interior rings; for a linestring it is the endpoints.

Usage

sd_boundary(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_BOUNDARY


Computes a geometry or geography that represents all points whose distance from the input is less than or equal to a specified distance.

Description

For geography, the distance is specified in meters. The buffer is computed on the sphere, producing a result that considers polar regions and the antimeridian. Negative distances are supported for polygon inputs to shrink the polygon.

Usage

sd_buffer(...)

Arguments

...

Supported combinations:

  • geom (geometry), distance (float64)

  • geom (geometry), distance (float64), params (string)

  • geom (geography), distance (float64)

  • geom (geography), distance (float64), num_quad_segs (integer)

  • geom (geography), distance (float64), params (string)

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_BUFFER


Returns the centroid of a geometry or geography.

Description

For geography, the centroid is calculated using spherical geometry.

Usage

sd_centroid(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_CENTROID


Returns the 2-dimensional point on geom1 that is closest to geom2.

Description

Returns the 2-dimensional point on geom1 that is closest to geom2.

Usage

sd_closestpoint(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_CLOSESTPOINT


Combines multiple geometries from a set of rows into a single collection.

Description

An aggregate function that collects multiple geometries into a single GeometryCollection or the appropriate Multi-type if all inputs share the same geometry type.

Usage

sd_collect_agg(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_COLLECT_AGG


Returns a concave hull enclosing the input geometry.

Description

Returns a concave hull enclosing the input geometry. The pct_convex parameter controls how "tight" the hull is: 1.0 produces the convex hull, while smaller values produce tighter, more concave shapes.

Usage

sd_concavehull(geom = sd_missing_arg(), pct_convex = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

pct_convex

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_CONCAVEHULL


Returns true if geomA contains geomB.

Description

Returns true if no points of B lie outside A and at least one point of B lies inside A.

Usage

sd_contains(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_CONTAINS


Returns the Convex Hull of a geometry or geography.

Description

Returns the smallest convex polygon that encloses all points in the input geometry.

Usage

sd_convexhull(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_CONVEXHULL


Returns true if geomA is covered by geomB.

Description

Returns true if no point in geometry A is outside geometry B. Inverse of ST_Covers: ST_CoveredBy(A, B) is equivalent to ST_Covers(B, A).

Usage

sd_coveredby(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_COVEREDBY


Returns true if geomA covers geomB.

Description

Returns true if no point in geometry B is outside geometry A. Similar to ST_Contains but does not require interior intersection.

Usage

sd_covers(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_COVERS


Returns true if A crosses B.

Description

Returns true if the two geometries have some (but not all) interior points in common and the dimension of the intersection is less than that of either input.

Usage

sd_crosses(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_CROSSES


Returns the Coordinate Reference System (CRS) metadata associated with a geometry or geography object.

Description

Returns the CRS (Coordinate Reference System) string associated with a geometry or geography. This is abbreviated as an authority/code if possible (e.g., 'EPSG:3857').

Usage

sd_crs(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(string)

See Also

SedonaDB SQL documentation for ST_CRS


Computes the difference between geomA and geomB.

Description

Returns the part of geometry A that does not intersect with geometry B.

Usage

sd_difference(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_DIFFERENCE


Returns the dimension of the geometry or geography.

Description

Returns the inherent dimension of the geometry: - 0 for points or multipoints

  • 1 for linestring or multilinestrings - 2 for polygons or multipolygons For geometry collections, returns the largest dimension among the components.

Usage

sd_dimension(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_DIMENSION


Returns true if geomA is disjoint from geomB.

Description

Returns true if the two geometries do not share any points. This is the inverse of ST_Intersects.

Usage

sd_disjoint(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_DISJOINT


Returns the distance between two geometries or geographies.

Description

For geometry, returns the 2D Cartesian (planar) distance between two geometries, in the units of the coordinate reference system. For geography, returns the spherical approximation of the geodesic distance between two geographies in meters.

Usage

sd_distance(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_DISTANCE


Expands multi-part geometries into child parts

Description

If the geometry is simple it returns the geometry itself, if the geometry is collection or multi it returns record for each of collection components.

Usage

sd_dump(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(struct)

See Also

SedonaDB SQL documentation for ST_DUMP


Returns true if two geometries or geographies are within a specified distance of each other.

Description

For geography, the distance is specified in meters and represents the spherical approximation of the geodesic distance between the two geographies.

Usage

sd_dwithin(
  geom_a = sd_missing_arg(),
  geom_b = sd_missing_arg(),
  distance = sd_missing_arg()
)

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

distance

(double): Input double

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_DWITHIN


Returns last point of a linestring.

Description

Returns last point of a linestring.

Usage

sd_endpoint(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_ENDPOINT


Returns the bounding box (envelope) of a geometry or geography as a new geometry.

Description

Returns the minimum axis-aligned bounding box of a geometry. This is usually a polygon but can be a linestring for perfectly vertical or horizontal input and is a point if the input is also a point. For geography, the return value is still a rectangular polygon geometry that represents the latitude and longitude range of the input. For geographies that span the antimeridian, a multipolygon is returned (one on each side of the antimeridian). Because of slight numerical inaccuracy of geographical calculations, the bounds are expanded slightly compared to the corresponding geometry envelope.

Usage

sd_envelope(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_ENVELOPE


An aggregate function that returns the collective bounding box (envelope) of a set of geometries.

Description

An aggregate function that computes the collective bounding box (envelope) of all geometries in a group.

Usage

sd_envelope_agg(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_ENVELOPE_AGG


Returns true if geomA equals geomB.

Description

Returns true if the two geometries are topologically equal (i.e., they represent the same point set, regardless of vertex order).

Usage

sd_equals(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_EQUALS


Returns a new geometry with the X and Y coordinates of each vertex swapped.

Description

Returns a new geometry with the X and Y coordinates of each vertex swapped.

Usage

sd_flipcoordinates(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_FLIPCOORDINATES


Forces a geometry or geography into a XY coordinate model.

Description

Discards any Z and M values present (if any).

Usage

sd_force2d(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_FORCE2D


Forces a geometry or geography into a XYZ coordinate model with an optional Z value.

Description

If the geometry already has Z values they are preserved; otherwise the optional z argument (default 0) is used.

Usage

sd_force3d(geom = sd_missing_arg(), z = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

z

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_FORCE3D


Forces a geometry or geography into a XYM coordinate model with an optional M value.

Description

If the geometry already has M values they are preserved; otherwise the optional m argument (default 0) is used.

Usage

sd_force3dm(geom = sd_missing_arg(), m = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

m

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_FORCE3DM


Forces a geometry or geography into a XYZM coordinate model with optional Z and M values.

Description

If the geometry already has Z and M values they are preserved; otherwise optional z and m arguments (both default 0) are used.

Usage

sd_force4d(geom = sd_missing_arg(), z = sd_missing_arg(), m = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

z

(double): Input double

m

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_FORCE4D


Constructs a Geography from WKB Binary.

Description

Constructs a Geography from WKB Binary.

Usage

sd_geogfromwkb(wkb = sd_missing_arg())

Arguments

wkb

(binary): Input binary

Value

(geography)

See Also

SedonaDB SQL documentation for ST_GEOGFROMWKB


Constructs a Geography from WKT.

Description

Alias: ST_GeogFromText.

Usage

sd_geogfromwkt(wkt = sd_missing_arg(), srid = sd_missing_arg())

Arguments

wkt

(string): Input string

srid

(integer): Input integer

Value

(geography)

See Also

SedonaDB SQL documentation for ST_GEOGFROMWKT


Creates a geography POINT from given longitude and latitude coordinates.

Description

Creates a geography Point from longitude and latitude coordinates.

Usage

sd_geogpoint(longitude = sd_missing_arg(), latitude = sd_missing_arg())

Arguments

longitude

(double): Input double

latitude

(double): Input double

Value

(geography)

See Also

SedonaDB SQL documentation for ST_GEOGPOINT


Returns the 1-based Nth geometry if the geometry is a GEOMETRYCOLLECTION, (MULTI)POINT, (MULTI)LINESTRING, MULTICURVE or (MULTI)POLYGON.

Description

Returns NULL if the index is out of range.

Usage

sd_geometryn(geom = sd_missing_arg(), n = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

n

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_GEOMETRYN


Returns the type of a geometry or geography.

Description

Returns the OGC geometry type name prefixed with ST_. Possible return values include: 'ST_Point', 'ST_LineString', 'ST_Polygon', 'ST_MultiPoint', 'ST_MultiLineString', 'ST_MultiPolygon', and 'ST_GeometryCollection'.

Usage

sd_geometrytype(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(string)

See Also

SedonaDB SQL documentation for ST_GEOMETRYTYPE


Constructs a geometry from Extended Well-Known Binary (EWKB).

Description

Parses an EWKB binary value and returns a geometry. EWKB extends the WKB format to include SRID information in the binary header and is useful for PostGIS compatibility.

Usage

sd_geomfromewkb(ewkb = sd_missing_arg())

Arguments

ewkb

(binary): Input binary

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_GEOMFROMEWKB


Constructs a geometry from Extended Well-Known Text (EWKT).

Description

Parses an EWKT string in the format ⁠SRID=<srid>;<wkt>⁠ and returns a geometry with the embedded SRID set. EWKT is used by PostGIS and other systems for human-readable output when an item-level SRID required.

Usage

sd_geomfromewkt(ewkt = sd_missing_arg())

Arguments

ewkt

(string): Input string

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_GEOMFROMEWKT


Constructs a Geometry from Well-Known Binary (WKB).

Description

Parses a WKB binary value and returns a geometry. The input is validated by default. An optional SRID or CRS can be provided as a second argument.

Usage

sd_geomfromwkb(wkb = sd_missing_arg(), srid = sd_missing_arg())

Arguments

wkb

(binary): Input binary

srid

(crs): Input crs

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_GEOMFROMWKB


Constructs a Geometry from Well-Known Text (WKT).

Description

An optional SRID or CRS can be provided as a second argument to set the spatial reference. Aliases: ST_GeomFromText, ST_GeometryFromText.

Usage

sd_geomfromwkt(wkt = sd_missing_arg(), srid = sd_missing_arg())

Arguments

wkt

(string): Input string

srid

(crs): Input crs

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_GEOMFROMWKT


Returns true if the geometry has a M dimension.

Description

Returns true if the geometry has a M dimension.

Usage

sd_hasm(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_HASM


Returns true if the geometry has a Z dimension.

Description

Returns true if the geometry has a Z dimension.

Usage

sd_hasz(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_HASZ


Returns the Nth interior ring of a polygon.

Description

Returns the Nth interior LINESTRING ring of a POLYGON. Returns NULL if the geometry is not a polygon or n is out of range. n is 1-based in SedonaDB.

Usage

sd_interiorringn(geom = sd_missing_arg(), n = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

n

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_INTERIORRINGN


Computes the intersection of two geometries or geographies.

Description

Computes the intersection of two geometries or geographies.

Usage

sd_intersection(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_INTERSECTION


Returns the cumulative intersection of all geometries in the input.

Description

Returns the cumulative intersection of all geometries in the input.

Usage

sd_intersection_agg(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_INTERSECTION_AGG


Returns true if geomA intersects geomB.

Description

Returns true if geomA intersects geomB.

Usage

sd_intersects(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_INTERSECTS


Returns true if the LINESTRING start and end point are the same.

Description

Returns true if the LineString's start and end points are the same. For MultiLineStrings, all elements must be closed.

Usage

sd_isclosed(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_ISCLOSED


Returns true if the geometry or geography type of the input is a collection type.

Description

Returns TRUE if the geometry type of the input is a geometry collection type. Collection types are the following: - GEOMETRYCOLLECTION - MULTIPOINT - MULTIPOLYGON - MULTILINESTRING

Usage

sd_iscollection(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_ISCOLLECTION


Returns true if the geometry or geography is empty.

Description

Returns true if the geometry or geography is empty.

Usage

sd_isempty(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_ISEMPTY


Returns true if a linestring is ST_IsClosed and ST_IsSimple.

Description

Returns true if the linestring is both closed (ST_IsClosed) and simple (ST_IsSimple). In other words, the input forms a ring with no self-intersections.

Usage

sd_isring(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_ISRING


Tests if geometry's only self-intersections are at boundary points.

Description

Returns true if the geometry has no anomalous geometric points such as self-intersections or self-tangency.

Usage

sd_issimple(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_ISSIMPLE


Checks whether a geometry meets the rules of a valid spatial object according to the OGC standard.

Description

Returns true if the geometry is well-formed according to OGC rules. Use ST_IsValidReason to get a diagnostic message for invalid geometries and ST_MakeValid to attempt to repair them.

Usage

sd_isvalid(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_ISVALID


Returns a text explanation describing why a geometry is invalid.

Description

Returns a text string explaining why a geometry is invalid, or "Valid Geometry" if the geometry is valid. Useful for debugging geometry construction.

Usage

sd_isvalidreason(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(string)

See Also

SedonaDB SQL documentation for ST_ISVALIDREASON


Returns true if geomA finds k nearest neighbors from geomB.

Description

ST_KNN is used in a join condition to find the k nearest neighbors of one geometry from another set of geometries. The actual k-nearest neighbors logic is handled by the spatial join execution engine: the function itself is a stub that simply defines the expected signature.

Usage

sd_knn(
  geomA = sd_missing_arg(),
  geomB = sd_missing_arg(),
  k = sd_missing_arg(),
  use_spheroid = sd_missing_arg()
)

Arguments

geomA

(geometry): The geometry around which to search.

geomB

(geometry): Column containing candidate geometries.

k

(integer): The number of nearest neighbours to return. Defaults to 1.

use_spheroid

(boolean): true to use spherical distance, false for Euclidean. Defaults to false.

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_KNN


Returns the length of a geometry or geography.

Description

Returns the length of geom. This function only supports LineString, MultiLineString, and GeometryCollections containing linear geometries. Use ST_Perimeter for polygons. For geometry, returns the length in the units of the coordinate reference system; for geography, returns the spherical approximation of the geodesic length in meters.

Usage

sd_length(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_LENGTH


Returns a point interpolated along a line.

Description

Returns a point interpolated along a line. First argument must be a LINESTRING. Second argument is a double between 0 and 1 representing fraction of total linestring length the point has to be located. For geography, the interpolation is computed using spherical interpolation between vertices.

Usage

sd_lineinterpolatepoint(geom = sd_missing_arg(), fraction = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

fraction

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_LINEINTERPOLATEPOINT


Returns the location of the closest point on a LineString as a fraction of its total length.

Description

Returns a double between 0 and 1, representing the location of the closest point on the LineString as a fraction of its total length. The first argument must be a LINESTRING, and the second argument is a POINT geometry or geography. For geography, the fraction is computed based on spherical interpolation between vertices.

Usage

sd_linelocatepoint(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geography): Input geography

geom_b

(geography): Input geography

Value

(double)

See Also

SedonaDB SQL documentation for ST_LINELOCATEPOINT


Merges a collection of potentially connected line segments into the fewest possible LineStrings.

Description

Merges a collection of potentially connected line segments into the fewest possible LineStrings.

Usage

sd_linemerge(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_LINEMERGE


Returns a linestring being a substring of the input one starting and ending at the given fractions of total 2d length.

Description

Returns a linestring being a substring of the input one starting and ending at the given fractions of total 2d length.

Usage

sd_linesubstring(
  geom = sd_missing_arg(),
  start_fraction = sd_missing_arg(),
  end_fraction = sd_missing_arg()
)

Arguments

geom

(geometry): Input geometry

start_fraction

(double): The fraction from which the returned line will start (between 0 and 1)

end_fraction

(double): The fraction from which the returned line will end (between 0 and 1)

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_LINESUBSTRING


Returns the M (measure) coordinate of a Point geometry.

Description

Extracts the M (measure) coordinate from a Point geometry or geography. Returns NULL if the geometry has no M dimension or for non-point geometries.

Usage

sd_m(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_M


Creates a LineString from two or more input geometries.

Description

Creates a LineString from two or more input Point, MultiPoint, or LineString geometries. The function connects the input geometries in the order they are provided to form a single continuous line.

Usage

sd_makeline(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_MAKELINE


Creates a valid representation of an invalid geometry.

Description

Collapsed geometries are either converted to empty (keepCollapsed=false) or a valid geometry of lower dimension (keepCollapsed=true). Default is keepCollapsed=false.

Usage

sd_makevalid(geom = sd_missing_arg(), keepCollapsed = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

keepCollapsed

(boolean): Input boolean

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_MAKEVALID


Returns the maximum distance between any pair of points in two geometries or geographies.

Description

For geography, returns the maximum distance in meters calculated using a spherical approximation.

Usage

sd_maxdistance(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geography): Input geography

geom_b

(geography): Input geography

Value

(double)

See Also

SedonaDB SQL documentation for ST_MAXDISTANCE


Returns the minimum clearance of a geometry.

Description

The minimum clearance is a metric that quantifies a geometry's tolerance to changes in coordinate precision or vertex positions. It represents the maximum distance by which vertices can be adjusted without introducing invalidity to the geometry's structure. A larger minimum clearance value indicates greater robustness against such perturbations. For a geometry with a minimum clearance of x, the following conditions hold: - No two distinct vertices are separated by a distance less than x. - No vertex lies within a distance x from any line segment it is not an endpoint of. For geometries with no definable minimum clearance, such as single Point geometries or MultiPoint geometries where all points occupy the same location, the function returns Double.MAX_VALUE.

Usage

sd_minimumclearance(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_MINIMUMCLEARANCE


Returns a LineString representing the minimum clearance distance of the input geometry.

Description

This function returns a two-point LineString geometry representing the minimum clearance distance of the input geometry. If the input geometry does not have a defined minimum clearance, such as for single Points or coincident MultiPoints, an empty LineString geometry is returned instead.

Usage

sd_minimumclearanceline(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_MINIMUMCLEARANCELINE


Missing argument sentinel

Description

Missing argument sentinel

Usage

sd_missing_arg()

Value

An object of class 'sd_missing_arg'


Returns the maximum M (measure) value from a geometry or geography's bounding box.

Description

Returns the maximum M (measure) value from a geometry or geography's bounding box.

Usage

sd_mmax(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_MMAX


Returns the minimum M-coordinate (measure) of a geometry or geography's bounding box.

Description

Returns the minimum M-coordinate (measure) of a geometry or geography's bounding box.

Usage

sd_mmin(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_MMIN


Returns the geometry or geography in its canonical form.

Description

Returns the geometry or geography in its canonical form.

Usage

sd_normalize(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_NORMALIZE


Returns the number of points of the geometry or geography.

Description

Returns the total number of coordinate points in the geometry, counting all vertices across all components.

Usage

sd_npoints(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_NPOINTS


Returns the total number of rings in a geometry or geography (both exterior and interior rings).

Description

Returns the total number of rings (exterior and interior) in a polygon or multipolygon. For a simple polygon, this is 1 plus the number of holes. For a multipolygon, it is the sum of all rings in all polygons. Returns 0 for non-polygon geometry types.

Usage

sd_nrings(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_NRINGS


Returns the number of geometries in a geometry or geography collection.

Description

Returns the number of Geometries. If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries, for single geometries will return 1.

Usage

sd_numgeometries(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_NUMGEOMETRIES


Returns the number of interior rings (holes) in a polygon geometry or geography.

Description

Returns the number of interior rings (holes) in a polygon. For a polygon without holes, returns 0. For multipolygons, returns the number of interior rings in the first polygon. Returns NULL for non-polygon geometry types. Alias: ST_NumInteriorRing.

Usage

sd_numinteriorrings(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_NUMINTERIORRINGS


Returns the number of points of a linestring geometry or geography.

Description

Returns the total number of coordinate points in a linestring geometry. Returns NULL for other geometry types. Use ST_NPoints() to calculate the number of vertices for all geometry types.

Usage

sd_numpoints(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_NUMPOINTS


Returns true if A overlaps B.

Description

Returns true if the two geometries share space and have the same dimension, but are not completely contained by each other.

Usage

sd_overlaps(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_OVERLAPS


Calculates the perimeter of a given geometry or geography.

Description

This function calculates the perimeter of a given geometry or geography. It supports Polygon, MultiPolygon, and GeometryCollection geometries (as long as the GeometryCollection contains polygonal geometries). For other types, it returns 0. To measure lines, use ST_Length. For geography, returns the spherical approximation of the geodesic perimeter in meters.

Usage

sd_perimeter(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_PERIMETER


Constructs a Point Geometry from X and Y.

Description

Constructs a Point geometry from X and Y coordinates. An optional SRID or CRS can be provided as a third argument.

Usage

sd_point(x = sd_missing_arg(), y = sd_missing_arg(), srid = sd_missing_arg())

Arguments

x

(double): Input double

y

(double): Input double

srid

(crs): Input crs

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POINT


Constructs a Point with an M (measure) coordinate from X, Y, and M values.

Description

Constructs a Point with an M (measure) coordinate from X, Y, and M values.

Usage

sd_pointm(x = sd_missing_arg(), y = sd_missing_arg(), m = sd_missing_arg())

Arguments

x

(double): Input double

y

(double): Input double

m

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POINTM


Returns the Nth point in a linestring.

Description

Return the Nth point in a single linestring. Negative values are counted backwards from the end of the LineString such that -1 is the last point. Returns NULL if there is no linestring in the geometry.

Usage

sd_pointn(geom = sd_missing_arg(), n = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

n

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POINTN


Returns a point guaranteed to lie on the surface of a geometry or geography.

Description

Unlike ST_Centroid which does not necessarily intersect a geometry or geography, ST_PointOnSurface makes an attempt to find an interior point close to the middle (using deterministic heuristics).

Usage

sd_pointonsurface(geom = sd_missing_arg())

Arguments

geom

(geography): Input geography

Value

(geography)

See Also

SedonaDB SQL documentation for ST_POINTONSURFACE


Returns a MultiPoint geometry consisting of all the coordinates of the input geometry or geography.

Description

Returns a MultiPoint geometry consisting of all the coordinates of the input geometry. It preserves duplicate points as well as M and Z coordinates.

Usage

sd_points(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POINTS


Constructs a Point with a Z coordinate from X, Y, and Z values.

Description

Constructs a Point with a Z coordinate from X, Y, and Z values.

Usage

sd_pointz(x = sd_missing_arg(), y = sd_missing_arg(), z = sd_missing_arg())

Arguments

x

(double): Input double

y

(double): Input double

z

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POINTZ


Constructs a Point with X, Y, Z and M coordinates.

Description

Constructs a Point with X, Y, Z and M coordinates.

Usage

sd_pointzm(
  x = sd_missing_arg(),
  y = sd_missing_arg(),
  z = sd_missing_arg(),
  m = sd_missing_arg()
)

Arguments

x

(double): Input double

y

(double): Input double

z

(double): Input double

m

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POINTZM


Builds a polygonal geometry from linear components in the input geometry.

Description

Builds a polygonal geometry from linear components in the input geometry. Handles GeometryCollection and multi-geometries by extracting linear components. Typically used with collections of complete, simple linework that forms polygon boundaries. Unlike many geometry constructors, this doesn't require explicit closure of rings—any closed rings in the input will become polygon boundaries.

Usage

sd_polygonize(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POLYGONIZE


Creates polygons from a set of geometries that contain linework representing the edges of a polygon.

Description

Creates polygons from a set of geometries that contain linework representing the edges of a polygon.

Usage

sd_polygonize_agg(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_POLYGONIZE_AGG


Reduces the coordinate precision of a geometry or geography to the specified grid size.

Description

Rebuilds a new geometry after specifying all vertices to the specified size. Z and M values are preserved but not affected by the grid snapping. The implementation is similar to a unary union and is designed to output valid geometry (e.g., by avoiding creating new crossing edges when snapping vertices).

Usage

sd_reduceprecision(geom = sd_missing_arg(), grid_size = sd_missing_arg())

Arguments

geom

(geography): Input geography

grid_size

(double): Input double

Value

(geography)

See Also

SedonaDB SQL documentation for ST_REDUCEPRECISION


Returns the DE-9IM intersection matrix string for two geometries, or tests whether two geometries satisfy a given intersection matrix pattern.

Description

When called with two geometry arguments, returns the DE-9IM (Dimensionally Extended 9-Intersection Model) intersection matrix as a 9-character string describing the spatial relationship between two geometries. When called with a third string argument, returns true if the two geometries satisfy the given DE-9IM intersection matrix pattern, false otherwise. The pattern can use wildcards (*) and T (any non-empty intersection) in addition to exact dimension values (0, 1, 2, F).

Usage

sd_relate(
  geom_a = sd_missing_arg(),
  geom_b = sd_missing_arg(),
  intersectionMatrixPattern = sd_missing_arg()
)

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

intersectionMatrixPattern

(string): A 9-character DE-9IM pattern string. Each character can be 0-2, T, F, or * (wildcard).

Value

(string)

See Also

SedonaDB SQL documentation for ST_RELATE


Returns the geometry or geography with vertex order reversed.

Description

Returns the geometry or geography with vertex order reversed.

Usage

sd_reverse(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_REVERSE


Rotates a geometry counter-clockwise around the Z axis by an angle in radians.

Description

Rotates a geometry counter-clockwise around the Z axis by an angle in radians.

Usage

sd_rotate(geom = sd_missing_arg(), rot = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

rot

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_ROTATE


Rotates a geometry around the X axis by an angle in radians.

Description

Rotates a geometry around the X axis by an angle in radians.

Usage

sd_rotatex(geom = sd_missing_arg(), rot = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

rot

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_ROTATEX


Rotates a geometry around the Y axis by an angle in radians.

Description

Rotates a geometry around the Y axis by an angle in radians.

Usage

sd_rotatey(geom = sd_missing_arg(), rot = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

rot

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_ROTATEY


Scales a geometry by multiplying ordinates with scale factors.

Description

Scales a geometry by multiplying each coordinate by the corresponding scale factor. A 3D variant accepts scaleZ.

Usage

sd_scale(
  geom = sd_missing_arg(),
  scaleX = sd_missing_arg(),
  scaleY = sd_missing_arg(),
  scaleZ = sd_missing_arg()
)

Arguments

geom

(geometry): Input geometry

scaleX

(double): Input double

scaleY

(double): Input double

scaleZ

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SCALE


Densifies a geometry by adding intermediate points along segments that exceed a maximum length.

Description

Densifies a geometry or geography by adding intermediate points along line segments that exceed the specified maximum segment length. For geometry, uses planar distance; for geography, uses the spherical approximation of the geodesic distance in meters and points are added along the great circle arc. In both cases, points are added so that each resulting segment is no longer than max_segment_length.

Usage

sd_segmentize(geom = sd_missing_arg(), max_segment_length = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

max_segment_length

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SEGMENTIZE


Sets the Coordinate Reference System (CRS) for a geometry.

Description

Sets a CRS to a geometry/geography. This is metadata-only - no coordinates are transformed. This is different from ST_Transform which actually transforms coordinates.

Usage

sd_setcrs(geom = sd_missing_arg(), target_crs = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

target_crs

(string): Input string

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SETCRS


Sets the SRID (spatial reference identifier) for a geometry.

Description

Sets the SRID (spatial reference system identifier) of the geometry. This is metadata only - no coordinate transformation occurs. Use ST_Transform to actually reproject coordinates.

Usage

sd_setsrid(geom = sd_missing_arg(), srid = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

srid

(integer): Input integer

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SETSRID


Simplifies an input geometry or geography using the Douglas-Peucker algorithm.

Description

Simplifies a geometry or geography using the Douglas-Peucker algorithm. The tolerance parameter controls the degree of simplification: higher values produce simpler geometries. For geography, the tolerance is specified in meters and a different algorithm is used. This function may produce invalid geometries; use ST_SimplifyPreserveTopology when validity must be maintained.

Usage

sd_simplify(geom = sd_missing_arg(), tolerance = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

tolerance

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SIMPLIFY


Simplifies a geometry, ensuring the result is a valid geometry with the same topology.

Description

Simplifies a geometry, ensuring that the result is a valid geometry having the same dimension and number of components as the input, and with the components having the same topological relationship.

Usage

sd_simplifypreservetopology(
  geom = sd_missing_arg(),
  tolerance = sd_missing_arg()
)

Arguments

geom

(geometry): Input geometry

tolerance

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SIMPLIFYPRESERVETOPOLOGY


Snaps input geometry to reference geometry within tolerance.

Description

Snaps input geometry to reference geometry within tolerance. Result geometry aligns to the reference geometry where within tolerance distance.

Usage

sd_snap(
  geom_a = sd_missing_arg(),
  geom_b = sd_missing_arg(),
  tolerance = sd_missing_arg()
)

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

tolerance

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SNAP


Returns the SRID (spatial reference identifier) of a geometry.

Description

Returns the SRID (spatial reference identifier) of a geometry.

Usage

sd_srid(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_SRID


Returns the start point of a linestring geometry.

Description

Returns the start point of a linestring geometry.

Usage

sd_startpoint(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_STARTPOINT


Returns the parts of geometries or geographies A and B that do not overlap.

Description

Returns the parts of geometries or geographies A and B that do not overlap.

Usage

sd_symdifference(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_SYMDIFFERENCE


Converts a geometry to geography, densifying edges to approximate planar lines as geodesic segments.

Description

Converts a geometry to a geography while tessellating edges using spherical (geodesic) interpolation. The tolerance parameter specifies the maximum deviation in meters between the original edge and the tessellated approximation. This is useful when converting planar geometries to geographies where edges need to follow geodesic paths on the sphere.

Usage

sd_tessellategeog(geom = sd_missing_arg(), tolerance = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

tolerance

(double): Input double

Value

(geography)

See Also

SedonaDB SQL documentation for ST_TESSELLATEGEOG


Converts a geography to geometry, densifying edges to approximate geodesic segments as planar lines.

Description

Converts a geography to a geometry while tessellating edges using spherical (geodesic) interpolation. The tolerance parameter specifies the maximum deviation in meters between the original spherical edge and the tessellated planar approximation. This is useful when converting geographies to geometries while preserving the shape of geodesic edges as approximated line segments. When an edge crosses the antimeridian, the returned coordinates are "wrapped" such that the returned longitude is either greater than 180 or less than -180. This helps produce valid geometry in more cases (e.g., linestring or polygon crossing the antimeridian); however, it does not produce valid geometry in the case of a polygon ring that spans the full longitude range (e.g., Antarctica).

Usage

sd_tessellategeom(geom = sd_missing_arg(), tolerance = sd_missing_arg())

Arguments

geom

(geography): Input geography

tolerance

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_TESSELLATEGEOM


Converts a geometry to a geography by changing the edge interpretation to spherical.

Description

Converts a geometry to a geography by changing the edge interpretation from planar to spherical. This is a metadata-only operation that does not modify the underlying coordinate data. If the input is already a geography, it is returned unchanged.

Usage

sd_togeography(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geography)

See Also

SedonaDB SQL documentation for ST_TOGEOGRAPHY


Converts a geography to a geometry by changing the edge interpretation to planar.

Description

Converts a geography to a geometry by changing the edge interpretation from spherical to planar. This is a metadata-only operation that does not modify the underlying coordinate data. If the input is already a geometry, it is returned unchanged.

Usage

sd_togeometry(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_TOGEOMETRY


Returns true if A touches B.

Description

Returns true if the two geometries have at least one boundary point in common but no interior points in common.

Usage

sd_touches(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_TOUCHES


Transforms a geometry from one coordinate reference system to another.

Description

Transforms the coordinate reference system of a geometry between EPSG reference systems. If provided with 2 arguments, target_crs can be specified as an EPSG code (e.g., 'EPSG:4326') or as a PROJ string. When 3 arguments are provided, a source_crs can be used to specify the source CRS in case the input geometry doesn't have an SRID defined. The source_crs takes precedence over the geometry's SRID.

Usage

sd_transform(...)

Arguments

...

Supported combinations:

  • geom (geometry), target_crs (string)

  • geom (geometry), source_crs (string), target_crs (string)

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_TRANSFORM


Returns a geometry with coordinates translated by deltaX and deltaY.

Description

Translates (shifts) a geometry by the given deltaX and deltaY offsets. A 3D variant accepts deltaZ.

Usage

sd_translate(
  geom = sd_missing_arg(),
  deltaX = sd_missing_arg(),
  deltaY = sd_missing_arg(),
  deltaZ = sd_missing_arg()
)

Arguments

geom

(geometry): Input geometry

deltaX

(double): Input double

deltaY

(double): Input double

deltaZ

(double): Input double

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_TRANSLATE


Returns a single geometry which is the union of all components.

Description

Returns a single geometry which is the union of all components of the input geometry. Useful for computing the union of a set of geometries stored in a single geometry (e.g., a GEOMETRYCOLLECTION or MULTI* geometry).

Usage

sd_unaryunion(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_UNARYUNION


Returns a geometry or geography that represents the point set union of two geometries or geographies.

Description

Returns a geometry or geography that represents the point set union of two geometries or geographies.

Usage

sd_union(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_UNION


Returns a geometry that represents the point set union of all geometries.

Description

Returns a geometry that represents the point set union of all geometries.

Usage

sd_union_agg(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(geometry)

See Also

SedonaDB SQL documentation for ST_UNION_AGG


Returns true if A is completely inside B.

Description

Returns true if geometry A is completely inside geometry B. This is the inverse of ST_Contains: ST_Within(A, B) is equivalent to ST_Contains(B, A).

Usage

sd_within(geom_a = sd_missing_arg(), geom_b = sd_missing_arg())

Arguments

geom_a

(geometry): Input geometry

geom_b

(geometry): Input geometry

Value

(boolean)

See Also

SedonaDB SQL documentation for ST_WITHIN


Returns the X coordinate (longitude for geography) of the point, or NULL if not available.

Description

Returns NULL for non-point geometries or NULL input.

Usage

sd_x(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_X


Returns the maximum X coordinate (longitude for geography) of a geometry or geography's bounding box.

Description

Returns the maximum X coordinate (longitude for geography) of a geometry or geography's bounding box.

Usage

sd_xmax(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_XMAX


Returns the minimum X coordinate (longitude for geography) of a geometry or geography's bounding box.

Description

Returns the minimum X coordinate (longitude for geography) of a geometry or geography's bounding box.

Usage

sd_xmin(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_XMIN


Returns the Y coordinate (latitude for geography) of the point, or NULL if not available.

Description

Returns NULL for non-point geometries or NULL input.

Usage

sd_y(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_Y


Returns the maximum Y coordinate (latitude for geography) of a geometry or geography's bounding box.

Description

For geography, the maximum latitude is computed considering spherical geometry (e.g., the maximum latitude of a linestring that crosses the North Pole is 90).

Usage

sd_ymax(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_YMAX


Returns the minimum Y coordinate (latitude for geography) of a geometry or geography's bounding box.

Description

For geography, the minimum latitude is computed considering spherical geometry (e.g., the minimum latitude of a linestring that crosses the South Pole is -90).

Usage

sd_ymin(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_YMIN


Returns the Z coordinate of the point, or NULL if not available.

Description

Returns NULL if the geometry has no Z dimension or for non-point geometries.

Usage

sd_z(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_Z


Returns the maximum Z coordinate of a geometry or geography's bounding box.

Description

Returns the maximum Z coordinate of a geometry or geography's bounding box.

Usage

sd_zmax(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_ZMAX


Returns a code indicating the dimension of the coordinates in a geometry.

Description

Returns a code indicating the coordinate dimension: - 0 = 2D (XY) - 1 = 3D with M coordinate (XYM) - 2 = 3D with Z coordinate (XYZ) - 3 = 4D (XYZM)

Usage

sd_zmflag(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(integer)

See Also

SedonaDB SQL documentation for ST_ZMFLAG


Returns the minimum Z coordinate of a geometry or geography's bounding box.

Description

Returns the minimum Z coordinate of a geometry or geography's bounding box.

Usage

sd_zmin(geom = sd_missing_arg())

Arguments

geom

(geometry): Input geometry

Value

(double)

See Also

SedonaDB SQL documentation for ST_ZMIN