istsoslib.filters package

Submodules

istsoslib.filters.DS_filter module

class istsoslib.filters.DS_filter.sosDSfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for a DescribeSensor request

This is an extension of the base filter class (sosFilter) to accept DescribeSensor request and add specific parameters

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

outputFormat

str – the outputFormat

procedure

str – the name of the procedure to be described

istsoslib.filters.GC_filter module

class istsoslib.filters.GC_filter.sosGCfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for a GetCapabalities request

This is an extension of the base filter class (sosFilter) to accept GetCapabilities request and add specific parameters

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

sections

list – the requested sections names, if not provided the default value is [“all”]

istsoslib.filters.GF_filter module

class istsoslib.filters.GF_filter.sosGFfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for a GetFeatureOfInterest request

This is an extension of the base filter class (sosFilter) to accept GetFeatureOfInterest request and add specific parameters

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

featureOfInterest

str – the FeatureOfInterestId

srsName

str – the desired EPSG code of results, if missing the default istSOS reference system is used

istsoslib.filters.GO_filter module

class istsoslib.filters.GO_filter.sosGOfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for a GetObservations request

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

sosConfig

obj – the configuration preference of istSOS instance

offering

str – the requeste offering name

observedProperty

list – the list of observed properties names as string

responseFormat

str – the name of the desired output format

srsName

str – the EPSG code of the desired reference system

eventTime

list – list of time intervals (list of two isodate) and/or time instants (list of one isodate), for example: [ [2014-10-11T12:00:00+02:00, 2014-11-11T12:00:00+02:00], [2014-13-11T12:00:00+02:00] ]

procedure

list – list of procedure names as string

featureOfInterest

list – list of feature of interest names as string

featureOfInterestSpatial

str – the SQL WHERE clause to apply the OGC filter expression in XML format specified in the request

result

str – the SQL WHERE clause to apply the OGC property operator in XML format specified in the request

resultModel

str – the model to represent the result (om:Observation)

responseMode

str – the response mode (inline)

aggregate_interval

str – the aggregation interval in ISO 8601 duration

aggregate_function

str – the function to use for aggregation (one of: “AVG”,”COUNT”,”MAX”,”MIN”,”SUM”)

aggregate_nodata_qi

str – the quality index value to use for representing no data in aggregated time serie

qualityIndex

bool – if the quality index shall be returned (True) or not (False)

qualityFilter

str – CQL-like filter on quality index (>200 returns all the records with all QI greater then 200)

istsoslib.filters.IO_filter module

class istsoslib.filters.IO_filter.sosIOfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for a InsertObservation request

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

assignedSensorId

str – the requested sensor id

forceInsert

bool – if True overrides existing observations falling in the interval

procedure

str – the name of the procedure

oprName

list – the names of thr observed properties

samplingTime

str – the time period of the observations to be inserted

foiName

str – the name of the feature of featureOfInterest

parameters

list – the ordered list of unit of the parameters

uom

list – the ordered list of unit of minutes associated with the parameters

data

dict – a dictionary of parameter’s dictionaries with unit of minutes and values, e.g.:

data = {
            "urn:ist:parameter:time:iso8601":
                {
                    "uom":"sec",
                    "vals":["2009-07-31T12:00:00+02:00","2009-07-31T12:10:00+02:00","2009-07-31T12:20:00+02:00"]
                },
            "urn:ist:def:phenomenon:rainfall":
                {
                    "uom":"mm",
                    "vals":[0.1,0.2,0.3,0.4]
                }
        }

istsoslib.filters.RS_filter module

class istsoslib.filters.RS_filter.sosRSfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for a registerSensor request

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

procedure

str – the procedure name

time_sam_val

int – the sampling time resolution

time_acq_val

int – the acquisition taime resolution

systemType

str – the system type

xmlSensorDescription

obj – the sensor description etree’s element

oprDef

list – ordered list of observed properties definition

oprDesc

list – ordered list of observed properties description

oprName

list – ordered list of observed properties name

foiName

str – feature of interest name

foiType

str – feature of interest geometry type

foiSRS

str – feature of interest EPSG code

foiGML

str – feature of interest GML representation

parameters

list – ordered list of parameters observed by the sensor

uoms

list – ordered list of unit of measures (indexed as parameters)

names

list – ordered list of parameters’s names (indexed as parameters)

descs

list – ordered list of parameters’s description (indexed as parameters)

constr

list – ordered list of parameters’s constraints (indexed as parameters)

partime

list – ordered list 0-1 values identifing the time parameter (1) or not (0) (indexed as parameters)

beginPosition

str – set to NULL (TODO: CHECK IF REQUIRED!)

xmlSensorDescription = None

from xml.dom.minidom import parseString txt = et.tostring(root, encoding=”UTF-8”) self.xmlSensorDescription = parseString(txt).toprettyxml()

istsoslib.filters.USD_filter module

class istsoslib.filters.USD_filter.sosUSDfilter(sosRequest, method, requestObject, sosConfig)

Bases: istsoslib.filters.filter.sosFilter

filter object for an updateSensorDescription request

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

assignedSensorId

str – the assigned sensor ID

xmlSensorDescription

str – the XML representation of the senor description

istsoslib.filters.factory_filters module

istsoslib.filters.factory_filters.sosFactoryFilter(environ, sosConfig)

Instantiate the correct filter type depending on requests

Parameters:
  • environ (obj) – the mod_wsgi environment object
  • sosCOnfig (obj) – the service configuration
Returns:

filter – the filter subclass which meet the request

Return type:

obj

Raises:

Exception if missing or invalid parameters are used in the request

istsoslib.filters.filter module

class istsoslib.filters.filter.sosFilter(sosRequest, method, requestObject, sosConfig)

SOS request base filters

Intercept the request and extract user inputs preferences

request

str – the request submitted

service

str – the name of the service requested

version

str – the version of the service

istsoslib.filters.filter_utils module

istsoslib.filters.filter_utils.getElemAtt(node, att)

Return the attribute of an XML node element

Parameters:
  • node – the etree node element
  • att – the attribute name
Returns:

The string of the attribute value

Raises:

Exception – node has not attribute

istsoslib.filters.filter_utils.getElemTxt(node)

Return the text value of an XML node

Parameters:node – the etree node element
Returns:The string of the node value
Raises:Exception – node has no child node or is not of type TEXT
istsoslib.filters.filter_utils.get_name_from_urn(stringa, urnName, sosConfig)

Validate the URN and extract the name (last elment)

Parameters:
  • stringa – URN type
  • urnName – URN
  • sosConfig – istSOS configuration object
Returns:

The name of the URN element

Raises:

Exception – Urn is not valid

istsoslib.filters.filter_utils.parse_and_get_ns(file)

Module contents