Table of Contents

Namespace SpatialNET.IO

Classes

GeoJson

Reading and writing GeoJSON (RFC 7946, ADR 0009) via System.Text.Json. Reading goes through the geometry factory; properties and a crs member are ignored, M values are dropped. Writing uses the leanest type, with shells counter-clockwise and holes clockwise.

GeoJsonOptions

Options for writing GeoJSON.

Mvt

Encoding and decoding of Mapbox Vector Tiles (MVT 2.1, https://github.com/mapbox/vector-tile-spec) with a hand-written protobuf codec, plus gzip helpers. Geometry in a tile is in integer tile coordinates; SpatialNET.IO.MvtTileBuilder converts world coordinates of any tile grid.

MvtFeature

A feature of a vector tile layer: optional id, geometry type, the geometry as MVT command integers in tile coordinates and the attributes. Build it from a tile-coordinate geometry with SpatialNET.IO.MvtFeature.Create(SpatialNET.IGeometry2D,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.Object}},System.Nullable{System.UInt64}) or let SpatialNET.IO.MvtTileBuilder do the transform from world coordinates.

MvtGeometry

The MVT geometry encoding (spec section 4.3): command integers (id & 0x7) | (count << 3) with MoveTo = 1, LineTo = 2 and ClosePath = 7, followed by zigzag-encoded coordinate deltas relative to a cursor that persists across the parts of a feature.

MvtLayer

A layer of a vector tile: name, version, extent and features.

MvtTile

A vector tile: a list of layers (MVT 2.1).

MvtTileBuilder

Builds one vector tile of any tile grid from world geometries: each geometry is clipped to the tile plus buffer, simplified (about one pixel), transformed to tile coordinates, rounded to integers, cleaned of repeated points and degenerate parts and its rings oriented as MVT requires (exterior clockwise on screen, i.e. positive area in tile coordinates with y down; interior rings opposite). Multipolygons are written part by part, each exterior ring followed by its holes.

MvtTileOptions

Options for building vector tiles from world geometries.

MvtTileTransform

The affine mapping between the world coordinates of one tile and its tile coordinates (0..extent, y down), for any grid. X maps [MinX, MaxX] to [0, extent], Y maps [MaxY, MinY] to [0, extent]; for non-square tiles both axes are scaled independently.

TileGrid

A tile grid in any coordinate reference system: origin, origin corner, tile size in pixels and one resolution (world units per pixel) per level. The grid only does arithmetic; it never projects.

Wkb

Reading and writing WKB (ADR 0016). Reading accepts ISO WKB and EWKB in either byte order and creates the geometries through the geometry factory; writing produces ISO WKB in little endian.

WkbOptions

Options for writing WKB.

Wkt

Reading and writing WKT (ADR 0009). Reading goes through the geometry factory; geometrically invalid but syntactically correct input is accepted and passed to the factory unchanged.

WktOptions

Options for writing WKT.

Structs

MvtValue

An attribute value of a vector tile feature. The SpatialNET.IO.MvtValue.Kind fixes the protobuf field, so that a decoded value is encoded again into the same bytes. Values of the same kind and value are deduplicated in the layer's value table.

Enums

MMode

How M is handled when writing (ADR 0015).

MvtGeometryType

The geometry type of a vector tile feature (MVT 2.1, GeomType).

MvtValueKind

The protobuf field a SpatialNET.IO.MvtValue is stored in (MVT 2.1, Value message).

TileOrigin

The corner of the grid origin, and with it the direction in which rows count.

ZMode

How Z is handled when writing (ADR 0009).