pub enum TableLayout {
Packed,
Plain,
}Expand description
How osm.nodes and osm.ways store their rows: chosen by the import, kept by every update.
SQL reads osm.nodes and osm.ways with geom as a PostGIS geometry and nodes as an int8[] in either
layout. When packed, the tables are osm.nodes_packed and osm.ways_packed, and osm.nodes and osm.ways are
views over them that decode geom with osm.geom(geom) and nodes with osm.node_ids(nodes). osm.geom is
inlined, so an index on osm.ways_packed (osm.geom(geom)) serves queries on the view osm.ways; when plain, the
index is on osm.ways (geom).
It displays and parses as packed or plain, its name in osm.state.
Variants§
Packed
Compact tables, read through the views osm.nodes and osm.ways. geom is TWKB with OSM’s 7 decimal digits
in a bytea, which PostGIS reads exactly as the locations were written: 11.5 MB against 48.3 MB of WKB in the
District of Columbia. A way’s nodes is a bytea of its node IDs, each as the step from the
one before (the first from 0), zigzag-encoded and written as an LEB128 varint: 6.0 MB against 25.9 MB as an
int8[] in the District of Columbia, 17.6 MB against 86.7 MB in New York City (PostgreSQL 18 in Docker on a
laptop). osm.node_ids decodes about 1.3 µs per node, 9.1 s for all ways of New York City against 0.28 s for
reading an int8[], so bulk readers should read osm.ways_packed and decode the bytes themselves.
Plain
PostGIS’s geometry with SRID 4326, stored as WKB, and nodes as an int8[], in the tables osm.nodes and
osm.ways: read without decoding.
Trait Implementations§
Source§impl AsRef<str> for TableLayout
impl AsRef<str> for TableLayout
Source§impl Clone for TableLayout
impl Clone for TableLayout
impl Copy for TableLayout
Source§impl Debug for TableLayout
impl Debug for TableLayout
Source§impl Default for TableLayout
impl Default for TableLayout
Source§impl Display for TableLayout
impl Display for TableLayout
impl Eq for TableLayout
Source§impl FromStr for TableLayout
impl FromStr for TableLayout
Source§impl Hash for TableLayout
impl Hash for TableLayout
Source§impl PartialEq for TableLayout
impl PartialEq for TableLayout
impl StructuralPartialEq for TableLayout
Source§impl TryFrom<&str> for TableLayout
impl TryFrom<&str> for TableLayout
Source§impl VariantNames for TableLayout
impl VariantNames for TableLayout
Auto Trait Implementations§
impl Forget for TableLayout
impl Freeze for TableLayout
impl Move for TableLayout
impl RefUnwindSafe for TableLayout
impl Send for TableLayout
impl Sync for TableLayout
impl Unpin for TableLayout
impl UnsafeUnpin for TableLayout
impl UnwindSafe for TableLayout
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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