Ejemplo n.º 1
0
Archivo: iso.py Proyecto: Roel/OWSLib
    def __init__(self, fcd=None):
        if fcd is None:
            self.xml = None
            self.compliancecode = None
            self.language = []
            self.includedwithdataset = None
            self.featuretypenames = []
            self.featurecatalogues = []
        else:
            if hasattr(fcd, 'getroot'):  # standalone document
                self.xml = etree.tostring(fcd.getroot())
            else:  # part of a larger document
                self.xml = etree.tostring(fcd)

            self.compliancecode = None
            val = fcd.find(util.nspath_eval('gmd:complianceCode/gco:Boolean', namespaces))
            val = util.testXMLValue(val)
            if val is not None:
                self.compliancecode = util.getTypedValue('boolean', val)

            self.language = []
            for i in fcd.findall(util.nspath_eval('gmd:language/gco:CharacterString', namespaces)):
                val = util.testXMLValue(i)
                if val is not None:
                    self.language.append(val)

            self.includedwithdataset = None
            val = fcd.find(util.nspath_eval('gmd:includedWithDataset/gco:Boolean', namespaces))
            val = util.testXMLValue(val)
            if val is not None:
                self.includedwithdataset = util.getTypedValue('boolean', val)

            self.featuretypenames = []
            for i in fcd.findall(util.nspath_eval('gmd:featureTypes/gco:LocalName', namespaces)):
                val = util.testXMLValue(i)
                if val is not None:
                    self.featuretypenames.append(val)
            for i in fcd.findall(util.nspath_eval('gmd:featureTypes/gco:ScopedName', namespaces)):
                val = util.testXMLValue(i)
                if val is not None:
                    self.featuretypenames.append(val)

            self.featurecatalogues = []
            for i in fcd.findall(util.nspath_eval('gmd:featureCatalogueCitation', namespaces)):
                val = i.attrib.get('uuidref')
                val = util.testXMLValue(val, attrib=True)
                if val is not None:
                    self.featurecatalogues.append(val)
Ejemplo n.º 2
0
 def isValid():
   owslib_exists = True
   try:
       import owslib
       version = owslib.__version__
       major = int(version.split('.')[0])
       minor = int(version.split('.')[1])
       if major == 0 and minor < 22:
           owslib_exists = False
       from owslib.wps import WebProcessingService
       from owslib.wps import ComplexDataInput
       from owslib.util import getTypedValue
       val = getTypedValue('integer', None)
   except:
       owslib_exists = False
   return owslib_exists
Ejemplo n.º 3
0
Archivo: iso.py Proyecto: Roel/OWSLib
    def __init__(self, ft=None):
        if ft is None:
            self.xml = None
            self.identifier = None
            self.typename = None
            self.definition = None
            self.isabstract = None
            self.aliases = []
            self.attributes = []
        else:
            if hasattr(ft, 'getroot'):  # standalone document
                self.xml = etree.tostring(ft.getroot())
            else:  # part of a larger document
                self.xml = etree.tostring(ft)

            val = ft.attrib['uuid']
            self.identifier = util.testXMLValue(val, attrib=True)

            val = ft.find(util.nspath_eval('gfc:typeName/gco:LocalName', namespaces))
            self.typename = util.testXMLValue(val)

            val = ft.find(util.nspath_eval('gfc:definition/gco:CharacterString', namespaces))
            self.definition = util.testXMLValue(val)

            self.isabstract = None
            val = ft.find(util.nspath_eval('gfc:isAbstract/gco:Boolean', namespaces))
            val = util.testXMLValue(val)
            if val is not None:
                self.isabstract = util.getTypedValue('boolean', val)

            self.aliases = []
            for i in ft.findall(util.nspath_eval('gfc:aliases/gco:LocalName', namespaces)):
                self.aliases.append(util.testXMLValue(i))

            self.attributes = []
            for i in ft.findall(util.nspath_eval('gfc:carrierOfCharacteristics/gfc:FC_FeatureAttribute', namespaces)):
                self.attributes.append(FC_FeatureAttribute(i))
Ejemplo n.º 4
0
 def check_owslib_fix(self):
     try:
         val = getTypedValue('integer', None)
         return True
     except:
         return False
Ejemplo n.º 5
0
from qgis.PyQt.QtCore import QThread, pyqtSignal

owslib_exists = True
try:
    from owslib.wps import WebProcessingService
    from owslib.wps import ComplexDataInput
    from owslib.util import getTypedValue
    val = getTypedValue('integer', None)
except:
    owslib_exists = False


class Response():
    status = 200
    data = []
    filepath = None


# TODO create superclass for these classes
class GetProcesses(QThread):
    statusChanged = pyqtSignal(object)
    url = None
    timeout = 5

    def setUrl(self, url):
        self.url = url

    def setTimeout(self, timeout):
        self.timeout = timeout

    def run(self):