You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/03/30 06:25:59 UTC
[I] checkWKBGeography compares geoWKT against itself instead of geoWKB [sedona]
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: issues-unsubscribe@sedona.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] checkWKBGeography compares geoWKT against itself instead of geoWKB [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu closed issue #2810: checkWKBGeography compares geoWKT against itself instead of geoWKB
URL: https://github.com/apache/sedona/issues/2810
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org