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

select_array(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

  1. An integer, for instance -7. The time zone 7 hours west from UTC (equivalent to PDT / -07:00). Positive values are east from UTC.
  2. A datetime with timezone information
to_csv(sql, par=None, delimiter=', ')

Execute a select statement

to_string(sql, par=None, delimiter=', ', lineterminator='\n')

istsoslib.sosException module

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

Bases: exceptions.ValueError

SOS Exception class

code

the error code

Type:int
locator

the locator identifing where error occurred

Type:str
msg

the error message

Type:str
children

the children errors

Type:list
AddText(text)

append child error text

ToXML()

render as XML

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