pub enum DatasetFormat {
Show 19 variants
GeoTiff,
GeoJson,
Shapefile,
GeoParquet,
NetCdf,
Hdf5,
Zarr,
Grib,
Stac,
Terrain,
Vrt,
FlatGeobuf,
Jpeg2000,
GeoPackage,
PMTiles,
MBTiles,
Copc,
Las,
Unknown,
}Expand description
Detected format of a geospatial dataset.
Variants§
GeoTiff
GeoTIFF / Cloud-Optimized GeoTIFF (.tif, .tiff)
GeoJson
GeoJSON (.geojson, .json)
Shapefile
ESRI Shapefile (.shp)
GeoParquet
GeoParquet (.parquet, .geoparquet)
NetCdf
NetCDF (.nc, .nc4)
Hdf5
HDF5 (.h5, .hdf5, .he5)
Zarr
Zarr (.zarr directory)
Grib
GRIB/GRIB2 (.grib, .grib2, .grb, .grb2)
Stac
STAC catalog (.json with STAC metadata)
Terrain
Terrain formats
Vrt
Virtual Raster Tiles (.vrt)
FlatGeobuf
FlatGeobuf (.fgb)
Jpeg2000
JPEG2000 (.jp2, .j2k)
GeoPackage
GeoPackage (.gpkg, SQLite-based)
PMTiles
PMTiles v3 single-file tile archive (.pmtiles)
MBTiles
MBTiles SQLite tile archive (.mbtiles)
Copc
Cloud Optimized Point Cloud (.copc.laz)
Las
Plain LAS / LAZ point cloud (.las, .laz) — not COPC-structured.
COPC is a specific LAZ 1.4 profile requiring an octree-hierarchy VLR and
chunked layout. A generic .las/.laz file does not have that
structure, so it is tagged Las rather than Copc. Only the compound
.copc.laz extension (or a verified COPC VLR) is reported as Copc.
Unknown
Unknown / user-specified
Implementations§
Source§impl DatasetFormat
impl DatasetFormat
Sourcepub fn is_geopackage(path: &Path) -> bool
pub fn is_geopackage(path: &Path) -> bool
Returns true if this format is likely a GeoPackage (GPKG).
Source§impl DatasetFormat
impl DatasetFormat
Sourcepub fn from_extension(path: &str) -> Self
pub fn from_extension(path: &str) -> Self
Detect format from file extension.
Returns DatasetFormat::Unknown if the extension is not recognized.
For .copc.laz files, the compound extension is checked first.
Sourcepub fn detect_from_magic_bytes(bytes: &[u8]) -> Option<Self>
pub fn detect_from_magic_bytes(bytes: &[u8]) -> Option<Self>
Detect format purely from a byte slice — no file I/O.
Pass the first 72 bytes of a file (MAGIC_READ_SIZE).
Returns None when no known magic signature is matched.
Note: ZIP magic (PK\x03\x04) and SQLite magic are mapped to
DatasetFormat::GeoPackage as a conservative default; callers
can refine the choice with the file extension when needed.
Sourcepub fn detect(path: &Path) -> Result<Self>
pub fn detect(path: &Path) -> Result<Self>
Detect format by reading magic bytes from a file on disk.
Opens the file, reads 72 bytes (MAGIC_READ_SIZE), then calls
DatasetFormat::detect_from_magic_bytes. When the magic check yields
DatasetFormat::GeoPackage the file extension is used to disambiguate
between GeoPackage (.gpkg), MBTiles (.mbtiles), and generic SQLite.
§Errors
Returns std::io::Error if the file cannot be opened or read.
Sourcepub fn driver_name(&self) -> &'static str
pub fn driver_name(&self) -> &'static str
Human-readable driver name (matches GDAL naming convention).
Trait Implementations§
Source§impl Clone for DatasetFormat
impl Clone for DatasetFormat
Source§fn clone(&self) -> DatasetFormat
fn clone(&self) -> DatasetFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DatasetFormat
Source§impl Debug for DatasetFormat
impl Debug for DatasetFormat
Source§impl Display for DatasetFormat
impl Display for DatasetFormat
impl Eq for DatasetFormat
Source§impl PartialEq for DatasetFormat
impl PartialEq for DatasetFormat
impl StructuralPartialEq for DatasetFormat
Auto Trait Implementations§
impl Freeze for DatasetFormat
impl RefUnwindSafe for DatasetFormat
impl Send for DatasetFormat
impl Sync for DatasetFormat
impl Unpin for DatasetFormat
impl UnsafeUnpin for DatasetFormat
impl UnwindSafe for DatasetFormat
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more