trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.36k stars 2.98k forks source link

Support reading geometries in EWKB format. #23824

Open umartin opened 5 days ago

umartin commented 5 days ago

EWKB is a common binary representation for geometries.

PostGIS and Apache Sedona supports reading both WKB and EWKB formats in their ST_GeomFromBinary/WKB functions transparently.

https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Format_variations https://sedona.apache.org/latest/api/sql/Constructor/#st_geomfromwkb

umartin commented 5 days ago

The WKB reader in JTS supports both formats. Adding support for EWKB in Trino is just a matter of replacing the ESRI implementation with JTS. https://github.com/trinodb/trino/compare/master...umartin:trino:ewkb

If you are happy with the proposed changes I'd be happy to sign the CLA and open a PR

wendigo commented 22 hours ago

@umartin please open a PR and we will review it