geoalchemy.oracle

geoalchemy.oracle.DimInfoFunction(function, returns_boolean=False, compare_value='TRUE')

Some Oracle functions expect a ‘dimension info array’ (DIMINFO) for each geometry. This method tries to append a corresponding DIMINFO for every geometry in the parameter list.

For geometry columns a subselect is added which queries the DIMINFO from ‘ALL_SDO_GEOM_METADATA’. For WKTSpatialElement/WKBSpatialElement objects, that were queried from the database, the DIMINFO will be added as text representation (if possible).

Most functions that require DIMINFO also accept a tolerance value instead of the DIMINFO. If you want to use a tolerance value for geometry columns or WKBSpatialElement objects that come from the database, the flag ‘auto_diminfo’ has to be set to ‘False’ when calling the function:

l = session.query(Lake).filter(Lake.lake_name=='Lake White').one()
session.scalar(l.lake_geom.area) # DIMINFO is added automatically
session.scalar(l.lake_geom.area(tolerance, auto_diminfo=False)) # DIMINFO is not added

see also: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_objrelschema.htm#sthref300

class geoalchemy.oracle.OracleComparator(prop, mapper, adapter=None)

Comparator class used for Oracle

class geoalchemy.oracle.OraclePersistentSpatialElement(desc)

Represents a Geometry value as loaded from the database.

class geoalchemy.oracle.OracleSpatialDialect

Implementation of SpatialDialect for Oracle.

bind_wkb_value(wkb_element)

Append a transformation to BLOB using the Oracle function ‘TO_BLOB’.

static get_diminfo_select(column)

Returns a select which queries the DIMINFO array from ‘ALL_SDO_GEOM_METADATA’ for the passed in column.

see: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_objrelschema.htm#sthref300

process_wkb(value)

SDO_UTIL.TO_WKBGEOMETRY(..) returns an object of cx_Oracle.LOB, which we will transform into a buffer.

geoalchemy.oracle.ST_GeometryFunction(function, returns_geometry=False, relation_function=False, returns_boolean=False, compare_value=1, default_cast=False)

Functions inside MDSYS.OGC_* (OGC SF) and MDSYS.ST_GEOMETRY.ST_* (SQL MM) expect ST_GEOMETRY instead of SDO_GEOMETRY, this method adds a cast.

