Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use locale name fields #400

Open
wants to merge 1 commit into
base: bano_v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bano/sql/charge_noms_voies_lieux-dits_OSM.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions bano/sql/charge_noms_voies_relation_OSM.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bano/sql/charge_points_nommes_centroides_OSM.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions bano/sql/charge_points_nommes_places_OSM.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -20,7 +20,7 @@ WHERE admin_centre.osm_id IS NULL),
pts_hors_commune
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,
null::text AS insee_ac,
Expand All @@ -33,7 +33,7 @@ ON pt.way && p.way AND
polys
AS
(SELECT st_centroid(pt.way) AS 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,
Expand Down