import random from owslib.etree import etree from owslib import fes from owslib.util import nspath_eval, xml2string, testXMLValue, http_post, setrootelement from owslib import ows from owslib.iso import MD_Metadata from owslib.fgdc import Metadata from owslib.dif import DIF from owslib.namespaces import OWSLibNamespaces # default variables outputformat = 'application/xml' schema = 'http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd' ns = OWSLibNamespaces() schema_location = '%s %s' % (ns.get_namespace('csw'), schema) _ows_version = '1.0.0' def nsp_ows(item): return nspath_eval(item,_ows_version) def nsp(item): return nspath_eval(item) class CatalogueServiceWeb: """ csw request class """ def __init__(self, url, lang='en-US', version='2.0.2', timeout=10, skip_caps=False): """
from pyoos.utils.etree import etree from owslib.namespaces import OWSLibNamespaces from owslib.util import testXMLValue, testXMLAttribute, extract_time from owslib.util import nspath as nsp from owslib.util import nspath_eval as nspv from owslib.crs import Crs from pyoos.parsers.swe.swe_timeseries import SweTimeSeries from shapely.geometry import box ns = OWSLibNamespaces() class IoosSwe(object): def __init__(self, element): if isinstance(element, str): self._root = etree.fromstring(element) else: self._root = element if hasattr(self._root, 'getroot'): self._root = self._root.getroot() # Get individual om:Observations self.observations = {} for ob in self._root.findall( nsp("member/Observation", ns.get_versioned_namespace('om', '1.0'))): ob_ele = OmObservation(ob) self.observations[ob_ele.name] = ob_ele
import cgi import pytz from owslib.etree import etree from datetime import datetime from urllib import urlencode from owslib import ows from owslib.crs import Crs from owslib.filter import FilterCapabilities from owslib.util import openURL, testXMLValue, testXMLAttribute, nspath_eval, nspath, extract_time from owslib.namespaces import OWSLibNamespaces def nsp(text): return nspath_eval(text) ns = OWSLibNamespaces() _ows_namespace = ns.get_versioned_namespace('ows','1.1.0') def nsp_ows(text, namespace=None): if namespace is None: namespace = _ows_namespace return nspath(text, namespace) class SensorObservationService(object): """ Abstraction for OGC Sensor Observation Service (SOS). Implements ISensorObservationService. """ def __getitem__(self,id):