Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial commit for adding geometry accessor functions #552

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions extensions/functions_geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,103 @@ scalar_functions:
- name: y
value: u!geometry
return: u!geometry
-
name: "x_coordinate"
description: >
Return the x coordinate of the point. Return null if not available.
impls:
- args:
- name: point
value: u!geometry
return: fp64
-
name: "y_coodinate"
description: >
Return the y coordinate of the point. Return null if not available.
impls:
- args:
- name: point
value: u!geometry
return: fp64
-
name: "numpoints"
description: >
Return the number of points in the geometry. The geometry should be an linestring
or circularstring.
impls:
- args:
- name: geom
value: u!geometry
return: i64
-
name: "isempty"
description: >
Return true is the geometry is an empty geometry.
impls:
- args:
- name: geom
value: u!geometry
return: boolean
-
name: "isclosed"
description: >
Return true if the geometry's start and end points are the same.
impls:
- args:
- name: geom
value: geometry
return: boolean
-
name: "issimple"
description: >
Return true if the geometry does not self intersect.
impls:
- args:
- name: geom
value: u!geometry
return: boolean
-
name: "isring"
description: >
Return true if the geometry's start and end points are the same and it does not self
intersect.
impls:
- args:
- name: geom
value: u!geometry
return: boolean
-
name: "geometrytype"
description: >
Return the type of geometry as a string.
impls:
- args:
- name: geom
value: u!geometry
return: string
-
name: "envelope"
description: >
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.
impls:
- args:
- name: geom
value: u!geometry
return: u!geometry
-
name: "dimension"
description: >
Return the dimension of the input geometry. If the input is a collection of geometries,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The examples below don't necessarily imply dimension. Could we clarify if a line in 3D space considered one dimensional or three?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it would still be one dimensional. I don't think this function takes into consideration the dimensionality of the space, only the geometry itself. Maybe @paleolimbot would have a better idea on this.

Copy link
Member

@EpsilonPrime EpsilonPrime Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all we need to do is add text that clarifies that dimension refers to the complexity of the figures in the geometry and not the coordinate system being used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Just updated.

return the largest dimension from the collection.

POINT - 0
LINE - 1
POLYGON - 2
impls:
- args:
- name: geom
value: u!geometry
return: i8
Loading