Data To Raster¶
Command
¶
Bases: BaseCommand
Source code in back/iarbre_data/management/commands/data_to_raster.py
rasterize_data_across_all_cities(factor_name, height, width, height_out, width_out, transform, transform_out, all_cities_union, grid_size=5, output_dir=None)
¶
Convert Data polygons to a single binary raster across all cities to avoid border effects.
This function rasterizes the geometries of a specified factor across all cities, applies a convolution to aggregate the raster values into larger blocks, and saves the resulting raster to a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
factor_name | str | Name of the factor to transform to raster. | required |
height | int | Height of the output raster. | required |
width | int | Width of the output raster. | required |
height_out | int | Height of the output raster after convolution. | required |
width_out | int | Width of the output raster after convolution. | required |
transform | Affine | Affine transformation for the factor transformation. | required |
transform_out | Affine | Affine transformation for the raster output. | required |
all_cities_union | GEOSGeometry | GEOSGeometry containing the union of all city geometries. | required |
grid_size | int | Size of the convolution kernel. Defaults to 5. | 5 |
output_dir | str | Directory to save the raster file. Defaults to None. | None |
Returns:
Type | Description |
---|---|
None | None |