istsoslib.responders package

Submodules

istsoslib.responders.DSresponse module

class istsoslib.responders.DSresponse.DescribeSensorResponse(filter, pgdb)

Responer for the DescribeSensor request

smlFile

sensorML of this sensor

procedureType

type of sensor

stime

str – start time of this sensor

etime

str – end time of this sensor

observedProperties

list – the list of observed properties of this sensor

Note

observedProperties is a list of rows as: [“def_opr”, “name_opr”, “desc_opr”, “constr_pro”, “name_uom”]

istsoslib.responders.GCresponse module

istsoslib.responders.GCresponse.BuildEventTimeRange(pgdb, sosConfig)

Generate observation time interval

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

eventime – a two element list with begin and end position of sensor observations

Return type:

list

istsoslib.responders.GCresponse.BuildOffEnvelope(pgdb, id, sosConfig)

Generate offering envelope

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

envel – gml representation of offering bounding box as gml:envelope

Return type:

str

istsoslib.responders.GCresponse.BuildOffFoiList(pgdb, id, sosConfig)

Generate the list of feture of interest for a given offering

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • id (int) – the offering id
  • sosCOnfig (obj) – the istsos configuration object
Returns:

fois – the list of feture of interest associated to the given offering id

Return type:

list

istsoslib.responders.GCresponse.BuildOffObsPrList(pgdb, id, sosConfig)

Generate the list of properties for a given offering

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • id (int) – the offering id
  • sosCOnfig (obj) – the istsos configuration object
Returns:

properties – the list of properties associated to the given offering id

Return type:

list

istsoslib.responders.GCresponse.BuildOffProcList(pgdb, id, sosConfig)

Generate the list of procedures for a given offering

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • id (int) – the offering id
  • sosCOnfig (obj) – the istsos configuration object
Returns:

procedures – the list of procedured belonging to the given offering id

Return type:

list

istsoslib.responders.GCresponse.BuildOffTimePeriod(pgdb, id, sosConfig)

Generate offering time interval

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • id (int) – the offering id
  • sosCOnfig (obj) – the istsos configuration object
Returns:

eventime – a two element list with begin and end position of the given offering id

Return type:

list

istsoslib.responders.GCresponse.BuildOfferingList(pgdb, sosConfig)

Generate the offering list

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

offeringList – the list of offering names

Return type:

list

istsoslib.responders.GCresponse.BuildSensorIdList(pgdb, sosConfig)

Generate the sensor list

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

sensorList – the list of sensor names

Return type:

list

istsoslib.responders.GCresponse.BuildSensorList(pgdb, sosConfig)

Generate the list of sensors

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

sensors – the list of sensors

Return type:

list

istsoslib.responders.GCresponse.BuildfeatureOfInterestList(pgdb, sosConfig)

Generate feature of interests

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

fois – a list of unique feature of interests

Return type:

list

istsoslib.responders.GCresponse.BuildobservedPropertyList(pgdb, sosConfig)

Generate observed properties

Parameters:
  • pgdb (obj) – the database object istsoslib.sosDatabase.PgDB
  • sosCOnfig (obj) – the istsos configuration object
Returns:

obsprop – a list of unique observed properties definitions

Return type:

list

class istsoslib.responders.GCresponse.GetCapabilitiesResponse(fil, pgdb)

The GetCapabilitiesResponse object

ServiceIdentifier

list – list of ServiceIdentifier objects (istsoslib.responders.GCresponse.ServiceIdentifier)

ServiceProvider

list – list of ServiceProvider objects (istsoslib.responders.GCresponse.ServiceProvider)

OperationsMetadata

list – list of OperationsMetadata objects (istsoslib.responders.GCresponse.OperationsMetadata)

ObservationOfferingList

list – list of ObservationOfferingList objects (istsoslib.responders.GCresponse.ObservationOfferingList)

.. note

: Attributes may vary depending of sections argument values

class istsoslib.responders.GCresponse.ObservationOfferingList(pgdb, sosConfig)

