jiayuasu opened a new issue, #3200:
URL: https://github.com/apache/sedona/issues/3200
### Problem
An empty Geography LineString does not produce valid WKB. Structural
functions that convert the value to JTS therefore fail:
```sql
SELECT ST_NPoints(ST_GeogFromWKT('LINESTRING EMPTY', 4326));
```
The call throws `RuntimeException: Failed to parse WKB to JTS Geometry`
instead of returning `0`.
### Root cause
`WKBWriter.writePolyline` writes the LineString header but does not write
the required zero coordinate count when `SinglePolylineGeography` has no S2
polyline.
### Expected behavior
- Serialize an empty Geography LineString as valid WKB with a coordinate
count of zero.
- Preserve the SRID.
- Allow WKB-to-JTS and WKB-to-S2 round trips.
- Return `0` from structural accessors such as `ST_NPoints`.
This was discovered while reviewing the Geography overload for `ST_MakeLine`.
--
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]