Expand description
geoserde is a framework for reading and writing geospatial data as Rust types.
- Geometry — any geo-traits type to write and any
DeserializeGeometrytype to read, such as geo-types. - Properties — your own serde structs, with nested structs, maps, arrays and enums flattened into the flat columns of an attribute table.
File formats are supported by separate crates, such as:
- geoserde-fgb — FlatGeobuf
§Traits for your data types
| Geometry | Properties | |
|---|---|---|
| Write | geo_traits::GeometryTrait | serde::Serialize |
| Read | de::DeserializeGeometry | serde::Deserialize |
§Traits for file formats
| Geometry | Properties | |
|---|---|---|
| Write | — (takes any geo_traits::GeometryTrait) | ser::SerializeProperties |
| Read | geo_traits::GeometryTrait | serde::Deserializer |
Reading properties needs no trait of geoserde’s own, since a flat row is
already a map in serde’s data model: expose it as a
MapAccess. For its values, the built-in
deserializers in serde::de::value do not read a present value into an
Option field, so a format crate needs its own value deserializer to
support Option fields.
§Cargo features
geo-types—de::DeserializeGeometryimpls forgeo_types. Enabled by default.
Modules§
- de
- Geometry deserialization from
geo_traitssources. - ser
- Property serialization into flat key-value tables.