overlay_weights

overlay_weights(source, target, id_col='geo_id')

Area of every source-target intersection, in an equal-area projection.

Parameters

Name Type Description Default
source Scale ids, or GeoDataFrames with id_col and polygons required
target Scale ids, or GeoDataFrames with id_col and polygons required
id_col str The id column of GeoDataFrame inputs 'geo_id'

Returns

Name Type Description
pandas.DataFrame Columns geo_id_from, geo_id_to, area_km2, share_of_from (the part of the source unit inside the target) and share_of_to.

Example

!pip install -q geo4bolivia
import geo4bolivia as geo
import plotly.express as px

w = geo.overlay_weights("municipality", "department")
px.histogram(w, x="share_of_from", log_y=True,
             title="Share of each municipality inside each department")