Geospatial mailing list archives
geospatial@odoo-community.org
Browse archives
R: GPS android to GeoPoint
byHello,
thanks for the answer.
I send my coordinates by xmlRpc
this is Java Android code
"
attendanceTaskId = odoo.exec(attendanceListener, database, uid, password, "hr.attendance", "calcola_presenza_area", conditions_2);
"
While, Odoo side, I manage the information in this mode:
"
@api.multi
def calcola_presenza_area(self, arg=None, context=None):
lat_point = self[0]['partner_latitude_checkin']
long_point = self[0]['partner_longitude_checkin']
point = "POINT({} {})".format(lat_point,long_point)
risultatoRicerca = self.env['geo.localize.project'].geo_search(
geo_domain=[('area_palazzo', 'geo_contains', 'POINT(lat_point long_point)')],
limit=1
)
_logger.info('***********************************************************************')
return risultatoRicerca
"
My idea was:
step1: i transform "point" in geoPoint
step2: I call geo_search using geoPoint.
But my idea is wrong because point e geo_search work with two different system.
My problem is variable "point": this point has different reference system from GeoPoint.
How can I use "point" in geo_search ?
How can I transform to runtime point in geo_point without to use the database ?
Da: Yannick Vaucher
[mailto:yannick.vaucher@camptocamp.com]
Inviato: lunedì 16 ottobre 2017 10:47
A: Geospatial
Oggetto: Re: GPS android to GeoPoint
Hello,
And how are you sending your coordinates from your android phone to Odoo ?
If you use xmlrpc or jsonrpc from your android application, you must transform your coordinates first and then write the object.
If it is by hand there is a widget on geoengine fields to set long / lat
Your view should define <field
name="my_coordinates" widget="geo_point_xy"/>
instead of <field name="my_coordinates" widget="geo_edit_map"/>
Then make sure to transform your coordinates from GPS to odoo srid. And use that field to write them.
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 13 October 2017 at 19:02, Giuseppe Flammia <giuseppe.flammia@iquadro.net> wrote:
Hello to all,
I have already written on the subject but I think I have been misunderstood.
I need to transform the lat / long coordinates of the position of an android phone
in a GeoPoint.
Is there a geoengine utility that allows you to transform lat / long into GeoPoint?
Thanks
_______________________________________________
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