-
Notifications
You must be signed in to change notification settings - Fork 654
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
Conversation
@SW186000 This looks good. Can you also incorporate your change to ST_Transform in Sedona Flink? |
(compatible with Apache Flink)
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; |
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.
@SW186000 The test failed. Please fix the Nullable annotation from "org.jetbrains.annotations"
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.
Update the PR.
(delete Nullable annotation)
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.
Left a few comments
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); | ||
} |
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 this used anywhere?
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.
Sorry for reply.
I forgot deleting this function.
i will delete it.
else { | ||
return null; | ||
} |
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 this going to cause NPEs instead of throwing an exception explaining the string can't be parsed as a CRS?
flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
Outdated
Show resolved
Hide resolved
sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
Outdated
Show resolved
Hide resolved
(delete needless function)
…/Functions.scala Co-authored-by: Adam Binford <adamq43@gmail.com>
Co-authored-by: Adam Binford <adamq43@gmail.com>
…ons.java Co-authored-by: Adam Binford <adamq43@gmail.com>
docs/api/sql/Function.md
Outdated
@@ -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. |
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.
Please add "since v1.3.1
". Please also add the same sentence to the Flink SQL doc. Thank you!
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.
I add the comments.
(add exceptions)
(add exceptions)
(add doc comments)
@SW186000 Could you please fix the failed CI? |
@jiayuasu Sorry for late reply. I fix it. |
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?
add WKT support for ST_transform
How was this patch tested?
Scala unit test
Did this PR include necessary documentation updates?