예제 #1
0
try:
    from .gdal_exceptions_handler import GdalErrorHandler
    from .geo_infos_generic import GeoInfosGenericReader
    from .geoutils import Utils
except ValueError:
    from gdal_exceptions_handler import GdalErrorHandler
    from geo_infos_generic import GeoInfosGenericReader
    from geoutils import Utils

# ############################################################################
# ######### Globals ############
# ##############################

gdal_err = GdalErrorHandler()
georeader = GeoInfosGenericReader()
youtils = Utils()

# ############################################################################
# ######### Classes #############
# ###############################


class ReadGXT:
    def __init__(self, layerpath, dico_layer, tipo, txt=""):
        """Uses OGR functions to extract basic informations about
        geographic vector file (handles shapefile or MapInfo tables)
        and store into dictionaries.

        layerpath = path to the geographic file
        dico_layer = dictionary for global informations
        dico_fields = dictionary for the fields' informations
예제 #2
0
    from .gdal_exceptions_handler import GdalErrorHandler
    from .geo_infos_generic import GeoInfosGenericReader
    from .geoutils import Utils
except ImportError:
    from gdal_exceptions_handler import GdalErrorHandler
    from geo_infos_generic import GeoInfosGenericReader
    from geoutils import Utils

# ############################################################################
# ######### Globals ############
# ##############################

gdal_err = GdalErrorHandler()
georeader = GeoInfosGenericReader()
logger = logging.getLogger(__name__)
youtils = Utils("flat")

# ############################################################################
# ######### Classes #############
# ###############################


class ReadVectorFlatDataset:
    def __init__(self):
        """Class constructor."""
        # handling ogr specific exceptions
        errhandler = gdal_err.handler
        gdal.PushErrorHandler(errhandler)
        gdal.UseExceptions()
        ogr.UseExceptions()
        self.alert = 0
예제 #3
0
from time import localtime, strftime
from xml.etree import ElementTree
import xmltodict

# custom submodules
try:
    from .geoutils import Utils
except ValueError:
    from geoutils import Utils

# ############################################################################
# ######### Globals ############
# ##############################

logger = logging.getLogger("DicoGIS")
youtils = Utils(ds_type="flat")

# ############################################################################
# ######### Classes #############
# ###############################


class ReadQGS():
    """QGIS projects files (*.qgs) independant reader."""
    def __init__(self, src_path, dico_qgs, tipo, txt=''):
        u"""Parse QGS files which are XML based files.

        qgspath = path to the qgs file
        dico_qgs = dictionary for global informations
        tipo = format
        text = dictionary of text in the selected language
예제 #4
0
try:
    from .gdal_exceptions_handler import GdalErrorHandler
    from .geo_infos_generic import GeoInfosGenericReader
    from .geoutils import Utils
except ValueError:
    from gdal_exceptions_handler import GdalErrorHandler
    from geo_infos_generic import GeoInfosGenericReader
    from geoutils import Utils

# ############################################################################
# ######### Globals ############
# ##############################

gdal_err = GdalErrorHandler()
georeader = GeoInfosGenericReader()
youtils = Utils(ds_type="postgis")
logger = logging.getLogger(__name__)

# ############################################################################
# ######### Classes #############
# #################################


class ReadPostGIS:
    def __init__(
            self,
            host="localhost",
            port=5432,
            db_name="postgis",
            user="******",
            password="******",