Add STLength support for geography and geometry types#4468
Add STLength support for geography and geometry types#4468Gopalverma062 wants to merge 12 commits intobabelfish-for-postgresql:BABEL_5_X_DEVfrom
Conversation
Signed-off-by: Gopal Verma <[email protected]>
| CREATE VIEW TestGeospatialMethods_empty_ValFromGeomTemp AS SELECT location.STIsEmpty() FROM TestGeospatialMethods_SPATIALPOINTGEOM_dttemp ORDER BY location.STX; | ||
|
|
||
| CREATE VIEW TestGeospatialMethods_empty_TextFromGeomTemp AS SELECT location.STIsEmpty() AS Dimension FROM TestGeospatialMethods_SPATIALPOINTGEOG_dttemp ORDER BY location.Lat; No newline at end of file | ||
| CREATE VIEW TestGeospatialMethods_empty_TextFromGeomTemp AS SELECT location.STIsEmpty() AS Dimension FROM TestGeospatialMethods_SPATIALPOINTGEOG_dttemp ORDER BY location.Lat; |
There was a problem hiding this comment.
unnecessary change, please remove this.
test/JDBC/input/datatypes/Test-spatial-functions-2-vu-prepare.txt
Outdated
Show resolved
Hide resolved
test/JDBC/input/datatypes/Test-spatial-functions-2-vu-prepare.txt
Outdated
Show resolved
Hide resolved
|
Add expected output files as well. |
|
Please fix the PR description. |
| IF geom IS NULL THEN | ||
| RETURN NULL; |
There was a problem hiding this comment.
I think marking the function strict already makes sure to return NULL or NULL input so this check seems unnecessary.
| IF geom IS NULL THEN | ||
| RETURN NULL; |
| CREATE OR REPLACE FUNCTION sys.STPerimeter_helper(sys.GEOMETRY) | ||
| RETURNS float8 | ||
| AS '$libdir/postgis-3','LWGEOM_perimeter2d_poly' | ||
| LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; |
There was a problem hiding this comment.
Let's also add sys.STLength(geom sys.GEOGRAPHY) and sys.STLength_helper(geom sys.GEOGRAPHY) functions here.
| RETURN geom; | ||
| ELSE | ||
| RAISE EXCEPTION 'Expected "POLYGON" at Position 1. The input has %', $1; | ||
| END IF; |
There was a problem hiding this comment.
This change should come into spatial_types--5.5.0--5.6.0.sql instead. Lets remove these changes from this file.
| STDIMENSION: 'STDimension'; | ||
| STDISJOINT: 'STDisjoint'; | ||
| STDISTANCE: 'STDistance'; | ||
| STREDUCE: 'STReduce'; |
There was a problem hiding this comment.
Let's only add STLENGTH for now. Also, let's not mark the comments as resolved until we actually fix them.
| @@ -951,4 +951,164 @@ Select CAST(CAST('POINT EMPTY' as varchar(100)) AS geography).STAsText(); | |||
| go | |||
There was a problem hiding this comment.
Let's also add expected output files.
Pull Request Test Coverage Report for Build 21511153874Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
| ------------------------------------------------------- | ||
| -- STLength | ||
| CREATE OR REPLACE FUNCTION sys.STLength(geom sys.GEOMETRY) | ||
| RETURNS float8 |
There was a problem hiding this comment.
Have we verified whether it is float4 or float8?
There was a problem hiding this comment.
yes i have verified it
Description
Implemented
STLength()GeoSpatial TSQL function that was previously unsupported in Babelfish.Changes
Function Implementation
STLength()function by utilizing PostGIS functions where appropriateParser Updates
Test Cases
Error Handling
Extended Existing Functionalities
Testing