Skip to content
pyautark (soon)

Thematic data

Thematic data rendering maps a feature attribute to color. The attribute does not have to live on the feature itself: autk-map treats any value reachable through a property path on the FeatureCollection as thematic input. That value can be an intrinsic attribute of the geometry, but it can also be urban data that has been projected onto the feature, for example:

  • sensor readings, survey responses, or point-of-interest categories joined to the nearest building, road, or neighborhood;
  • aggregates from a second table, such as the count of noise events within a buffer of each polygon, computed in autk-db with spatialQuery;
  • pre-computed fields added to the source GeoJSON, such as a grouped highway class, so the renderer can read a stable categorical value directly.

In autk-map, the usual workflow is:

  1. Load the layer with loadCollection().
  2. Configure the color map with updateColorMap().
  3. Point to the source property with updateThematic().
  4. Enable thematic display with isColorMap in updateRenderInfo().

autk-core provides the ColorMapInterpolator and ColorMapDomainStrategy enums used to pick a palette and a value-to-color domain.

PartDescription
interpolatorA color scheme from ColorMapInterpolator (categorical, sequential, or diverging).
domainSpecHow the renderer maps raw values to colors (AUTO, MIN_MAX, PERCENTILE, or USER).
propertyDot-path to the feature property that supplies the value or class. It can reach an intrinsic attribute or any urban data joined into the feature.

Categorical attributes

Categorical palettes assign one color per class. Use them for class labels such as road types. In practice, it helps to first fold the raw values into a small, ordered set of groups so the palette domain stays stable.

The USER domain lists the exact classes to encode, in the order they should appear in the legend. Anything outside the list falls back to the last color.

Diverging attributes

Diverging palettes suit signed or centered quantities, or any attribute where a meaningful midpoint separates two regimes. The PERCENTILE domain trims outliers so most of the distribution maps to a clear range of colors.

Spatial joins

Spatial joins attach an aggregate from a second table to each feature of a base layer. A common use is counting point events (for example, noise complaints) inside a buffer around each polygon or line.

The example below joins the Manhattan noise event table to OSM buildings in the Battery Park City / Financial District area, counting events within 1000 m of each building. The result is stored as a new property path properties.sjoin.count.noise that autk-map can read directly.

The same pattern works for linear features. The next example joins the same noise table to OSM roads in the same area, again using a 1000 m buffer.

Data alignment

Thematic values are matched back to rendered components using feature ids when available, with a fallback to feature order. For reliable updates, keep stable feature.id values or preserve collection ordering across calls to updateThematic().

See AutkMap.updateThematic() and AutkMap.updateColorMap().

Released under the MIT License.