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
Comparator class used for Oracle
Represents a Geometry value as loaded from the database.
Implementation of SpatialDialect for Oracle.
Append a transformation to BLOB using the Oracle function ‘TO_BLOB’.
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
SDO_UTIL.TO_WKBGEOMETRY(..) returns an object of cx_Oracle.LOB, which we will transform into a buffer.
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.
Functions only supported by Oracle
g.Get_Dims()
TO_CHAR(SDO_UTIL.TO_GMLGEOMETRY(g))
TO_CHAR(SDO_UTIL.TO_GML311GEOMETRY(g))
g.Get_GType()
TO_CHAR(SDO_UTIL.TO_KMLGEOMETRY(g))
SDO_ANYINTERACT(g1, g2)
SDO_CONTAINS(g1, g2)
SDO_COVEREDBY(g1, g2)
SDO_COVERS(g1, g2)
SDO_EQUAL(g1, g2)
SDO_FILTER(g1, g2, param)
SDO_GEOM.SDO_AREA()
SDO_GEOM.SDO_BUFFER()
SDO_GEOM.SDO_CENTROID()
SDO_GEOM.SDO_CONCAVEHULL()
SDO_GEOM.SDO_CONCAVEHULL_BOUNDARY()
SDO_GEOM.SDO_CONVEXHULL()
SDO_GEOM.SDO_DIFFERENCE()
SDO_GEOM.SDO_DISTANCE()
SDO_GEOM.SDO_INTERSECTION()
SDO_GEOM.SDO_LENGTH()
SDO_GEOM.SDO_MBR()
SDO_GEOM.SDO_POINTONSURFACE()
SDO_GEOM.SDO_UNION()
SDO_GEOM.WITHIN_DISTANCE()
SDO_GEOM.SDO_XOR()
SDO_INSIDE(g1, g2)
SDO_NN(g1, g2, param [, number])
SDO_NN_DISTANCE(number)
SDO_ON(g1, g2)
SDO_OVERLAPBDYDISJOINT(g1, g2)
SDO_OVERLAPBDYINTERSECT(g1, g2)
SDO_OVERLAPS(g1, g2)
SDO_RELATE(g1, g2, param)
SDO_TOUCH(g1, g2)
SDO_WITHIN_DISTANCE(g1, g2, param)