Geospatial support to geolocalize Parties

Hello,

No search result with “OpenStreetMap”… so is there a Tryton geospatial support in order to geolocalize Parties?

There is the trytond-gis library which adds gesspatial fields to tryton using Postgis plugin. But you will need to localize the address and convert it to a geospatial point.

Hope it helps

That’s mean, in the same way, the google-map module use the trytond-gis library?

If so, that mean we will have to replace the Google Maps request by an OpenStreetMap request?

The Google-maps module just creates an url based on the different address fields. When you look at the code of the module, you should be able to do kind of the same for openstreetmap. No idea if it will work, you have to test it.

Indeed I had the idea since some times that the google_maps module should evolved (and be renamed) to support different map sources like OSM.

the google_maps module should evolved (and be renamed) to support different map sources like OSM.

In fact, my request is motivated by a customer need. If it could be an opportunity for a contribution on Tryton’s core, it’s perfect.

So, blue print? :slight_smile:

Well your request is not clear. Do you want to have a link from addresses to OSM or do you want to geolocate addresses?

Yes, we want first to geolocate Parties addresses, and also:

  • view all adresses on a same map; and
  • associate geospatial points, lines or polygones to a model (like notes or comments on all Tryton’s objects actually).

About OSM, we worked with this module: trytond-party_maps/address.py at main · NaN-tic/trytond-party_maps · GitHub

Looks your request is more then 'a link from addresses to OSM`.

How should this be done? An external service (government agency?) or something like google or OSM? No idea if you get the location coordinates back.

Seems something which is not directly possible with Tryton I think. Would be nice, but with a lot of addresses this will become clumsy very soon. Better is then to select a set of addresses and start a wizard which then displays the data. Or maybe you can create an URL which opens a map in the browser.

This needs Postgis and with it the trytond-gis backend. But you have to ask yourself the question why you want to have it on each model and what do you want to store? Yes geo data, but what kind of geo data? Weather, water, mountains, surveying, agriculture, electricity lines, waste water lines etc etc.

But it’s a whole new world :smile: GPS and geolocation.

Just somethink like this, but with the Tryton’s Community mood et pour le Logiciel Libre.

Are you sure ? :slight_smile:

That one uses Postgis also. But instead of using a webclient to draw I would make sure that there is a data connector or something else for QGis. That’s widely used by professionals. It’s also a way bigger project then your first question … :slight_smile:

That’s the most easy thing to do, look at maps of civil engineering with drawn bridges or roads or agriculture maps of different fields.
Displaying the data is one thing, creating it and inserting it into the database another. The GPS sensors are much cheaper nowadays. Together with a base station (GPS-RTK) you will get centimeter precision.

The firt theorical knowledge that reminds me is that Tryton already offer this kind of mecanism via APIs (allready applied in the Chronos web application, or on other web applications like this one).

@ced No?

I would say that, regardless of the level of precision, it remains important to be able to (re)position the point, the line or the polygon by hand, to adjust the position yourself (for example, certain street numbers are not, on the ground, in the right place, etc.).

The second good experience knowledge that reminds me is uMap (try the demo first)

… and now imagine… uMap “simply” integrated on the Tryton left menu, with filters and so one… something like this:

I do not really see the point to implement a poor GIS viewer in Tryton clients (desktop will probably be difficult) which will not please GIS users.
So for me it is better to interface with existing GIS software but I do not know if there are some standard APIs for that.

I’m working in another project to show data in a map using leaftlet which allow to consume data from an API using GeoJSON format (which can contain metadata for the geospatial values). GeoJSON does n¡not require to have geospatial points stored on the database but just the coordinates.

As far as we have all the data stored in Tryton we can just create a route to expose the values as GeoJSON (thats what we do in our project but using flask directly) to properly shown them on a map using leaftlet.

This is already possible in Tryton but I do not think there is a generic feature that fits all needs.

Probably the only generic feature is to store coordinates on the address form, but I’m not sure if it’s worth the effort to add just two fields that won’t be used for most of the people.

And to be correct it should be stored as a POINT.

If you want to be that strict, yes. But GPS coordinates are just floats and depending on what you want you don’t need to have a POINT. When displaying it on a map or using it for routing the coordinates are enough. If you want to use it for GIS, you must have a POINT.

There are a lot of standards see https://ogcapi.ogc.org/.

We are always strict for standard module.

and the others datatypes “Circularstring”, “CompoundCurve”, “CurvePolygon”, “PolyhedralSurface”, included into the OGC standard (it also defines the SQL/MM versions of these types and operations on them).