Skip to content
pyautark (soon)

Layers data

Layers are the main data units rendered by autk-map. Each layer combines a dataset with a rendering type, allowing the map to interpret the input geometry, apply the appropriate visual rules, and compose multiple datasets in the same view.

Layer basics

Layers are loaded with loadCollection() and then rendered according to the selected type. The basic call has the following shape:

ts
map.loadCollection(layerId, {
  collection,
  type,      // optional for inferred vector layers
  property,  // required for raster layers
});
PartDescription
layerIdUnique layer identifier used later to update thematic data, visibility, picking, and other rendering properties.
params.collectionSource FeatureCollection to load.
params.typeOptional when the geometry can be inferred for vector layers. Physical layers should usually pass type explicitly.
params.propertyRequired for raster layers so the renderer knows which numeric value to read from each cell.

autk-map also assumes a few basic rules about how layer data is organized and loaded:

  • Projected coordinatesautk-map expects projected coordinates. You may use any projected coordinate system, but all loaded layers must use the same selected system.
  • Initial framing — the first loaded layer defines the initial map bounding box and camera framing.
  • Existing bounds — if the collection already includes a bbox, autk-map uses it instead of recomputing bounds.
  • Manual bounds — you can set the bounding box before loading any layer with map.boundingBox = [minLon, minLat, maxLon, maxLat].

Physical layers

Physical layers are specialized layer types designed for common map components such as streets, buildings, parks, water, and ground surface. They are used to build the map context and are useful when the dataset already represents those physical urban elements. In most cases, physical layers should be loaded with type passed explicitly.

TypeGeometryDescription
surfacePolygonGround or land-cover surface
parksPolygonParks and green areas
waterPolygonWater bodies
roadsPolylineRoad network
buildingsPolygon3D buildings rendered with extrusion

Physical layers are not limited to OSM

Physical layers are used to build the map context, but they are not restricted to OpenStreetMap data loaded using autk-db. You can also load GeoJSON files as surface, parks, water, roads, or buildings when your own data already matches those physical categories.

Vector layers

Vector layers are the generic layer types used for custom GeoJSON data. They map directly to the three main geometry families, so they are the right choice when the data is not meant to be interpreted as one of the physical layers. loadCollection() is the standard entry point for these collections.

TypeGeometry
pointsPoint / MultiPoint
polylinesLineString / MultiLineString
polygonsPolygon / MultiPolygon

Automatic inference

  • When type is omitted, loadCollection() can infer vector layer types from geometry: Point and MultiPoint become points, LineString and MultiLineString become polylines, and Polygon and MultiPolygon become polygons.

  • Physical types such as roads, buildings, surface, parks, and water are not inferred automatically. If a collection mixes geometry families, pass type explicitly.

Raster layers

Raster layers represent gridded data such as temperature, density, or any other cell-based surface. In practice, autk-map renders a raster layer from a FeatureCollection whose cell values are stored in feature properties, together with a property path telling the renderer which band or attribute to read.

TypeDescription
rasterGrid-based data such as heatmaps or GeoTIFF-derived collections

Raster layers need a property path that tells the renderer which numeric value to use in each cell. The example below builds a heatmap raster from Manhattan noise events with autk-db and renders the result in autk-map. GeoTIFF files can also be loaded with autk-db. For now, autk-map renders raster collections returned by autk-db, including heatmaps created with buildHeatmap().

Released under the MIT License.