tobler.area_weighted.area_tables_raster¶
-
tobler.area_weighted.
area_tables_raster
(source_df, target_df, raster_path, codes=[21, 22, 23, 24], force_crs_match=True)[source]¶ Construct area allocation and source-target correspondence tables according to a raster ‘populated’ areas
- Parameters
- source_df
geopandas.GeoDataFrame
geeodataframe with geometry column of polygon type
- target_df
geopandas.GeoDataFrame
geodataframe with geometry column of polygon type
- raster_path
str
the path to the associated raster image.
- codes
list
list of integer code values that should be considered as ‘populated’. Since this draw inspiration using the National Land Cover Database (NLCD), the default is 21 (Developed, Open Space), 22 (Developed, Low Intensity), 23 (Developed, Medium Intensity) and 24 (Developed, High Intensity). The description of each code can be found here: https://www.mrlc.gov/sites/default/files/metadata/landcover.html Only taken into consideration for harmonization raster based.
- force_crs_matchbool (default
is
True
) Whether the Coordinate Reference System (CRS) of the polygon will be reprojected to the CRS of the raster file. It is recommended to let this argument as True.
- source_df
- Returns
- tables:
tuple
(optional) two 2-D numpy arrays SU: area of intersection of source geometry i with union geometry j UT: binary mapping of union geometry j to target geometry t
- tables:
Notes
The assumption is both dataframes have the same coordinate reference system.
Union geometry is a geometry formed by the intersection of a source geometry and a target geometry
SU Maps source geometry to union geometry, UT maps union geometry to target geometry