functions_geometry.yaml¶
This document file is generated for functions_geometry.yaml. The extension URN is extension:io.substrait:functions_geometry.
Data Types¶
name: geometry structure: BINARY
Scalar Functions¶
point¶
Returns a 2D point with the given x and y coordinate values.
Implementations:
- point(
x: fp64,y: fp64): ->u!geometry
make_line¶
Returns a linestring connecting the endpoint of geometry geom1 to the begin point of geometry geom2. Repeated points at the beginning of input geometries are collapsed to a single point. A linestring can be closed or simple. A closed linestring starts and ends on the same point. A simple linestring does not cross or touch itself.
Implementations:
- make_line(
geom1: u!geometry,geom2: u!geometry): ->u!geometry
x_coordinate¶
Return the x coordinate of the point. Return null if not available.
Implementations:
- x_coordinate(
point: u!geometry): ->fp64
y_coordinate¶
Return the y coordinate of the point. Return null if not available.
Implementations:
- y_coordinate(
point: u!geometry): ->fp64
num_points¶
Return the number of points in the geometry. The geometry should be an linestring or circularstring.
Implementations:
- num_points(
geom: u!geometry): ->i64
is_empty¶
Return true is the geometry is an empty geometry.
Implementations:
- is_empty(
geom: u!geometry): ->boolean
is_closed¶
Return true if the geometry’s start and end points are the same.
Implementations:
- is_closed(
geom: u!geometry): ->boolean
is_simple¶
Return true if the geometry does not self intersect.
Implementations:
- is_simple(
geom: u!geometry): ->boolean
is_ring¶
Return true if the geometry’s start and end points are the same and it does not self intersect.
Implementations:
- is_ring(
geom: u!geometry): ->boolean
geometry_type¶
Return the type of geometry as a string.
Implementations:
- geometry_type(
geom: u!geometry): ->string
envelope¶
Return the minimum bounding box for the input geometry as a geometry. The returned geometry is defined by the corner points of the bounding box. If the input geometry is a point or a line, the returned geometry can also be a point or line.
Implementations:
- envelope(
geom: u!geometry): ->u!geometry
dimension¶
Return the dimension of the input geometry. If the input is a collection of geometries, return the largest dimension from the collection. Dimensionality is determined by the complexity of the input and not the coordinate system being used. Type dimensions: POINT - 0 LINE - 1 POLYGON - 2
Implementations:
- dimension(
geom: u!geometry): ->i8
is_valid¶
Return true if the input geometry is a valid 2D geometry. For 3 dimensional and 4 dimensional geometries, the validity is still only tested in 2 dimensions.
Implementations:
- is_valid(
geom: u!geometry): ->boolean
collection_extract¶
Given the input geometry collection, return a homogenous multi-geometry. All geometries in the multi-geometry will have the same dimension. If type is not specified, the multi-geometry will only contain geometries of the highest dimension. If type is specified, the multi-geometry will only contain geometries of that type. If there are no geometries of the specified type, an empty geometry is returned. Only points, linestrings, and polygons are supported. Type numbers: POINT - 0 LINE - 1 POLYGON - 2
Implementations:
- collection_extract(
geom_collection: u!geometry): ->u!geometry - collection_extract(
geom_collection: u!geometry,type: i8): ->u!geometry
flip_coordinates¶
Return a version of the input geometry with the X and Y axis flipped. This operation can be performed on geometries with more than 2 dimensions. However, only X and Y axis will be flipped.
Implementations:
- flip_coordinates(
geom_collection: u!geometry): ->u!geometry
remove_repeated_points¶
Return a version of the input geometry with duplicate consecutive points removed. If the tolerance argument is provided, consecutive points within the tolerance distance of one another are considered to be duplicates.
Implementations:
- remove_repeated_points(
geom: u!geometry): ->u!geometry - remove_repeated_points(
geom: u!geometry,tolerance: fp64): ->u!geometry
buffer¶
Compute and return an expanded version of the input geometry. All the points of the returned geometry are at a distance of buffer_radius away from the points of the input geometry. If a negative buffer_radius is provided, the geometry will shrink instead of expand. A negative buffer_radius may shrink the geometry completely, in which case an empty geometry is returned. For input the geometries of points or lines, a negative buffer_radius will always return an emtpy geometry.
Implementations:
- buffer(
geom: u!geometry,buffer_radius: fp64): ->u!geometry
centroid¶
Return a point which is the geometric center of mass of the input geometry.
Implementations:
- centroid(
geom: u!geometry): ->u!geometry
minimum_bounding_circle¶
Return the smallest circle polygon that contains the input geometry.
Implementations:
- minimum_bounding_circle(
geom: u!geometry): ->u!geometry