Geospatial mailing list archives

geospatial@odoo-community.org

Avatar

Re: Please, help me

by
Camptocamp SA, Yannick Payot
- 05/05/2017 17:39:15
Hello Alonso,

If you have the lon and lat values you can write into a geo_field with a wkt format this way:


from shapely.geometry import Point

my_point = Point(731452, 5875278).wkt

# assuming we want to set a point on a partner
self.env['res.partner'].create({'name': 'Foo', 'point': my_point})

You also need to be sure you use the right projection. By default it is 900913 projection but changing the srid allows you to change that on the definition of you field.

Cheers,


Yannick Vaucher
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 30
Office: +41 21 619 10 10

On 5 May 2017 at 10:38, Alonso Vargas <alonso.vargas@solux.pe> wrote:

Hi, I hope you can help me.

 

I’m a new developer in Odoo and I’m working with Geospatial module for Odoo 10.
I have a big problem when I try to compute a geo_point based on latitude and longitude data. I mean, I need that specifying latitude and longitude data to get a point on the map (geo_map_edit). Please, thank you very much if you help me.I tried many things and I can’t do it.

 

 

 

 

 

 

_______________________________________________
Mailing-List: https://odoo-community.org/groups/geospatial-48
Post to: mailto:geospatial@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


Reference