Skip to content

UrbanAccessAnalyzer.plotting

Interactive Folium/ipyleaflet mapping for AOIs, POIs, and result layers.

Accepts the package's Polars-native output shapes directly: an H3 table (Polars DataFrame with an h3_cell column, converted via :func:UrbanAccessAnalyzer.h3_ops.to_gdf) or a street-edge table (Polars DataFrame with a WKB geometry column, e.g. from :mod:UrbanAccessAnalyzer.isochrones), alongside plain GeoDataFrames -- this is the plotting-time conversion point back to geopandas, consistent with the rest of the package treating geopandas as an I/O/display boundary rather than an internal representation.

popup_js(labels, decimals=1, categories=None)

JS function (for MapLayer.popup_js) showing a small table with readable labels.

Parameters:

Name Type Description Default
labels dict

{column: label}, in display order, e.g. {"population": "Population", "access_score": "Walkability (0-100)"}.

required
decimals int

Decimals for non-integer numbers.

1
categories Optional[dict]

Optional {column: [label1, label2, ...]} to show a rounded numeric value k as label_k (1-based), e.g. a mode rank as a name.

None

ipyleaflet_drawable_map(m=None, center=[0, 0], zoom=11, height='800px')

Creates an interactive ipyleaflet map with drawing controls.

Returns:

Type Description
  • m: ipyleaflet map
  • get_drawn_geometries(): returns GeoDataFrame

Parameters:

Name Type Description Default
m

Existing ipyleaflet map; None creates one.

None
center

[lat, lon] of the initial view.

[0, 0]
zoom

Initial zoom.

11
height

CSS height of the map.

'800px'