-
Notifications
You must be signed in to change notification settings - Fork 662
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
[SEDONA-631] Add ST_Expand #1527
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a5b26d8
feat: add ST_Expand
furqaankhan 0c576f4
fix: snowflake tests
furqaankhan c3b7436
fix: simplify the implementation, remove BBox implementation
furqaankhan 74c8da7
chore: undo changes in BBox
furqaankhan 229ce6e
docs: add additional behavior details
furqaankhan bc3549f
add test to check preservation of SRID
furqaankhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1216,6 +1216,45 @@ Output: | |
POLYGON ((0 0, 0 3, 1 3, 1 0, 0 0)) | ||
``` | ||
|
||
## ST_Expand | ||
|
||
Introduction: Returns a geometry expanded from the bounding box of the input. The expansion can be specified in two ways: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please say this only deal with X, Y, Z value. If |
||
|
||
1. By individual axis using `deltaX`, `deltaY`, or `deltaZ` parameters. | ||
2. Uniformly across all axes using the `uniformDelta` parameter. | ||
|
||
!!!Note | ||
Things to consider when using this function: | ||
|
||
1. The `uniformDelta` parameter expands Z dimensions for XYZ geometries; otherwise, it only affects XY dimensions. | ||
2. For XYZ geometries, specifying only `deltaX` and `deltaY` will preserve the original Z dimension. | ||
3. If the input geometry has an M dimension then using this function will drop the said M dimension. | ||
|
||
Format: | ||
|
||
`ST_Expand(geometry: Geometry, uniformDelta: Double)` | ||
|
||
`ST_Expand(geometry: Geometry, deltaX: Double, deltaY: Double)` | ||
|
||
`ST_Expand(geometry: Geometry, deltaX: Double, deltaY: Double, deltaZ: Double)` | ||
|
||
Since: `v1.6.1` | ||
|
||
SQL Example: | ||
|
||
```sql | ||
SELECT ST_Expand( | ||
ST_GeomFromWKT('POLYGON Z((50 50 1, 50 80 2, 80 80 3, 80 50 2, 50 50 1))'), | ||
10 | ||
) | ||
``` | ||
|
||
Output: | ||
|
||
``` | ||
POLYGON Z((40 40 -9, 40 90 -9, 90 90 13, 90 40 13, 40 40 -9)) | ||
``` | ||
|
||
## ST_ExteriorRing | ||
|
||
Introduction: Returns a line string representing the exterior ring of the POLYGON geometry. Return NULL if the geometry is not a polygon. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a Geometry does not have Z value, JTS will give NaN (https://locationtech.github.io/jts/javadoc/org/locationtech/jts/geom/Coordinate.html#getZ--). Does the
Math
comparison still work in this case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it just returns a NaN, and I am skipping the Z values when Geometry doesn't have it. I don't see it being a problem.