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 14, 2023
1 parent f2bfe15 commit 70bdd50
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:
- value: geometry
name: geom
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:
- value: geometry
name: geom_collection
return: geometry
- args:
- value: geometry
name: geom_collection
- value: i8
name: type
return: geometry
-
name: "flip_coordinates"
description: >
Return a version of the input geometry with the X and Y axis flipped.
impls:
- args:
- value: geometry
name: geom_collection
return: 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:
- value: geometry
name: geom
return: geometry
- args:
- value: geometry
name: geom
- value: fp32
name: tolerance
return: geometry

0 comments on commit 70bdd50

Please sign in to comment.