Geospatial mailing list archives

geospatial@odoo-community.org

Avatar

R: GPS android to GeoPoint

by
Giuseppe
- 17/10/2017 13:26:15

Hello

I use the function "from_latlon" in this mode:

 

geo_point_1 = geo_fields.GeoPoint.from_latlon(self.env.cr, 45.4640976 ,9.191926500000022)

Is exactly ?

 

After I use geo_point_1 in this mode:

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

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

            limit=1

        )

 

Are there errors ?

 

Da: Mignon, Laurent [mailto:laurent.mignon@acsone.eu]
Inviato: martedì 17 ottobre 2017 11:47
A: Geospatial
Oggetto: Re: GPS android to GeoPoint

 

 

On Tue, Oct 17, 2017 at 11:02 AM, Giuseppe Flammia <giuseppe.flammia@iquadro.net> wrote:

Hello,

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

 

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

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



 

--

Laurent Mignon
Senior software engineer

Tel: +352 20 21 10 20 32

Fax: +352 20 21 10 21
Email: laurent.mignon@acsone.eu

Acsone SA, Succursale de Luxembourg 

22, Zone Industrielle

| L-8287 Kehlen, Luxembourg

TVA LU24733605

| RCS B160400

 

Acsone sa/nv
Waterloo Atrium, Drève Richelle 167

 | B-1410 Waterloo
RPM Bruxelles 0835.207.216 RPR Brussel  

 

 

 

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

Reference