georust / wkt

Rust read/write support for well-known text (WKT)
https://crates.io/crates/wkt
Apache License 2.0
51 stars 25 forks source link

FromWkt trait for reading WKT without exposing the user to the intermediate representation. #95

Closed michaelkirk closed 2 years ago

michaelkirk commented 2 years ago

Draft because it's based on #94. Please review that first.


Note that this isn't a performance change. It's about (hopefully) making the library easier to use.

This is a corollary to https://github.com/georust/wkt/pull/89, but for reading WKT, rather than writing. As we discussed there, probably there is no reason for the user to care about the Wkt struct.

Note that the intermediate representation is still used (for now!), but the user is no longer required to interact with it.

The road is open though for having a direct translation from Wkt text to the geo-types (or whatever) represenation (see geozero for inspiration).


I also added the missing GeometryCollection::from(wkt) implementation to make this work for all geo-types.

michaelkirk commented 2 years ago

bors r=urschrei

(rebased)

bors[bot] commented 2 years ago

Build succeeded: