JuliaGeo / GeoFormatTypes.jl

Wrapper types for spatial data formats like well known text, KML, Proj4 strings.
https://juliageo.github.io/GeoFormatTypes.jl/stable
MIT License
6 stars 0 forks source link

Add WKB and extended variants #16

Closed evetion closed 2 years ago

evetion commented 2 years ago

Well Known Binary (WKB) is a binary format, akin to WKT. Both these formats also exist in the Extended format (EWKB, EWKT), that prefix the CRS information, as used in PostGIS. See https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Format_variations.

rafaqz commented 2 years ago

We do have WellKnownBinary already: https://github.com/JuliaGeo/GeoFormatTypes.jl/blob/7acab849a454ba0e4ed4a5576eaf21712c4cd2cb/src/GeoFormatTypes.jl#L154-L158

But yes we should add the extended formats.

rafaqz commented 2 years ago

A question relating to #15 is if we need ExtendedWellKnownText/ExtendedWellKnownBinary or if WellKnownText(Extended(), string) and WellKnownBinaryt(Extended(), data) is enough - where Extended is like Mixed but explicitly saying that we know that both formats are contained.

I'm thinking we split Mixed into Unknown and Extended to be more explicit - where Mixed becomes the abstract supertype of both, and Unknown is the default for any MixedFormat object if you don't pass in the trait.