API

GeoColumns

class base_geoengine.geo_field.Geom(string, dim=2, srid=900913, gist_index=True, **args)

New type of column in the ORM for POSTGIS geometry type

create_geo_column(cursor, col_name, geo_column, table, model)

Create a columns of type the geom

entry_to_shape(value, same_type=False)

Transform input into an object

load_geo(wkb)

Load geometry into browse record after read was done

set(cr, obj, res_id, name, value, user=None, context=None)

Write and create value into database

value can be geojson, wkt, shapely geomerty object. If geo_direct_write in context you can pass diretly WKT

set_geo(value)

Transform data to a format compatible with the create function.

It is also use in expression.py in order to represent value.

update_geo_column(cursor, col_name, geo_column, table, model)

Update the column type in the database.

class base_geoengine.geo_point.GeoPoint(string, dim=2, srid=900913, gist_index=True, **args)

New type of column in the ORM for POSTGIS geometry Point type

class base_geoengine.geo_line.GeoLine(string, dim=2, srid=900913, gist_index=True, **args)

New type of column in the ORM for POSTGIS geometry Line type

class base_geoengine.geo_multiline.GeoMultiLine(string, dim=2, srid=900913, gist_index=True, **args)

New type of column in the ORM for POSTGIS geometry MultiLine type

class base_geoengine.geo_polygon.GeoPolygon(string, dim=2, srid=900913, gist_index=True, **args)

New type of column in the ORM for POSTGIS geometry Polygon type

class base_geoengine.geo_multipolygon.GeoMultiPolygon(string, dim=2, srid=900913, gist_index=True, **args)

New type of column in the ORM for POSTGIS geometry MultiPolygon type

View Management

Module that manages map view and vector/raster layer

GEO ORM MODEL

class base_geoengine.geo_model.GeoModel(pool, cr)

Base class for all models defining geo fields.

fields_get(*args, **kwargs)

Add geo_type definition for geo fields

fields_view_get(*args, **kwargs)

Returns information about the available fields of the class. If view type == ‘map’ returns geographical columns available

Perform a geo search it allows direct domain: geo_search(r, uid, domaine=[(‘name’, ‘ilike’, ‘toto’]), geo_domain=[(‘the_point’, ‘geo_intersect’,

myshaply_obj or mywkt or mygeojson)])
We can also support indirect geo_domain (
‘geom’, ‘geo_operator’, {‘res.zip.poly’: [‘id’, ‘in’, [1,2,3]] })
The supported operators are :
  • geo_greater
  • geo_lesser
  • geo_equal
  • geo_touch
  • geo_within
  • geo_intersect

GEO ORM OPERATORS

Perform a geo search it allows direct domain: geo_search(

r, uid, domaine=[(‘name’, ‘ilike’, ‘toto’]), geo_domain=[(‘the_point’,

‘geo_intersect’, myshaply_obj or mywkt or mygeojson)])
We can also support indirect geo_domain
(‘geom’, ‘geo_operator’, {‘res.zip.poly’: [‘id’, ‘in’, [1,2,3]] })
The supported operators are :
  • geo_greater
  • geo_lesser
  • geo_equal
  • geo_touch
  • geo_within
  • geo_intersect
class base_geoengine.geo_operators.GeoOperator(geo_field)
get_geo_equal_sql(table, col, value, rel_col=None, rel_model=None)

Returns raw sql for geo_equal operator (used for equality comparison)

get_geo_greater_sql(table, col, value, rel_col=None, rel_model=None)

Returns raw sql for geo_greater operator (used for area comparison)

get_geo_intersect_sql(table, col, value, rel_col=None, rel_model=None)

Returns raw sql for geo_intersec operator (used for spatial comparison)

get_geo_lesser_sql(table, col, value, rel_col=None, rel_model=None)

Returns raw sql for geo_lesser operator (used for area comparison)

get_geo_touch_sql(table, col, value, rel_col=None, rel_model=None)

Returns raw sql for geo_touch operator (used for spatial comparison)

get_geo_within_sql(table, col, value, rel_col=None, rel_model=None)

Returns raw sql for geo_within operator (used for spatial comparison)

get_rel_field(rel_col, rel_model)

Retrieves the expression to use in PostGIS statement for a spatial rel search

GEO helper

base_geoengine.geo_helper.geo_convertion_helper.value_to_shape(value)

Transforms input into a Shapely object