-
Notifications
You must be signed in to change notification settings - Fork 133
Supported PostGIS Function: STNumPoints for Geospatial datatypes #4510
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
Merged
jsudrik
merged 18 commits into
babelfish-for-postgresql:BABEL_5_X_DEV
from
Gopalverma062:BABEL_6310_STNUMPOINTS
Mar 3, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cce0cb2
BABEL-6310: Add STNumPoints support for geometry and geography types
05575eb
Add expected_dependency files
b3d80e1
Fix in STNumPoints testcases
abe951b
Update Numeric_Decimal_tests expected output for STNumPoints support
fe1c5e9
code fixes in Pr
b920386
Added before version files
51e7b6c
adding of parallel_query/numerical_decimal_tests.out
5f2696c
Remove deprecated Test-spatial-functions-2-before-17_9-or-16_13 test …
52de55b
addresing the comments
6919fab
adding dependency file
8c60d16
adding comments in testcases
f7ee44e
fix order_by issue
c7a0702
Merge upstream/BABEL_5_X_DEV
6df506d
resolving merge conflict and precison difference testfailure
294d73d
fixing the test_files
255b941
chnages the testcases
511e761
EMPTY
0484446
trigger CI
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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -462,6 +462,19 @@ CREATE OR REPLACE FUNCTION sys.Geometry__Parse(geometry_tagged_text sys.NVARCHAR | |
| END; | ||
| $$ LANGUAGE plpgsql STRICT IMMUTABLE PARALLEL SAFE; | ||
|
|
||
| --STNumPoints | ||
| CREATE OR REPLACE FUNCTION sys.STNumPoints(geom sys.GEOMETRY) | ||
| RETURNS integer | ||
| AS $$ | ||
| BEGIN | ||
| IF STIsValid(geom) = 0 THEN | ||
| RAISE EXCEPTION 'The geometry instance is not valid'; | ||
| ELSE | ||
| RETURN sys.STNumPoints_helper(geom); | ||
|
Contributor
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. Don't we need to check whether geometry is empty or not?
Contributor
Author
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. actually it is handled by the c functions |
||
| END IF; | ||
| END; | ||
| $$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE; | ||
|
|
||
| -- STDisjoint | ||
| -- Checks if two geometries have no points in common | ||
| CREATE OR REPLACE FUNCTION sys.STDisjoint(geom1 sys.GEOMETRY, geom2 sys.GEOMETRY) | ||
|
|
@@ -656,6 +669,11 @@ CREATE OR REPLACE FUNCTION sys.STDimension_helper(sys.GEOMETRY) | |
| RETURNS integer | ||
| AS '$libdir/postgis-3','LWGEOM_dimension' | ||
| LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; | ||
|
|
||
| CREATE OR REPLACE FUNCTION sys.STNumPoints_helper(sys.GEOMETRY) | ||
| RETURNS integer | ||
| AS '$libdir/postgis-3','LWGEOM_npoints' | ||
| LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; | ||
|
|
||
| CREATE OR REPLACE FUNCTION sys.STIntersects_helper(geom1 sys.GEOMETRY, geom2 sys.GEOMETRY) | ||
| RETURNS sys.BIT | ||
|
|
||
39 changes: 39 additions & 0 deletions
39
contrib/babelfishpg_common/sql/upgrades/spatial_types--5.5.0--5.6.0.sql
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
18 changes: 18 additions & 0 deletions
18
test/JDBC/expected/Test-spatial-functions-3-vu-cleanup.out
This file contains hidden or 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.
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.
Don't we need to check whether geography is empty or not?
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.
actually it is handled by the c functions