Revanth14 commented on code in PR #1239:
URL: https://github.com/apache/iceberg-go/pull/1239#discussion_r3470971747
##########
table/arrow_utils.go:
##########
@@ -1883,23 +1923,32 @@ func geoArrowCRSToIcebergCRS(meta geoarrow.Metadata)
(string, error) {
if err := json.Unmarshal(meta.CRS, &crs); err != nil {
return "", fmt.Errorf("invalid geoarrow CRS metadata:
%w", err)
}
-
- if strings.EqualFold(crs, "OGC:CRS84") ||
strings.EqualFold(crs, "EPSG:4326") {
- return "OGC:CRS84", nil
+ if crs == "" {
+ return "", errors.New("unsupported CRS: empty string
CRS")
}
switch meta.CRSType {
- case geoarrow.CRSTypeSRID:
- return "srid:" + crs, nil
+ case geoarrow.CRSTypePROJJSON:
+ return "", errPROJJSONStringCRSNotSupported
case geoarrow.CRSTypeWKT22019:
- return "", errors.New("CRS type wkt2:2019 not
supported")
- default:
- if len(crs) <= 32 {
- return crs, nil
- }
+ return "", errWKT2CRSNotSupported
+ }
- return "", errors.New("crs length too long")
+ if strings.EqualFold(crs, "OGC:CRS84") ||
strings.EqualFold(crs, "EPSG:4326") {
Review Comment:
Done, The canonical block is now immediately after the empty-string guard
and before the `crs_type` switch, so it short-circuits for all annotations. I
also removed the SRID special-casing comment since it’s no longer needed.
--
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]