diff --git a/extensions/extension_types.yaml b/extensions/extension_types.yaml index e03073c50..f310dbb20 100644 --- a/extensions/extension_types.yaml +++ b/extensions/extension_types.yaml @@ -8,3 +8,35 @@ types: structure: start: point end: point + - name: coordinate + structure: + x: fp64 + y: fp64 + - name: crs_point + structure: + x: fp64 + y: fp64 + crs: string + - name: linestring + structure: + T: List + - name: polygon + structure: + T: List> + - name: multipoint + structure: + T: List + - name: multilinestring + structure: + T: List + - name: multipolygon + structure: + T: List + - name: any_simple_geometry + parameters: + - name: T + type: union + - name: geometry + parameters: + - name: T + type: List diff --git a/extensions/functions_geometry.yaml b/extensions/functions_geometry.yaml new file mode 100644 index 000000000..4ffa2c725 --- /dev/null +++ b/extensions/functions_geometry.yaml @@ -0,0 +1,29 @@ +%YAML 1.2 +--- +scalar_functions: + - + name: "point" + description: > + Return a 2D point with the given `x` and `y` coordinate values. + impls: + - args: + - name: x + value: fp64 + - name: y + value: fp64 + return: geometry + - + name: "makeline" + description: > + Return a linestring containing the points of the two input geometries. + 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. + impls: + - args: + - name: x + value: geometry + - name: y + value: geometry + return: geometry