Some functions like OGC_X or OGC_IsClosed only work if the geometry (the first parameter) is casted to a ST_GEOMETRY subtype, for example: ‘OGC_X(ST_POINT(SDO_GEOMETRY(..)))’. This method tries to get the geometry type from WKTSpatialElement, WKBSpatialElement and columns and adds a corresponding cast (if possible). If the geometry type can not be identified, no cast is added and the user manually has to add a cast, for example: ‘session.scalar(functions.x(func.ST_POINT(spot.spot_location.transform(2249)))’

Functions like OGC_IsEmpty do not require a cast to a subtype. In this case (default_cast = True), a cast to ‘ST_GEOMETRY’ is always added.

If relation_function is set to True, a cast is also added for the second parameter.

If the database function returns a new geometry (returns_geometry = True`) a back-cast to SDO_GEOMETRY (‘ST_GEOMETRY.GET_SDO_GEOM(..)’) is added.

class geoalchemy.oracle.oracle_functions

Functions only supported by Oracle

class dims(*arguments, **kwargs)

g.Get_Dims()

class oracle_functions.gml(*arguments, **kwargs)

TO_CHAR(SDO_UTIL.TO_GMLGEOMETRY(g))

class oracle_functions.gml311(*arguments, **kwargs)

TO_CHAR(SDO_UTIL.TO_GML311GEOMETRY(g))

class oracle_functions.gtype(*arguments, **kwargs)

g.Get_GType()

class oracle_functions.kml(*arguments, **kwargs)

TO_CHAR(SDO_UTIL.TO_KMLGEOMETRY(g))

class oracle_functions.sdo_anyinteract(*arguments, **kwargs)

SDO_ANYINTERACT(g1, g2)

class oracle_functions.sdo_contains(*arguments, **kwargs)

SDO_CONTAINS(g1, g2)

class oracle_functions.sdo_coveredby(*arguments, **kwargs)

SDO_COVEREDBY(g1, g2)

class oracle_functions.sdo_covers(*arguments, **kwargs)

SDO_COVERS(g1, g2)

class oracle_functions.sdo_equal(*arguments, **kwargs)

SDO_EQUAL(g1, g2)

class oracle_functions.sdo_filter(*arguments, **kwargs)

SDO_FILTER(g1, g2, param)

class oracle_functions.sdo_geom_sdo_area(*arguments, **kwargs)

SDO_GEOM.SDO_AREA()

class oracle_functions.sdo_geom_sdo_buffer(*arguments, **kwargs)

SDO_GEOM.SDO_BUFFER()

class oracle_functions.sdo_geom_sdo_centroid(*arguments, **kwargs)

SDO_GEOM.SDO_CENTROID()

class oracle_functions.sdo_geom_sdo_concavehull(*arguments, **kwargs)

SDO_GEOM.SDO_CONCAVEHULL()

class oracle_functions.sdo_geom_sdo_concavehull_boundary(*arguments, **kwargs)

SDO_GEOM.SDO_CONCAVEHULL_BOUNDARY()

class oracle_functions.sdo_geom_sdo_convexhull(*arguments, **kwargs)

SDO_GEOM.SDO_CONVEXHULL()

class oracle_functions.sdo_geom_sdo_difference(*arguments, **kwargs)

SDO_GEOM.SDO_DIFFERENCE()

class oracle_functions.sdo_geom_sdo_distance(*arguments, **kwargs)

SDO_GEOM.SDO_DISTANCE()

class oracle_functions.sdo_geom_sdo_intersection(*arguments, **kwargs)

SDO_GEOM.SDO_INTERSECTION()

class oracle_functions.sdo_geom_sdo_length(*arguments, **kwargs)

SDO_GEOM.SDO_LENGTH()

class oracle_functions.sdo_geom_sdo_mbr(*arguments, **kwargs)

SDO_GEOM.SDO_MBR()

class oracle_functions.sdo_geom_sdo_pointonsurface(*arguments, **kwargs)

SDO_GEOM.SDO_POINTONSURFACE()

class oracle_functions.sdo_geom_sdo_union(*arguments, **kwargs)

SDO_GEOM.SDO_UNION()

class oracle_functions.sdo_geom_sdo_within_distance(*arguments, **kwargs)

SDO_GEOM.WITHIN_DISTANCE()

class oracle_functions.sdo_geom_sdo_xor(*arguments, **kwargs)

SDO_GEOM.SDO_XOR()

class oracle_functions.sdo_inside(*arguments, **kwargs)

SDO_INSIDE(g1, g2)

class oracle_functions.sdo_nn(*arguments, **kwargs)

SDO_NN(g1, g2, param [, number])

class oracle_functions.sdo_nn_distance(*arguments, **kwargs)

SDO_NN_DISTANCE(number)

class oracle_functions.sdo_on(*arguments, **kwargs)

SDO_ON(g1, g2)

class oracle_functions.sdo_overlapbdydisjoint(*arguments, **kwargs)

SDO_OVERLAPBDYDISJOINT(g1, g2)

class oracle_functions.sdo_overlapbdyintersect(*arguments, **kwargs)

SDO_OVERLAPBDYINTERSECT(g1, g2)

class oracle_functions.sdo_overlaps(*arguments, **kwargs)

SDO_OVERLAPS(g1, g2)

class oracle_functions.sdo_relate(*arguments, **kwargs)

SDO_RELATE(g1, g2, param)

class oracle_functions.sdo_touch(*arguments, **kwargs)

SDO_TOUCH(g1, g2)

class oracle_functions.sdo_within_distance(*arguments, **kwargs)

SDO_WITHIN_DISTANCE(g1, g2, param)

Previous topic

geoalchemy.spatialite

Next topic

geoalchemy.mssql

This Page