lumnik. / scenarios All scenarios · Français

The customers of a legacy export, on a map

Goal Show the customers of a legacy export on a map on a phone, count those without a position, and never serve their coordinates.

A sales rep plans a round on a phone. The legacy ERP exports one GPS point per customer, with a decimal comma:

customers.csv
code_client;raison_sociale;ville;latitude;longitude
C-001;Boulangerie des Pentes;Lyon;45,7485;4,8270
C-002;Garage du Tonkin;Villeurbanne;45,7719;4,8902
C-003;Pharmacie du Parc;Bron;45,7385;4,9131
C-004;Menuiserie Berliet;Saint-Priest;45,6965;4,9445
C-005;Fleuriste de la Saulaie;Oullins;45,7140;4,8075
C-006;Cave du Rhône;Chasse-sur-Rhône;45,5797;4,7993
C-007;Quincaillerie du Gier;Givors;45,5906;4,7689
C-008;Épicerie Beaujolaise;Villefranche-sur-Saône;45,9898;4,7186
C-009;Imprimerie de l'Est;Meyzieu;45,7667;5,0036
C-010;Pneus Nord-Isère;Bourgoin-Jallieu;45,5862;5,2736
C-011;Café des Alpes;Grenoble;45,1885;5,7245
C-012;Laiterie du Voironnais;Voiron;45,3640;5,5890
C-013;Coutellerie Jacquard;Saint-Étienne;45,4397;4,3872
C-014;Fromagerie du Lac;Annecy;45,8992;6,1294
C-015;Atelier de l'Ondaine;Firminy;45,3880;4,2880
C-016;Brasserie du Gier;Rive-de-Gier;45,5290;4,6180
C-017;Pressing du Grand Large;Décines-Charpieu;0;0
depots.csv
code_depot;depot;ville;latitude;longitude
D-LYO;Lyon;Lyon;45,7090;4,8400
D-GRE;Grenoble;Fontaine;45,2070;5,6720
D-STE;Saint-Étienne;Saint-Étienne;45,4520;4,3570
manifests/20-customer.yaml
kind: Entityname: map_customer_mlabel: Clientdescription: "A customer of the ERP with the GPS point of its shop; coord_issue says why a point was set aside."match: [customer_no]scopes: [tournee-m]columns:  customer_no: { label: "Code client" }  name: { label: "Raison sociale" }  city: { label: "Ville" }  latitude: { label: "Latitude" }  longitude: { label: "Longitude" }  coord_issue: { label: "Coordonnées : remarque" }sources:  - table: t_scenario_map_customers_m    map: { code_client: customer_no, raison_sociale: name, ville: city, latitude: latitude, longitude: longitude, coord_issue: coord_issue }points:  - name: shop    lat: latitude    lon: longitude
manifests/21-depot.yaml
kind: Entityname: map_depot_mlabel: Dépôtmatch: [depot_code]scopes: [tournee-m]columns:  depot_code: { label: "Code dépôt" }  depot: { label: "Dépôt" }  city: { label: "Commune" }  latitude: { label: "Latitude" }  longitude: { label: "Longitude" }sources:  - table: t_scenario_map_depots_m    map: { code_depot: depot_code, depot: depot, ville: city, latitude: latitude, longitude: longitude }points:  - name: yard    lat: latitude    lon: longitude
manifests/32-refused-point.yaml
# Must be refused: the customer entity declares the point `shop`, not `site`.apiVersion: apps.lumnik.io/v1kind: Viewmetadata: { name: tournee-m-refused }spec:  scope: tournee-m  table: connector.v_map_customer_m  columns: [customer_no, name]  map: { point: site }
manifests/30-customers-map.yaml
apiVersion: apps.lumnik.io/v1kind: Viewmetadata: { name: tournee-m-clients }spec:  scope: tournee-m  table: connector.v_map_customer_m  title: Clients  columns: [customer_no, name, city, coord_issue]   # latitude and longitude are not shown: the map places the row  map: { point: shop }
manifests/31-depots-map.yaml
apiVersion: apps.lumnik.io/v1kind: Viewmetadata: { name: tournee-m-depots }spec:  scope: tournee-m  table: connector.v_map_depot_m  title: Dépôts  columns: [depot_code, depot, city]  map: { point: yard }
manifests/40-app.yaml
apiVersion: apps.lumnik.io/v1kind: Appmetadata: { name: tournee-m }spec:  title: Tournée  scope: tournee-m  icon: generic  default: false  tabs: [fiches]
manifests/30-customers-map.yaml
apiVersion: apps.lumnik.io/v1kind: Viewmetadata: { name: tournee-m-clients }spec:  scope: tournee-m  table: connector.v_map_customer_m  title: Clients  columns: [customer_no, name, city, coord_issue]   # latitude and longitude are not shown: the map places the row  map: { point: shop }

Limits

  • lm view does not show the verdict: the replay reads _map at the render door.
  • Without tiles, the grid draws a line every 10°: at the scale of a region, the scale bar is the only landmark.
  • With tiles, the tile server sees the areas viewed.
  • At most 1,000 rows on the map, and the map says so beyond.
  • No route, no distance on the map, no geocoding.
  • Synthetic customers.

Sales · round

Which ones are close?

The list does not say.

17 customers, 3 depots, one GPS point per row.

Synthetic customers

The problem

A map can lie by omission.

  • A customer without a position vanishes.
  • Nobody sees it is missing.
  • The coordinates leave with the map.

The declaration

map:
  point: shop

One line in the view.

The point is the one the entity already declares.

The answers

16 customers placed, 1 counted apart.

  • The hub decides, row by row.
  • C-017 keeps its reason.
  • Latitude and longitude are not served.

The limit

Without tiles, few landmarks.

  • The default background is a grid.
  • A real map: the operator's tile server.
  • No route, no geocoding.

Try it

The scenario replays end to end.

Two connectors, two entities, two views, one app: every step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →