Skip to content

Commit

Permalink
feat: add geometry editor functions
Browse files Browse the repository at this point in the history
  • Loading branch information
richtia committed Sep 28, 2023
1 parent f2bfe15 commit 3d16df0
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions extensions/functions_geometry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
%YAML 1.2
---
scalar_functions:
-
name: "isvalid"
description: >
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.
impls:
- args:
- name: geom
value: u!geometry
return: boolean
-
name: "collection_extract"
description: >
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:
1 == POINT
2 == LINESTRING
3 == POLYGON
impls:
- args:
- name: geom_collection
value: u!geometry
return: u!geometry
- args:
- name: geom_collection
value: u!geometry
- name: type
value: i8
return: u!geometry
-
name: "flip_coordinates"
description: >
Return a version of the input geometry with the X and Y axis flipped.
impls:
- args:
- name: geom_collection
value: u!geometry
return: u!geometry
-
name: "remove_repeated_points"
description: >
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.
impls:
- args:
- name: geom
value: u!geometry
return: u!geometry
- args:
- name: geom
value: u!geometry
- name: tolerance
value: fp64
return: u!geometry

0 comments on commit 3d16df0

Please sign in to comment.