Observation offering list object

offerings

list – list of offerings objects (istsoslib.responders.GCresponse.Offering)

responseFormat

str – response format

resultModel

str – result model

responseMode

str – response mode

class istsoslib.responders.GCresponse.Offering

The Offering object

id

str – offering id

name

str – offering name

desc

str – offering description

boundedBy

str – offering bounding box

beginPosition

str – offering starting time of observation

endPosition

str – offering end time of observation

procedures

list – procedures list

obsProp

list – observed properties list

fois

list – feature of interest list

class istsoslib.responders.GCresponse.Operation(name, get='', post='')

Operation object

name

str – operation name

get

str – address for get request

post

str – address for post request

parameters

list – list of parameter objects istsoslib.responders.GCresponse.Parameter

addParameter(name, use='optional', allowedValues=, []range=[])
class istsoslib.responders.GCresponse.OperationsMetadata(pgdb, sosConfig)

The GetCapabilities Metadata section object

OP

list – list of offered requests

Note

Each request is a list of operation objects (istsoslib.responders.GCresponse.Operation) with specific parameters

srslist = None

GetCapabilities

class istsoslib.responders.GCresponse.Parameter(name, use='optional', allowedValues=, []range=[])

Parameter object

name

str – attribute name

use

str – attribute use

allowedValues

list – allowed values

range

list – ranges

class istsoslib.responders.GCresponse.ServiceIdentification(sosConfig)

Service identification of the GetCapabilities responseFormat

title

str – service name

abstract

str – service abstract

keywords

str – service keywords

serviceTypeCode

str – service type code

serviceTypeValue

str – service type value

serviceTypeVersion

str – service type version

fees

str – service fees

accessconstrains

str – service access constrains

class istsoslib.responders.GCresponse.ServiceProvider(sosConfig)

Service provider of the GetCapabilities responseFormat

providerName

str – provider name

providerSite

str – provider site

individualName

str – individual name

positionName

str – position name

contactVoice

str – contact voice number

contactFax

str – contact fax number

contactDelivery

str – contact delivery address

contactCity

str – contact city

contactArea

str – contact area

contactPostCode

str – contact post code

contactCountry

str – contact country

contactMail

str – contact email

istsoslib.responders.GFresponse module

class istsoslib.responders.GFresponse.foi(filter, pgdb)

The Feature of interest object

name

str – feature of interest name

type

str – feature of interest type

desc

str – description of the feature of interest

procedures

list – ordered list of procedures

idPrc

list – ordered list of procdures id

obsType

list – list of observation types

samplingTime

list – list of eventime elements, one (instant) or two (period)

properties

list – list of preperties

geom

str – the feature of interest geometry as GML

istsoslib.responders.GOresponse module

istsoslib.responders.GOresponse.BuildOfferingList(pgdb, sosConfig)
istsoslib.responders.GOresponse.BuildProcedureList(pgdb, offering, sosConfig)
istsoslib.responders.GOresponse.BuildfeatureOfInterestList(pgdb, offering, sosConfig)
istsoslib.responders.GOresponse.BuildobservedPropertyList(pgdb, offering, sosConfig)
class istsoslib.responders.GOresponse.Observation

The obsevation related to a single procedure

id_prc

str – the internal id of the selected procedure

name

str – the name of the procedure

procedure

str – the URI name of the procedure

procedureType

str – the type of procedure (one of “insitu-fixed-point”,”insitu-mobile-point”,”virtual”)

samplingTime

list – the time interval for which this procedure has data [from, to]

timeResVal

str – the time resolution setted for this procedure when registered in ISO 8601 duration

observedPropertyName

list – list of observed properties names as string

observedProperty

list – list of observed properties URI as string

uom

list – list of unit of measure associated with the observed properties according to list index

featureOfInterest

str – the feature of interest name

foi_urn

str – the feature of interest URI

foiGml

str – the GML representation of the feature of interest (in istSOS is only of type POINT)

srs

str – the epsg code

refsys

str – the URI of the reference system (srs)

