dicogis.georeaders.base_georeader module¶
- class dicogis.georeaders.base_georeader.GeoReaderBase(dataset_type, localized_strings=None)¶
Bases:
object
Base class for geographic dataset readers.
- __init__(dataset_type, localized_strings=None)¶
Initialization.
- calc_size_full_dataset(source_path, dependencies=None)¶
Calculate size of dataset and its dependencies.
- erratum(target_container, src_path=None, src_dataset_layer=None, err_type=1, err_msg='')¶
Store error messages in container object.
- Parameters:
target_container (Union[dict, MetaDataset]) – object where to store error message and type
src_path (Optional[str], optional) – source path. Defaults to None.
src_dataset_layer (Optional[ogr.Layer], optional) – source dataset layer. Defaults to None.
err_type (int, optional) – _description_. Defaults to 1.
err_msg (str, optional) – _description_. Defaults to “”.
- get_extent_as_tuple(dataset_or_layer)¶
Get spatial extent (bounding box).
- get_fields_details(ogr_layer_definition)¶
Get feature attributes from layer definition.
- Return type:
- get_geometry_type(layer)¶
Get geometry type for a given ogr layer.
- get_srs_details(dataset_or_layer)¶
Get coordinates system name, type and registry code.
- get_srs_name(object_spatial_reference)¶
Get SRS name from an osr object.
- Parameters:
object_spatial_reference (
SpatialReference
) – osr object. Typically obtained with ogr.Layer.GetSpatialReference()- Return type:
- Returns:
name of spatial reference
- get_srs_type(object_spatial_reference)¶
Get SRS type from an osr object.
- Parameters:
object_spatial_reference (
SpatialReference
) – osr object. Typically obtained with ogr.Layer.GetSpatialReference()- Return type:
- Returns:
type of spatial reference
- list_dependencies(main_dataset)¶
List dependant files around a main file.