This class is responsible for finding a spatial dialect (e.g. PGSpatialDialect or MySQLSpatialDialect) for a SQLAlchemy database dialect.
It can be used by calling “DialectManager.get_spatial_dialect(dialect)”, which returns the corresponding spatial dialect. The spatial dialect has to be listed in __initialize_dialects().
This method returns a spatial dialect instance for a given SQLAlchemy dialect. The instances are cached, so that for every spatial dialect exists only one instance.
This class bundles all required classes and methods to support a database dialect. It is supposed to be subclassed. The child classes must be added to DialectManager.__initialize_dialects(), so that they can be used.
This method is called from base.__compile_wkbspatialelement() to insert the value of base.WKBSpatialElement into a query.
This method is called to translate a generic function into a database dialect specific function.
It either returns a string, a list or a method that returns a Function object.
String: A function name, e.g.:
functions.wkb: 'SDO_UTIL.TO_WKBGEOMETRY'List: A list of function names that are called cascaded, e.g.:
functions.wkt: ['TO_CHAR', 'SDO_UTIL.TO_WKTGEOMETRY'] is compiled as: TO_CHAR(SDO_UTIL.TO_WKTGEOMETRY(..))Method: A method that accepts a list/set of arguments and returns a Function object, e.g.:
functions.equals : lambda params, within_column_clause : (func.SDO_EQUAL(*params) == 'TRUE')
This method is called after the mapped table was created in the database by SQLAlchemy. It is used to create a geometry column for the created table.
This method is called after the mapped table was deleted from the database by SQLAlchemy. It can be used to delete the geometry column.
Returns True if the passed-in function should be called as member function, e.g.:
Point.the_geom.dims is compiled as:
points.the_geom.Get_Dims()
Returns True if the passed-in function should be called as property, e.g.:
Point.the_geom.x is compiled as (for MS Server):
points.the_geom.x
This method is called when a geometry value from the database is transformed into a SpatialElement object. It receives an WKB binary sequence, either as Buffer (for PostGIS and Spatialite), a String (for MySQL) or a cx_Oracle.LOB (for Oracle), and is supposed to return a subclass of SpatialElement, e.g. PGSpatialElement or MySQLSpatialElement.
This method is called from functions._WKBType.process_result_value() to convert the result of functions.wkb() into a usable format.