This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch SEDONA-206-bad-ST_Transform-perf
in repository https://gitbox.apache.org/repos/asf/incubator-sedona.git
The following commit(s) were added to
refs/heads/SEDONA-206-bad-ST_Transform-perf by this push:
new 307208a9 Swap CRS.parseWKT and CRS.decode
307208a9 is described below
commit 307208a98b7719841d04d1a6ccea517d6a788451
Author: Jia Yu <[email protected]>
AuthorDate: Sun Dec 11 20:52:45 2022 -0800
Swap CRS.parseWKT and CRS.decode
---
.../main/java/org/apache/sedona/common/Functions.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/common/src/main/java/org/apache/sedona/common/Functions.java
b/common/src/main/java/org/apache/sedona/common/Functions.java
index 57abcd0c..8b14ee77 100644
--- a/common/src/main/java/org/apache/sedona/common/Functions.java
+++ b/common/src/main/java/org/apache/sedona/common/Functions.java
@@ -191,20 +191,20 @@ public class Functions {
return JTS.transform(geometry, transform);
}
- private static CoordinateReferenceSystem parseCRSString(String CRSString)
throws FactoryException {
+ private static CoordinateReferenceSystem parseCRSString(String CRSString)
+ throws FactoryException
+ {
try {
- return CRS.parseWKT(CRSString);
+ return CRS.decode(CRSString);
}
- catch (FactoryException ex1) {
+ catch (NoSuchAuthorityCodeException e) {
try {
- return CRS.decode(CRSString);
- } catch (NoSuchAuthorityCodeException ex4) {
- throw new NoSuchAuthorityCodeException("that Authority code
cannot be found", CRSString, CRSString);
- } catch (FactoryException ex6) {
- throw new FactoryException("WKT format is illegal");
+ return CRS.parseWKT(CRSString);
+ }
+ catch (FactoryException ex) {
+ throw new FactoryException("First failed to read as a
well-known CRS code: \n" + e.getMessage() + "\nThen failed to read as a WKT CRS
string: \n" + ex.getMessage());
}
}
-
}
public static Geometry flipCoordinates(Geometry geometry) {