alproj.surface module
- alproj.surface.get_colored_surface(aerial, dsm, shooting_point, distance=2000, res=1.0, resampling=rasterio.enums.Resampling.cubic_spline, fill_dsm_dist=300, color_max=None)[source]
Get colored surface.
- Parameters:
aerial (rasterio.DatasetReader) – An aerial photograph opend by rasterio.open(), should be in a CRS that has units of meters. Supports uint8, uint16, and float32 dtypes (normalization is automatic).
dsm (rasterio.DatasetReader) – A Digital SurfaceModel opend by rasterio.open(), should be in the same CRS as the aerial.
shooting_point (dict) – Shooting point. Must contain keys “x” and “y”. Should be in the same coordinate reference system as the DSM.
distance (float default 2000) – Distance from shooting point to the edge of the rectangle.
res (float default 1.0) – Resolution of the output raster in m.
resampling (rasterio.enums.Resampling default Resampling.cubic_spline) – Resampling method. See https://rasterio.readthedocs.io/en/latest/api/rasterio.enums.html#rasterio.enums.Resampling
fill_dsm_dist (float default 300) – Distance in m for filling nodata in DSM.
color_max (float or None default None) – Explicit maximum color value for normalization. If None, determined automatically from the aerial dtype.
- Returns:
vert (numpy.ndarray) – Vertex coordinates.
col (numpy.ndarray) – Vertex color.
ind (numpy.ndarray) – Index for each triangle.
offset (numpy.ndarray) – Offset for vertex coordinates. You need to add this to vert to get the correct coordinates.