-
Notifications
You must be signed in to change notification settings - Fork 693
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-343] Add RS_Contains and RS_Within #946
[SEDONA-343] Add RS_Contains and RS_Within #946
Conversation
return rasterGeometry.within(geometry); | ||
} | ||
|
||
private static Geometry convertCRSIfNeeded(Geometry geometry, CoordinateReferenceSystem rasterCRS) { |
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.
Can you re-use the code of ST_Transform?
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.
Is the order lon/lat or lat/lon?
|
||
private static Geometry convertCRSIfNeeded(Geometry geometry, CoordinateReferenceSystem rasterCRS) { | ||
int geomSRID = geometry.getSRID(); | ||
if (rasterCRS != null && !(rasterCRS instanceof DefaultEngineeringCRS) && geomSRID > 0) { |
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.
Is the DefaultEngineeringCRS default or DefaultCartisian2D?
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.
DefaultEngineeringCRS is the default CRS, as also mentioned in makeEmptyRaster()
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326); | ||
Geometry geometry = geometryFactory.toGeometry(new Envelope(30, 60, 10, 50)); | ||
GridCoverage2D raster = RasterConstructors.makeEmptyRaster(1, 20, 20, 32, 35, 1, -1, 0, 0, 4326); | ||
geometry = JTS.transform(geometry, CRS.findMathTransform(raster.getCoordinateReferenceSystem(), CRS.decode("EPSG:3857"))); |
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.
Try to re-use the code from ST_Transform
Did you read the Contributor Guide?
Is this PR related to a JIRA ticket?
[SEDONA-XXX] my subject
.What changes were proposed in this PR?
How was this patch tested?
Did this PR include necessary documentation updates?
vX.Y.Z
format.