dicogis.georeaders.process_files module

class dicogis.georeaders.process_files.DatasetToProcess(file_path, file_format, georeader, processed=False, process_error=None, exported=False, export_error=None)

Bases: object

Model of a geofile to process.

__init__(file_path, file_format, georeader, processed=False, process_error=None, exported=False, export_error=None)
export_error: Optional[str] = None
exported: bool = False
file_format: str
file_path: Path
georeader: object
process_error: Optional[str] = None
processed: bool = False
class dicogis.georeaders.process_files.ProcessingFiles(serializer, localized_strings, li_cdao, li_dxf, li_flat_geodatabase_esri_filegdb, li_flat_geodatabase_geopackage, li_flat_geodatabase_spatialite, li_geojson, li_geotiff, li_gxt, li_gml, li_kml, li_mapinfo_tab, li_shapefiles, li_vectors, li_rasters, li_file_databases, opt_analyze_esri_filegdb=True, opt_analyze_geojson=True, opt_analyze_geopackage=True, opt_analyze_geotiff=True, opt_analyze_gml=True, opt_analyze_gxt=True, opt_analyze_kml=True, opt_analyze_mapinfo_tab=True, opt_analyze_raster=True, opt_analyze_cdao=True, opt_analyze_shapefiles=True, opt_analyze_spatialite=True, progress_message_displayer=None, progress_counter=None, progress_callback_cmd=None, opt_quick_fail=False)

Bases: object

Geofiles processor.

MATRIX_FORMAT_GEOREADER = {'dxf': <class 'dicogis.georeaders.read_dxf.ReadCadDxf'>, 'esri_shapefile': <class 'dicogis.georeaders.read_vector_flat_dataset.ReadVectorFlatDataset'>, 'file_geodatabase_esri': <class 'dicogis.georeaders.read_vector_flat_geodatabase.ReadFlatDatabase'>, 'file_geodatabase_geopackage': <class 'dicogis.georeaders.read_vector_flat_geodatabase.ReadFlatDatabase'>, 'file_geodatabase_spatialite': <class 'dicogis.georeaders.read_vector_flat_geodatabase.ReadFlatDatabase'>, 'geojson': <class 'dicogis.georeaders.read_vector_flat_dataset.ReadVectorFlatDataset'>, 'geotiff': <class 'dicogis.georeaders.read_raster.ReadRasters'>, 'gml': <class 'dicogis.georeaders.read_vector_flat_dataset.ReadVectorFlatDataset'>, 'gxt': <class 'dicogis.georeaders.read_vector_flat_dataset.ReadVectorFlatDataset'>, 'kml': <class 'dicogis.georeaders.read_vector_flat_dataset.ReadVectorFlatDataset'>, 'mapinfo_tab': <class 'dicogis.georeaders.read_vector_flat_dataset.ReadVectorFlatDataset'>, 'raster': <class 'dicogis.georeaders.read_raster.ReadRasters'>}
__init__(serializer, localized_strings, li_cdao, li_dxf, li_flat_geodatabase_esri_filegdb, li_flat_geodatabase_geopackage, li_flat_geodatabase_spatialite, li_geojson, li_geotiff, li_gxt, li_gml, li_kml, li_mapinfo_tab, li_shapefiles, li_vectors, li_rasters, li_file_databases, opt_analyze_esri_filegdb=True, opt_analyze_geojson=True, opt_analyze_geopackage=True, opt_analyze_geotiff=True, opt_analyze_gml=True, opt_analyze_gxt=True, opt_analyze_kml=True, opt_analyze_mapinfo_tab=True, opt_analyze_raster=True, opt_analyze_cdao=True, opt_analyze_shapefiles=True, opt_analyze_spatialite=True, progress_message_displayer=None, progress_counter=None, progress_callback_cmd=None, opt_quick_fail=False)
add_files_to_process_queue(list_of_datasets, dataset_format)

Add dataset to the processing queue.

Parameters:
  • list_of_datasets (list) – list of datasets where to register the dataets

  • dataset_format (str) – _description_

Return type:

list[DatasetToProcess]

Returns:

list of files to process

count_files_to_process()

Count number of files to process.

Return type:

int

Returns:

total of files to process

export_metadataset(dataset_to_process, metadataset_to_serialize)

Serialize metadataset in a generic way.

Parameters:
  • dataset_to_process (DatasetToProcess) – dataset to process used to store status

  • metadataset_to_serialize (MetaDataset) – metadataset to serialize

Return type:

tuple[DatasetToProcess, MetaDataset | None]

Returns:

dataset to process, metadataset or None if something went wrong

process_datasets_in_queue()

Process datasets in queue.

read_dataset(dataset_to_process)

Read dataset and store into metadataset.

Parameters:

dataset_to_process (DatasetToProcess) – dataset path or URI to read

Return type:

tuple[DatasetToProcess, MetaDataset | None]

Returns:

dataset and metadataset, None if an error occurs

update_progress(message_to_display=None, increment_counter=False)

Helper method to update progress bar/status/counter.

Parameters:
  • message_to_display (Optional[str]) – message to display. Defaults to None.

  • increment_counter (bool) – option to increment progress counter. Defaults to False.