1#![doc = include_str!("../README.md")]
2extern crate core;
3
4macro_rules! validate_stream {
6 ($stream:expr, $expected:pat $(,)?) => {
7 if !matches!($stream.meta.stream_type, $expected) {
8 return Err($crate::MltError::UnexpectedStreamType2(
9 $stream.meta.stream_type,
10 stringify!($expected),
11 stringify!($stream),
12 ));
13 }
14 };
15}
16
17macro_rules! with_kinds {
23 ($m:ident) => {
24 $m! {
25 scalar { Bool, I8, U8, I32, U32, I64, U64, F32, F64 }
26 string { Str }
27 }
28 };
29}
30
31pub use fast_mvt;
32pub use geo_types;
33
34pub(crate) mod codecs;
35pub(crate) mod convert;
36pub(crate) mod decoder;
37pub mod dump;
38pub mod encoder;
39pub(crate) mod errors;
40pub(crate) mod layer_writer;
41pub(crate) mod tile;
42pub(crate) mod utils;
43
44pub use convert::{InferredKind, geojson, mvt};
45pub use decoder::{
46 ColNames, ColumnRef, Decoder, FeatureRef, GeometryType, GeometryValues, Layer, Layer01,
47 Layer01FeatureIter, LendingIterator, ParsedId, ParsedLayer, ParsedLayer01, ParsedProperty,
48 ParsedScalar, ParsedSharedDict, ParsedSharedDictItem, ParsedStrings, Parser, PropName,
49 PropNamesIter, PropValueRef, Unknown,
50};
51pub(crate) use decoder::{
54 ColumnType, DictRange, DictionaryType, LengthType, OffsetType, RawPresence, RawSharedDict,
55 RawSharedDictItem, StreamType,
56};
57#[cfg(feature = "unstable-v2")]
58pub use decoder::{
59 Layer02, MValueColumn, MValueSpans, MValues, Nested, ParsedInterior, ParsedLayer02, ParsedLeaf,
60 ParsedList, ParsedMValue, ParsedMap, ParsedNested, ParsedNode, ParsedStruct, RawInterior,
61 RawLeaf, RawList, RawMValue, RawMap, RawNested, RawNode, RawStruct,
62};
63pub(crate) use errors::MltRefResult;
64pub use errors::{MltError, MltResult};
65pub use layer_writer::{FeatureWriter, LayerWriter};
66pub use tile::{
67 ColumnRole, Extent, PropKind, PropValue, PropertyKey, TileFeature, TileFeatureBuilder,
68 TileLayer, TileLayerBuilder,
69};
70#[cfg(feature = "unstable-v2")]
71pub use tile::{MValue, MValueKey, NestedKey, NestedKind, NestedValue, ZStep};
72pub(crate) use utils::analyze::{Analyze, StatType};
73pub(crate) use utils::lazy_state::{Decode, DecodeState, Lazy, LazyParsed, Parsed};
74pub use utils::{PresenceOptIter, PresentValues};
75
76pub mod wire {
82 #[cfg(feature = "unstable-v2")]
83 pub use crate::decoder::stream::model::XyzLogical;
84 pub use crate::decoder::stream::model::{
85 Alp, BoolLogical, DictionaryType, FastPForKind, FloatLogical, IntEncoding, IntLogical,
86 LengthType, LogicalEncoding, LogicalTechnique, Morton, OffsetType, PhysicalEncoding,
87 RleLayout, RleMeta, StreamMeta, StreamType, ValueKind, VertexLogical,
88 };
89 pub use crate::decoder::{
90 ColumnDecl, ColumnStorage, ColumnType, DictLayout, LayerBytes, StringLayout,
91 };
92 #[cfg(feature = "unstable-v2")]
93 pub use crate::decoder::{GeoLayout, LayerLayout};
94 pub use crate::utils::analyze::{Analyze, StatType};
95}
96
97#[cfg(any(test, feature = "__private"))]
98pub use crate::utils::test_helpers;
99
100#[cfg(any(test, feature = "__private"))]
102#[doc(hidden)]
103pub mod __private {
104 pub use crate::codecs::*;
105 pub use crate::convert::*;
106 pub use crate::decoder::*;
107 pub use crate::errors::*;
108 pub use crate::test_helpers::*;
109 pub use crate::tile::*;
110 pub use crate::utils::analyze::*;
111 pub use crate::utils::lazy_state::*;
112 pub use crate::utils::*;
113}