Geospatial mailing list archives

geospatial@odoo-community.org

Avatar

R: GPS translate

by
Giuseppe
- 05/10/2017 13:03:06

Hi,

thanks for the answer.

 

But my situation is not clear.

 

I don't have need to change the column value, but in my case

I receive lat/long and, at runtime, I rate if this point is or not is in the area (in the code is : area_palazzo).

 

code example:

 

area_palazzo = geo_fields.GeoMultiPolygon('Area Palazzo') ....

 ....

 

 lat_point = self[0]['partner_latitude_checkin'] //from GPS android

 long_point = self[0]['partner_longitude_checkin'] //from GPS android

 point = "POINT({} {})".format(lat_point,long_point)

 

 

 _logger.info(point)

 _logger.info("Ricerca punto")

 risultatoRicerca = self.env['geo.localize.project'].geo_search(

         geo_domain=[('area_palazzo', 'geo_contains', point)],

         limit=1

     )

 

 _logger.info(risultatoRicerca)

 

 

 My question is:

 How use point GPS android in "geo_search" if the GPS system are different  ?

 

 Thank you much for the help.

 

Da: Yannick Vaucher [mailto:yannick.vaucher@camptocamp.com]
Inviato: giovedì 5 ottobre 2017 12:02
A: Geospatial
Oggetto: Re: GPS translate

 

Geoengine supports a setting of srid. By default it is the 600613 srid.

 

For GPS the srid is 4326.

You can either use 4326 srid on the fields definition, to avoid any conversion or you should probably convert it before you send it by xmlrpc by doing a reprojection.

 

Note that changing the srid on existing columns is not implemented for the reprojection, thus if you have an existing database on which you want to change srid you might need to do some SQL querries.

 

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 2 October 2017 at 16:16, Giuseppe Flammia <giuseppe.flammia@iquadro.net> wrote:

Hi,

I have installed GeoEngine on Odoo 10.

I'm working with Odoo and Android.

By xml-Rpc, from my android phone, I send the lat/long of the operator that use it.

I need to translate the GPS coordinate in the format GeoPoint.

 

I don't find the function that translate:

GPS lat/long --> GeoPoint

 

can you help me ?

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

 

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

Reference