jiayuasu opened a new issue, #2810:
URL: https://github.com/apache/sedona/issues/2810

   ## Description
   
   In `TestHelper.checkWKBGeography`, the comparison is `compareTo(geoWKT, 
geoWKT)` instead of `compareTo(geoWKB, geoWKT)`. This means the method always 
returns equal (comparing the same object), so the test never actually validates 
that WKB decoding matches the expected WKT.
   
   ## Root cause
   
   Two bugs interact:
   
   1. **Typo in `checkWKBGeography`** (`TestHelper.java:177`): 
`compareTo(geoWKT, geoWKT)` should be `compareTo(geoWKB, geoWKT)`.
   
   2. **`compareTo` fails for empty geometries**: WKB and WKT readers produce 
incompatible `Geography` subtypes for empty geometries (e.g., `POINT EMPTY`). 
When the typo is fixed, `WKBReaderTest.EmptyTest` fails because `compareTo` 
cannot correctly compare these mismatched types.
   
   ## Steps to reproduce
   
   Change line 177 of `TestHelper.java` from:
   ```java
   boolean isEqual = compareTo(geoWKT, geoWKT) == 0;
   ```
   to:
   ```java
   boolean isEqual = compareTo(geoWKB, geoWKT) == 0;
   ```
   
   Run `WKBReaderTest.EmptyTest` — it will fail with `AssertionError`.
   
   ## What needs to happen
   
   - Fix `compareTo` to handle the case where WKB and WKT readers produce 
different `Geography` subtypes for empty geometries
   - Fix the typo in `checkWKBGeography`
   - Verify all `WKBReaderTest` cases pass with the corrected comparison


-- 
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]

Reply via email to