# Path: base_geoengine/geo_helper/geo_convertion_helper.py
# def value_to_shape(value, use_wkb=False):
# 
# Path: base_geoengine/geo_db.py
# def create_geo_column(
#         cr, tablename, columnname, geotype, srid, dim, comment=None):
#     """ Create a geometry column with the given type.
# 
#     :params: srid: geometry's projection srid
#     :params: dim: geometry's dimension (2D or 3D)
#     """
#     cr.execute("SELECT AddGeometryColumn( %s, %s, %s, %s, %s)",
#                (tablename,
#                 columnname,
#                 srid,
#                 geotype,
#                 dim))
#     if comment:
#         # TODO use SQL string Composition
#         # http://initd.org/psycopg/docs/sql.html
#         # pylint: disable=E8103
#         cr.execute('COMMENT ON COLUMN "{}"."{}" IS %s'.format(
#             tablename, columnname), (comment,))
#     _schema.debug(
#         "Table %r: added geometry column %r of type %s",
#         tablename, columnname, geotype)


import logging
    import geojson
from operator import attrgetter
from odoo import fields, _
from odoo.tools import sql
from .geo_helper import geo_convertion_helper as convert
from .geo_db import create_geo_column
    from shapely.geometry import asShape
    from shapely.geometry import Point
    from shapely.geometry.base import BaseGeometry
    from shapely.wkb import loads as wkbloads
        return convert.value_to_shape(value, use_wkb=True)

    def convert_to_read(self, value, record, use_name_get=True):
        if not isinstance(value, BaseGeometry):
            # read hexadecimal value from database
            shape = self.load_geo(value)
        else:
            shape = value
        if not shape or shape.is_empty:
            return False
        return geojson.dumps(shape)

    #
    # Field description
    #

    # properties used by get_description()
    _description_dim = property(attrgetter('dim'))
    _description_srid = property(attrgetter('srid'))
    _description_gist_index = property(attrgetter('gist_index'))

    @classmethod
    def load_geo(cls, wkb):
        """Load geometry into browse record after read was done"""
        if isinstance(wkb, BaseGeometry):
            return wkb
        return wkbloads(wkb, hex=True) if wkb else False

    def entry_to_shape(self, value, same_type=False):
        """Transform input into an object"""

# Path: base_geoengine/geo_helper/geo_convertion_helper.py
# def value_to_shape(value, use_wkb=False):
# 
# Path: base_geoengine/geo_db.py
# def create_geo_column(
#         cr, tablename, columnname, geotype, srid, dim, comment=None):
#     """ Create a geometry column with the given type.
# 
#     :params: srid: geometry's projection srid
#     :params: dim: geometry's dimension (2D or 3D)
#     """
#     cr.execute("SELECT AddGeometryColumn( %s, %s, %s, %s, %s)",
#                (tablename,
#                 columnname,
#                 srid,
#                 geotype,
#                 dim))
#     if comment:
#         # TODO use SQL string Composition
#         # http://initd.org/psycopg/docs/sql.html
#         # pylint: disable=E8103
#         cr.execute('COMMENT ON COLUMN "{}"."{}" IS %s'.format(
#             tablename, columnname), (comment,))
#     _schema.debug(
#         "Table %r: added geometry column %r of type %s",
#         tablename, columnname, geotype)


# Path: base_geoengine/fields.py
import logging
    import geojson
from operator import attrgetter
from odoo import fields, _
from odoo.tools import sql
from .geo_helper import geo_convertion_helper as convert
from .geo_db import create_geo_column
    from shapely.geometry import asShape
    from shapely.geometry import Point
    from shapely.geometry.base import BaseGeometry
    from shapely.wkb import loads as wkbloads

        return convert.value_to_shape(value, use_wkb=True)

    def convert_to_read(self, value, record, use_name_get=True):
        if not isinstance(value, BaseGeometry):
            # read hexadecimal value from database
            shape = self.load_geo(value)
        else:
            shape = value
        if not shape or shape.is_empty:
            return False
        return geojson.dumps(shape)

    #
    # Field description
    #

    # properties used by get_description()
    _description_dim = property(attrgetter('dim'))
    _description_srid = property(attrgetter('srid'))
    _description_gist_index = property(attrgetter('gist_index'))

    @classmethod
    def load_geo(cls, wkb):
        """Load geometry into browse record after read was done"""
        if isinstance(wkb, BaseGeometry):
            return wkb
        return wkbloads(wkb, hex=True) if wkb else False

    def entry_to_shape(self, value, same_type=False):
        """Transform input into an object"""

        shape = convert.value_to_shape(value)