istsoslib package

Submodules

istsoslib.sosDatabase module

class istsoslib.sosDatabase.Database

Connect to a database

closeConnection()

Close a database connection

dbName = None
getConnection()

Return a database connection

host = None
password = None
port = None
user = None
class istsoslib.sosDatabase.PgDB(user, password, dbName, host='localhost', port='5432', tz=None)

Bases: istsoslib.sosDatabase.Database

Connect to a PostgreSQL database

commitTransaction()

Commit current transaction

execute(sql, par=None)

Execute an sql statement

executeInTransaction(sql, par=None)

Execute an sql statement in an open session

host = None
insertMany(sql, dict)

Insert many values at once

insertManyInTransaction(sql, dict)

Insert many values at once

mogrify(sql, par=None)

Mogrify an sql statement (print the actual sql query that will be executed)

rollbackTransaction()

Rollback current transaction

select(sql, par=None)

Execute a select statement

setTimeTZ(tz)

Set the database Time Zone for this connection:

@param tz: object that define the Time Zone

Note

The input parameter can be af differents types: 1. A String that can be handled by postgresql (see Time Zone at http://www.postgresql.org/docs/current/static/sql-set.html) 2. An integer, for instance -7. The time zone 7 hours west from UTC (equivalent to PDT / -07:00). Positive values are east from UTC. 3. A datetime with timezone information

istsoslib.sosException module

exception istsoslib.sosException.SOSException(code, locator, msg, othermsgs=[])

Bases: exceptions.ValueError

SOS Exception class

code

int – the error code

locator

str – the locator identifing where error occurred

msg

str – the error message

children

list – the children errors

AddText(text)

append child error text

ToXML()

render as XML

__repr__()

convert to XML string

__str__()

convert to XML string

exception = ' <Exception exceptionCode="%s">\n%s \n </Exception>'
exceptionLoc = ' <Exception locator="%s" exceptionCode="%s">\n%s \n </Exception>'
exceptionreport = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><ExceptionReport xmlns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 ../owsExceptionReport.xsd" version="1.0.0" xml:lang="en">\n%s \n</ExceptionReport>'
exceptiontext = ' <ExceptionText>\n %s\n </ExceptionText>'

istsoslib.sosUtils module

istsoslib.sosUtils.CQLvalueFilter2PostgisSql(fildName, CQLfilter)

parse a CQL filter and returen an SQL filter

istsoslib.sosUtils.childElementNodes(xmlnode)
istsoslib.sosUtils.ogcCompCons2PostgisSql(ogcComparisonOperator)

parse an ogc property operator element and convert it to a PostGIS SQL WHERE clause

istsoslib.sosUtils.ogcSpatCons2PostgisSql(ogcSpatialOperator, geomField, epsgField)

parse an ogc spatial operator element and convert it to a PostGIS SQL spatial WHERE clause

istsoslib.sos_version module

Module contents