maup.intersections module
- maup.intersections.intersections(sources, targets, output_type='geoseries', area_cutoff=None)[source]
Computes all of the nonempty intersections between two sets of geometries. By default, the returned ~geopandas.GeoSeries will have a MultiIndex, where the geometry at index (i, j) is the intersection of
sources[i]andtargets[j](if it is not empty). If output_type == “geodataframe”, the return type is a range-indexed GeoDataFrame with “source” and “target” columns containing the indices i,j, respectively, for the intersection ofsources[i]andtargets[j]:param sources: geometries :type sources:GeoSeriesorGeoDataFrame:param targets: geometries :type targets:GeoSeriesorGeoDataFrame:rtype:GeoSeries:param area_cutoff: (optional) if provided, only return intersections witharea greater than
area_cutoff
- maup.intersections.prorate(relationship, data, weights, aggregate_by='sum')[source]
Prorate data from one set of geometries to another, using their ~maup.intersections or an assignment.
- Parameters:
relationship – the
intersections()of the geometries you are getting data from (sources) and the geometries you are moving the data to; or, a series assigning sources to targetsdata (
pandas.Seriesorpandas.DataFrame) – the data you want to move (must be indexed the same as the source geometries)weights (
pandas.Series) – the weights to use when prorating fromsourcestointersaggregate_by (function) – (optional) the function to use for aggregating from
interstotargets. The default is"sum".