Revanth14 commented on code in PR #1239:
URL: https://github.com/apache/iceberg-go/pull/1239#discussion_r3470975158
##########
table/arrow_utils.go:
##########
@@ -1871,6 +1871,46 @@ func checkCRSJSON(rawCrs json.RawMessage) bool {
return len(b) > 0 && b[0] == '{'
}
+// errWKT2CRSNotSupported is returned for WKT2:2019 CRS definitions, which this
+// package does not support yet.
+var errWKT2CRSNotSupported = errors.New("CRS type wkt2:2019 not supported")
+
+// errPROJJSONStringCRSNotSupported is returned for projjson-typed string CRS
+// values, which this package does not support yet.
+var errPROJJSONStringCRSNotSupported = errors.New("CRS type projjson not
supported for string CRS")
+
+// isWKT2CRSString reports whether crs looks like a WKT2 (ISO 19162) CRS
+// definition. It is a best-effort heuristic used only to surface the clearer
+// errWKT2CRSNotSupported message. The list covers the WKT2:2019 CRS keywords
+// and their long forms.
+func isWKT2CRSString(crs string) bool {
+ upper := strings.ToUpper(strings.TrimSpace(crs))
+
+ for _, prefix := range []string{
+ "BOUNDCRS[",
+ "COMPOUNDCRS[",
+ "DERIVEDPROJCRS[",
+ "ENGCRS[",
+ "ENGINEERINGCRS[",
+ "GEODCRS[",
+ "GEODETICCRS[",
+ "GEOGCRS[",
Review Comment:
Done. I added `COORDINATEMETADATA[`, `COORDINATEOPERATION[`, and `CRS[` to
the WKT2 prefix list, and added coverage for those forms in
`TestGeoArrowCRSToIcebergCRS`.
The helper comment now also calls out that this is intentionally best-effort
and only used to return the clearer WKT2 unsupported error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]