From bb80a1ad0ab5b302d494ec3c74b415abdb3f7dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Rodrigo?= Date: Mon, 19 Feb 2024 15:57:36 +0100 Subject: [PATCH] Add more name fields as name:xx --- bano.yml | 32 +++++++++++++++++++ bano/sql/charge_noms_voies_lieux-dits_OSM.sql | 6 ++-- bano/sql/charge_noms_voies_relation_OSM.sql | 8 ++--- .../charge_points_nommes_centroides_OSM.sql | 6 ++-- bano/sql/charge_points_nommes_places_OSM.sql | 2 +- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/bano.yml b/bano.yml index 1047956..a186933 100644 --- a/bano.yml +++ b/bano.yml @@ -14,6 +14,14 @@ tables: - {name: 'way', type: geometry} - {name: 'tags', type: hstore_tags} - {key: 'name', name: 'name', type: string} + - {key: 'name:fr', name: 'name:fr', type: string} + - {key: 'name:eu', name: 'name:eu', type: string} + - {key: 'name:br', name: 'name:br', type: string} + - {key: 'name:oc', name: 'name:oc', type: string} + - {key: 'name:de', name: 'name:de', type: string} + - {key: 'name:ca', name: 'name:ca', type: string} + - {key: 'name:gsw', name: 'name:gsw', type: string} + - {key: 'name:co', name: 'name:co', type: string} - {key: 'alt_name', name: 'alt_name', type: string} - {key: 'old_name', name: 'old_name', type: string} - {key: 'addr:housenumber', name: 'addr:housenumber', type: string} @@ -39,6 +47,14 @@ tables: - {name: 'way', type: geometry} - {name: 'tags', type: hstore_tags} - {key: 'name', name: 'name', type: string} + - {key: 'name:fr', name: 'name:fr', type: string} + - {key: 'name:eu', name: 'name:eu', type: string} + - {key: 'name:br', name: 'name:br', type: string} + - {key: 'name:oc', name: 'name:oc', type: string} + - {key: 'name:de', name: 'name:de', type: string} + - {key: 'name:ca', name: 'name:ca', type: string} + - {key: 'name:gsw', name: 'name:gsw', type: string} + - {key: 'name:co', name: 'name:co', type: string} - {key: 'alt_name', name: 'alt_name', type: string} - {key: 'old_name', name: 'old_name', type: string} - {key: 'ref:FR:FANTOIR', name: 'ref:FR:FANTOIR', type: string} @@ -62,6 +78,14 @@ tables: - {name: 'way', type: geometry} - {name: 'tags', type: hstore_tags} - {key: 'name', name: 'name', type: string} + - {key: 'name:fr', name: 'name:fr', type: string} + - {key: 'name:eu', name: 'name:eu', type: string} + - {key: 'name:br', name: 'name:br', type: string} + - {key: 'name:oc', name: 'name:oc', type: string} + - {key: 'name:de', name: 'name:de', type: string} + - {key: 'name:ca', name: 'name:ca', type: string} + - {key: 'name:gsw', name: 'name:gsw', type: string} + - {key: 'name:co', name: 'name:co', type: string} - {key: 'alt_name', name: 'alt_name', type: string} - {key: 'old_name', name: 'old_name', type: string} - {key: boundary, name: boundary, type: string} @@ -94,6 +118,14 @@ tables: - {name: 'member_index', type: member_index} - {key: 'ref:FR:FANTOIR', name: 'ref:FR:FANTOIR', type: string} - {key: 'name', name: 'name', type: string} + - {key: 'name:fr', name: 'name:fr', type: string} + - {key: 'name:eu', name: 'name:eu', type: string} + - {key: 'name:br', name: 'name:br', type: string} + - {key: 'name:oc', name: 'name:oc', type: string} + - {key: 'name:de', name: 'name:de', type: string} + - {key: 'name:ca', name: 'name:ca', type: string} + - {key: 'name:gsw', name: 'name:gsw', type: string} + - {key: 'name:co', name: 'name:co', type: string} - {key: 'alt_name', name: 'alt_name', type: string} - {key: 'old_name', name: 'old_name', type: string} - {key: 'type', name: 'type', type: string} diff --git a/bano/sql/charge_noms_voies_lieux-dits_OSM.sql b/bano/sql/charge_noms_voies_lieux-dits_OSM.sql index 437dd06..720efd5 100644 --- a/bano/sql/charge_noms_voies_lieux-dits_OSM.sql +++ b/bano/sql/charge_noms_voies_lieux-dits_OSM.sql @@ -7,7 +7,7 @@ SELECT DISTINCT provenance, nature FROM (SELECT 1::integer AS provenance, pt.way, - UNNEST(ARRAY[pt.name,pt.alt_name,pt.old_name]) as name, + UNNEST(ARRAY[pt.name,pt.alt_name,pt.old_name,pt."name:fr",pt."name:eu",pt."name:br",pt."name:oc",pt."name:de",pt."name:ca",pt."name:gsw",pt."name:co"]) as name, tags, CASE WHEN pt.place='' THEN 'voie'::text @@ -20,7 +20,7 @@ FROM (SELECT 1::integer AS provenance, UNION ALL SELECT 2, l.way, - UNNEST(ARRAY[l.name,l.alt_name,l.old_name]) as name, + UNNEST(ARRAY[l.name,l.alt_name,l.old_name,l."name:fr",l."name:eu",l."name:br",l."name:oc",l."name:de",l."name:ca",l."name:gsw",l."name:co"]) as name, tags, 'voie' FROM (SELECT way FROM planet_osm_polygon WHERE "ref:INSEE" = '__code_insee__') p @@ -29,7 +29,7 @@ FROM (SELECT 1::integer AS provenance, UNION ALL SELECT 3, pl.way, - UNNEST(ARRAY[pl.name,pl.alt_name,pl.old_name]) as name, + UNNEST(ARRAY[pl.name,pl.alt_name,pl.old_name,pl."name:fr",pl."name:eu",pl."name:br",pl."name:oc",pl."name:de",pl."name:ca",pl."name:gsw",pl."name:co"]) as name, tags, 'voie' FROM (SELECT way FROM planet_osm_polygon WHERE "ref:INSEE" = '__code_insee__') p diff --git a/bano/sql/charge_noms_voies_relation_OSM.sql b/bano/sql/charge_noms_voies_relation_OSM.sql index 229f6e8..2282b17 100644 --- a/bano/sql/charge_noms_voies_relation_OSM.sql +++ b/bano/sql/charge_noms_voies_relation_OSM.sql @@ -6,21 +6,21 @@ SELECT DISTINCT provenance, a9.nom, 'voie'::text FROM (SELECT 4::integer AS provenance, - UNNEST(ARRAY[l.name,l.alt_name,l.old_name]) as name, + UNNEST(ARRAY[l.name,l.alt_name,l.old_name,l."name:fr",l."name:eu",l."name:br",l."name:oc",l."name:de",l."name:ca",l."name:gsw",l."name:co"]) as name, l.way, r.tags FROM (SELECT way FROM planet_osm_polygon WHERE "ref:INSEE" = '__code_insee__') p - JOIN (SELECT name,alt_name,old_name,tags,osm_id,way FROM planet_osm_line WHERE highway != '' AND name != '') l + JOIN (SELECT name,alt_name,old_name,"name:fr","name:eu","name:br","name:oc","name:de","name:ca","name:gsw","name:co",tags,osm_id,way FROM planet_osm_line WHERE highway != '' AND name != '') l ON p.way && l.way AND ST_Contains(p.way, l.way) JOIN planet_osm_rels r ON r.osm_id = l.osm_id UNION ALL SELECT 5, - UNNEST(ARRAY[l.name,l.alt_name,l.old_name]) as name, + UNNEST(ARRAY[l.name,l.alt_name,l.old_name,l."name:fr",l."name:eu",l."name:br",l."name:oc",l."name:de",l."name:ca",l."name:gsw",l."name:co"]) as name, l.way, r.tags FROM (SELECT way FROM planet_osm_polygon WHERE "ref:INSEE" = '__code_insee__') p - JOIN (SELECT name,alt_name,old_name,tags,osm_id,way FROM planet_osm_polygon WHERE highway != '' AND name != '') l + JOIN (SELECT name,alt_name,old_name,"name:fr","name:eu","name:br","name:oc","name:de","name:ca","name:gsw","name:co",tags,osm_id,way FROM planet_osm_polygon WHERE highway != '' AND name != '') l ON p.way && l.way AND ST_Contains(p.way, l.way) JOIN planet_osm_rels r ON r.osm_id = l.osm_id) l diff --git a/bano/sql/charge_points_nommes_centroides_OSM.sql b/bano/sql/charge_points_nommes_centroides_OSM.sql index a8e661e..3261775 100644 --- a/bano/sql/charge_points_nommes_centroides_OSM.sql +++ b/bano/sql/charge_points_nommes_centroides_OSM.sql @@ -2,7 +2,7 @@ WITH lignes_brutes AS (SELECT l.way, - unnest(array[l.name,l.alt_name,l.old_name]) AS name, + unnest(array[l.name,l.alt_name,l.old_name,l."name:fr",l."name:eu",l."name:br",l."name:oc",l."name:de",l."name:ca",l."name:gsw",l."name:co"]) AS name, COALESCE(a9.code_insee,'xxxxx') as insee_jointure, a9.code_insee insee_ac, unnest(array["ref:FR:FANTOIR","ref:FR:FANTOIR:left","ref:FR:FANTOIR:right"]) AS fantoir, @@ -19,7 +19,7 @@ WHERE (l.highway != '' OR l.name != '' UNION ALL SELECT ST_PointOnSurface(l.way), - unnest(array[l.name,l.alt_name,l.old_name]) AS name, + unnest(array[l.name,l.alt_name,l.old_name,l."name:fr",l."name:eu",l."name:br",l."name:oc",l."name:de",l."name:ca",l."name:gsw",l."name:co"]) AS name, COALESCE(a9.code_insee,'xxxxx') as insee_jointure, a9.code_insee insee_ac, "ref:FR:FANTOIR" AS fantoir, @@ -35,7 +35,7 @@ WHERE (l.highway||"ref:FR:FANTOIR" != '' OR l.landuse = 'residential' OR l.ame l.name != '' UNION ALL SELECT l.way, - unnest(array[l.name,l.alt_name,l.old_name]) AS name, + unnest(array[l.name,l.alt_name,l.old_name,l."name:fr",l."name:eu",l."name:br",l."name:oc",l."name:de",l."name:ca",l."name:gsw",l."name:co"]) AS name, COALESCE(a9.code_insee,'xxxxx') as insee_jointure, a9.code_insee insee_ac, "ref:FR:FANTOIR" AS fantoir, diff --git a/bano/sql/charge_points_nommes_places_OSM.sql b/bano/sql/charge_points_nommes_places_OSM.sql index c0c7e35..d7b1a12 100644 --- a/bano/sql/charge_points_nommes_places_OSM.sql +++ b/bano/sql/charge_points_nommes_places_OSM.sql @@ -2,7 +2,7 @@ WITH pts AS (SELECT pt.way, - UNNEST(ARRAY[pt.name,pt.alt_name,pt.old_name]) as name, + UNNEST(ARRAY[pt.name,pt.alt_name,pt.old_name,pt."name:fr",pt."name:eu",pt."name:br",pt."name:oc",pt."name:de",pt."name:ca",pt."name:gsw",pt."name:co"]) as name, tags, place, a9.code_insee AS insee_ac,