gemgis.raster.read_asc
gemgis.raster.read_asc#
- gemgis.raster.read_asc(path: Union[str, pathlib.Path]) dict #
Function to read GoCAD .asc files
- Parameters
path (Union[str, Path]) – Path to asc file, e.g.
path='raster.asc'
- Returns
data – Dict containing the array data, the extent, resolution and nodata_val of the raster
- Return type
dict
New in version 1.0.x.
Example
>>> # Loading Libraries and Files >>> import gemgis as gg >>> data = gg.raster.read_asc('raster.asc')
>>> # Inspecting the content of the dict, here we only see the nodata_vals for now >>> data['Data'] array([[-99999., -99999., -99999., ..., -99999., -99999., -99999.], [-99999., -99999., -99999., ..., -99999., -99999., -99999.], [-99999., -99999., -99999., ..., -99999., -99999., -99999.], ..., [-99999., -99999., -99999., ..., -99999., -99999., -99999.], [-99999., -99999., -99999., ..., -99999., -99999., -99999.], [-99999., -99999., -99999., ..., -99999., -99999., -99999.]])
>>> data['Extent'] [-42250, 306000, 279000, 867000]
>>> data['Resolution'] 250
>>> data['Nodata_val'] -99999