Skip to main content

Module dataset

Module dataset 

Source
Expand description

Object-safe Dataset + Layer traits — the polymorphic surface that every concrete reader (geonative-filegdb, geonative-shapefile, future GPKG / GeoJSON / FlatGeoBuf) implements.

§When to use traits vs concrete types

  • Concrete types (geonative_filegdb::Geodatabase, geonative_shapefile::Shapefile, …) are zero-cost — no virtual dispatch, no boxing. Use them when your code knows the format up front.
  • Traits (Dataset, Layer) enable format-polymorphic code: a converter that opens any source and writes to any sink, a CLI that probes by extension, etc. The cost is Box<dyn> (one indirection per call).

§Single-layer formats

Shapefile-style formats have no concept of multiple layers per file. The SingleLayerDataset adapter wraps any Layer so it can stand in for a Dataset (with a single sentinel layer name, default "default").

Structs§

SingleLayerDataset
Adapter that wraps any Layer in a Dataset facade with one sentinel layer name. Use this when a single-layer format like Shapefile needs to satisfy a Dataset interface.

Traits§

Dataset
A container of one or more named layers — the polymorphic equivalent of geonative_filegdb::Geodatabase.
Layer
A stream of features sharing one schema — the polymorphic equivalent of geonative_filegdb::Layer, geonative_shapefile::Shapefile, etc.