x

float – the X coordinate

y

float – the Y coordinate

dataType

str – the URN used for timeSeries data type

timedef

str – URI of the time observed propertiy

data

list – the list of observations as list of values (it is basically a matrix with fields as columns and measurements as rows)

baseInfo(pgdb, o, sosConfig)

set base information of registered procedure

setData(pgdb, o, filter)

get data according to request filters

class istsoslib.responders.GOresponse.VirtualProcess

Virtual procedure object

filter

obj – the filter object

pgdb

obj – the database connection object

procedure

dict – representation of the procedure

observation

obj – observation object

samplingTime

tuple – sampling time bounds

addProcedure(name, observedProperty)

Add a procedure to the self.procedures[name] :param name: name of procedure :type name: str :param observedProperty: uri or uris of observed properties

applyFunction()

apply virtual procedure function

calculateObservations(observation)

Calculate the observations of the virtual procedure

execute()

This method must be overridden to implement data gathering for this virtual procedure

getData(procedure=None, disableAggregation=True)

Return the observations of associated procedure

Args: procedure (str): the procedure name

disableAggregation (bbol): apply aggregation (True) or not (False)
getSampligTime()

Extract sampling time of Virtual procedure

procedures = {}
samplingTime = (None, None)
setSampligTime()

By default This method calculate the sampling time of a virtual procedure giving the procedure name from witch the data are derived as single string or array of strings.

If derivation procedures are more than one it will return the minimum begin position and the maximum end position among all the procedures name given.

It supports also SamplingTime calculation from cascading Virtual Procedures.

class istsoslib.responders.GOresponse.VirtualProcessHQ

Bases: istsoslib.responders.GOresponse.VirtualProcess

execute()

execute method

setDischargeCurves()

method for setting h-q tranformation tables/curves

istsoslib.responders.GOresponse.applyFunction(ob, filter)

apply H-Q function

class istsoslib.responders.GOresponse.observations(filter, pgdb)

The class that contain all the observations related to all the procedures

offInfo

obj – the general information about offering name, connection object, and configuration options

refsys

str – the uri that refers to the EPSG refrence system

filter

obj – the filter object that contains all the parameters setting of the GetObservation request

period

list – a list of two values in datetime: the minimum and maximum instants of the requested time filters

reqTZ

obj – the timezone in pytz.tzinfo

obs

list – list of Observation objects

filter = None

off_list = BuildOfferingList(pgdb,filter.sosConfig) if not filter.offering in off_list:

raise sosException.SOSException(“InvalidParameterValue”,”offering”,”Parameter “offering” sent with invalid value: %s - available options for offering are %s” %(filter.offering,off_list))
class istsoslib.responders.GOresponse.offInfo(off_name, pgdb, sosConfig)

istsoslib.responders.IOresponse module

class istsoslib.responders.IOresponse.InsertObservationResponse(filter, pgdb)
procConstr = None

**oprNames= [“urn* – ogc* – def:parameter:x-istsos:1.0:meteo:air:temperature” , ...] oprUoms= [“mm” , ...] oprIds= [id_opr , ...] proIds= [id_pro , ...] obsPropConstr= [{“interval”: [“-40”, “50”], “role”: “urn:ogc:def:classifiers:x-istsos:1.0:qualityIndex:check:acceptable”} , ...] procConstr= [{“max”: “100”, “role”: “urn:ogc:def:classifiers:x-istsos:1.0:qualityIndex:check:reasonable”} , ...]

istsoslib.responders.RSresponse module

class istsoslib.responders.RSresponse.RegisterSensorResponse(filter, pgdb)

istsoslib.responders.USDresponse module

class istsoslib.responders.USDresponse.UpdateSensorDescriptionResponse(filter, pgdb)
istsoslib.responders.USDresponse.get_name_from_urn(stringa, urnName, sosConfig)

istsoslib.responders.factory_response module

istsoslib.responders.factory_response.sosFactoryResponse(sosFilter, pgdb)

Module contents