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

[SEDONA-125]Allows customized CRS in ST_Transform #686

Merged
merged 18 commits into from
Oct 10, 2022
Merged

[SEDONA-125]Allows customized CRS in ST_Transform #686

merged 18 commits into from
Oct 10, 2022

Conversation

SW186000
Copy link

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

add WKT support for ST_transform

How was this patch tested?

Scala unit test

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation update.

@jiayuasu
Copy link
Member

@SW186000 This looks good. Can you also incorporate your change to ST_Transform in Sedona Flink?

@SW186000
Copy link
Author

Updated the PR

@@ -18,6 +18,7 @@
import org.apache.sedona.common.utils.GeometryGeoHashEncoder;
import org.geotools.geometry.jts.JTS;
import org.geotools.referencing.CRS;
import org.jetbrains.annotations.Nullable;
Copy link
Member

Choose a reason for hiding this comment

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

@SW186000 The test failed. Please fix the Nullable annotation from "org.jetbrains.annotations"

Copy link
Author

Choose a reason for hiding this comment

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

Update the PR.

Copy link
Contributor

@Kimahriman Kimahriman left a comment

Choose a reason for hiding this comment

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

Left a few comments

Comment on lines 187 to 191
public static Geometry transform(Geometry geometry, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, boolean lenient)
throws FactoryException,TransformException {
MathTransform transform = CRS.findMathTransform(sourceCRS,targetCRS,lenient);
return JTS.transform(geometry, transform);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for reply.
I forgot deleting this function.
i will delete it.

Comment on lines 160 to 162
else {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this going to cause NPEs instead of throwing an exception explaining the string can't be parsed as a CRS?

@@ -1234,7 +1234,8 @@ MULTIPOLYGON (((-2 -3, -3 -3, -3 3, -2 3, -2 -3)), ((3 -3, 3 3, 4 3, 4 -3, 3 -3)

Introduction:

Transform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS
Transform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS.
For SourceCRS and TargetCRS, WKT format is also available.
Copy link
Member

Choose a reason for hiding this comment

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

Please add "since v1.3.1". Please also add the same sentence to the Flink SQL doc. Thank you!

Copy link
Author

Choose a reason for hiding this comment

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

I add the comments.

@jiayuasu
Copy link
Member

jiayuasu commented Oct 9, 2022

@SW186000 Could you please fix the failed CI?

@SW186000
Copy link
Author

@jiayuasu Sorry for late reply. I fix it.

@jiayuasu jiayuasu merged commit eb77408 into apache:master Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants