### Navigation

- index
- modules |
- previous |
- OpenERP GeoEngine 0.3 documentation »

# API

## GeoColumns

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

  This class adds a new type of columns to ORM. It enable POSTGIS geometry type support.

  `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)

    This function is used to load geometry into browse record after read was done

  `manage_db_column`(cursor, col_name, geo_columns, table, model)

    In charge of managing geom column type

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

    This function used to 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)

    This function is used to transform data in order to be 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 a column of type the geom does. !! not do a lot of test yet

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

  This class adds a new type of columns to ORM. It enables POSTGIS geometry type support

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

  This class adds a new type of columns to ORM. It enables POSTGIS geometry type support

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

  This class adds a new type of columns to ORM. It enables POSTGIS geometry type support

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

  This class adds a new type of columns to ORM. It enables POSTGIS geometry type support

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

  This class adds a new type of columns to ORM. It enables POSTGIS geometry type support

## View Management

Module that manages map view and vector/raster layer

## GEO ORM MODEL

class `base_geoengine.geo_model.``GeoModel`(pool, cr)
  `fields_get`(cursor, uid, allfields=None, context=None)

    Add geo_type definition for geo fields

  `fields_view_get`(cursor, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)

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

  `geo_search`(cursor, uid, domain=[], geo_domain=[], offset=0, limit=None, order=None, context=None)

    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

`base_geoengine.geo_operators.``geo_search`(model, cursor, uid, domain=[], geo_domain=[], offset=0, limit=None, order=None, context=None)

  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

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

    Returns raw sql for geo_greater operator

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

    Returns raw sql for geo_intersec operator

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

    Returns raw sql for geo_lesser operator

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

    Returns raw sql for geo_touch operator

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

    Returns raw sql for geo_within operator

  `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.

### Navigation

- index
- modules |
- previous |
- OpenERP GeoEngine 0.3 documentation »