Commit 943741dc authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Themes for recycling #5, drinking water, toilets #2, update parking #6

parent e2e2814c
......@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Next version (to be released)
## Added
- New themes : toilets, drinking water, recycling
## Changed
- Improvements in charging stations theme (Official and OSM ID distinction, more socket types)
- Update of parking theme to use latest Etalab scheme version
## 0.2.0 - 2020-03-09
......
......@@ -13,7 +13,9 @@ local polygon_keys = {
'historic',
'addr:housenumber',
'internet_access',
'carpool'
'carpool',
'waterway',
'drinking_water'
}
-- Objects without any of the following keys will be deleted
......@@ -37,6 +39,9 @@ local generic_keys = {
'addr:housenumber',
'internet_access',
'carpool',
'toilets',
'waterway',
'drinking_water',
'type'
}
......@@ -77,6 +82,9 @@ tables.point = osm2pgsql.define_table{
{ column = 'addr:housenumber', type = 'text' },
{ column = 'internet_access', type = 'text' },
{ column = 'carpool', type = 'text' },
{ column = 'toilets', type = 'text' },
{ column = 'drinking_water', type = 'text' },
{ column = 'waterway', type = 'text' },
{ column = 'tags', type = 'hstore' },
{ column = 'rel_tags', type = 'hstore' },
{ column = 'way', type = 'point' }
......@@ -128,6 +136,9 @@ tables.polygon = osm2pgsql.define_table{
{ column = 'addr:housenumber', type = 'text' },
{ column = 'internet_access', type = 'text' },
{ column = 'carpool', type = 'text' },
{ column = 'toilets', type = 'text' },
{ column = 'drinking_water', type = 'text' },
{ column = 'waterway', type = 'text' },
{ column = 'tags', type = 'hstore' },
{ column = 'rel_tags', type = 'hstore' },
{ column = 'way', type = 'geometry' }
......
--METADATA={ "name:fr": "Point d'eau potable", "name:en": "Drinking water", "theme:fr": "Infrastructures", "keywords:fr": [ "eau", "eau potable", "robinet" ], "description:fr": "Point d'accès à l'eau potable issus d'OpenStreetMap (amenity=drinking_water|water_point ou drinking_water=yes|treated ou waterway=water_point)" }
--GEOMETRY=point,polygon
SELECT
<OSMID> as osm_id,
t.tags->'name' AS name,
t.tags->'operator' AS operator,
t.tags->'bottle' AS accepts_bottle,
t.tags->'indoor' AS indoor,
t.tags->'cold_water' AS offers_cold_water,
t.tags->'warmd_water' AS offers_warm_water,
t.tags->'hot_water' AS offers_hot_water,
t.tags->'fee' AS fee,
t.tags->'description' AS description,
<ADM8REF> AS com_insee, <ADM8NAME> AS com_nom, <GEOM>
FROM <TABLE>
WHERE
(t.amenity IN('drinking_water', 'water_point') OR t.drinking_water IN ('yes', 'treated') OR t.waterway = 'water_point')
AND <GEOMCOND>
--METADATA={ "name:fr": "Parking (schéma Étalab Stationnement 0.1.0)", "name:en": "Parking", "theme:fr": "Transports", "keywords:fr": [ "parking" ], "description:fr": "Lieux de stationnement (vélo, voiture, deux roues) issus d'OpenStreetMap (amenity=parking|parking_space|bicycle_parking|motorcycle_parking|car_sharing) selon le schéma Stationnement de transport.data.gouv.fr", "skipGeomCSV": true }
--METADATA={ "name:fr": "Parking (schéma Étalab Stationnement 0.1.3)", "name:en": "Parking", "theme:fr": "Transports", "keywords:fr": [ "parking" ], "description:fr": "Lieux de stationnement (vélo, voiture, deux roues) issus d'OpenStreetMap (amenity=parking|parking_space|bicycle_parking|motorcycle_parking|car_sharing) selon le schéma Stationnement de transport.data.gouv.fr", "skipGeomCSV": true }
--GEOMETRY=point,polygon
SELECT
<OSMID> AS id,
t.tags->'ref:FR:BNLS' AS id,
t.tags->'name' AS nom,
<ADM8REF> AS insee,
CASE WHEN t.tags->'addr:housenumber' IS NOT NULL AND t.tags->'addr:street' IS NOT NULL THEN concat(t.tags->'addr:housenumber', ' ', t.tags->'addr:street', ',', <ADM8NAME>) END AS adresse,
COALESCE(t.tags->'website', t.tags->'contact:website') AS url,
'tous' AS type_usagers,
CASE
WHEN t.tags->'fee' = 'no' OR t.tags->'fee' IS NULL THEN true
ELSE false
WHEN t.tags->'fee' = 'no' OR t.tags->'fee' IS NULL THEN 'true'
ELSE 'false'
END AS gratuit,
CASE WHEN t.amenity = 'parking' THEN t.tags->'capacity' END AS nb_places,
'' AS nb_pr,
......@@ -33,8 +33,12 @@ SELECT
'' AS tarif_24h,
'' AS abo_resident,
'' AS abo_non_resident,
t.tags->'parking' AS type_ouvrage,
COALESCE(t.tags->'description', t.tags->'note') AS info,
CASE
WHEN t.tags->'parking' = 'surface' THEN 'enclos_en_surface'
WHEN t.tags->'parking' IN ('multi-storey', 'underground', 'rooftop', 'sheds', 'carports', 'garage_boxes') THEN 'ouvrage'
ELSE ''
END AS type_ouvrage,
TRIM(CONCAT(<OSMID>, ' ', COALESCE(t.tags->'description', t.tags->'note'))) AS info,
<GEOM>
FROM <TABLE>
WHERE
......
--METADATA={ "name:fr": "Recyclage (déchèteries et point d'apports)", "name:en": "Recycling", "theme:fr": "Environnement", "keywords:fr": [ "recyclage", "point d'apport volontaire", "pav", "borne recyclage", "déchèterie" ], "description:fr": "Équipements pour le recyclage issus d'OpenStreetMap (amenity=recycling)" }
--GEOMETRY=point,polygon
SELECT
<OSMID> as osm_id,
t.tags->'recycling_type' AS type,
t.tags->'name' AS name,
t.tags->'ref' AS "ref",
t.tags->'operator' AS operator,
t.tags->'opening_hours' AS opening_hours,
t.tags->'recycling:glass' AS glass,
COALESCE(t.tags->'recycling:glass_bottles', t.tags->'recycling:glass_jars') AS glass_bottles,
t.tags->'recycling:paper' AS paper,
COALESCE(t.tags->'recycling:clothes', t.tags->'recycling:textiles') AS clothes,
t.tags->'recycling:cans' AS cans,
t.tags->'recycling:plastic_bottles' AS plastic_bottles,
COALESCE(t.tags->'recycling:plastic', t.tags->'recycling:PET') AS plastic,
t.tags->'recycling:waste' AS waste,
COALESCE(t.tags->'recycling:cardboard', t.tags->'recycling:cartons') AS cardboard,
t.tags->'recycling:plastic_packaging' AS plastic_packaging,
t.tags->'recycling:batteries' AS batteries,
COALESCE(t.tags->'recycling:scrap_metal', t.tags->'recycling:metal') AS metal,
COALESCE(t.tags->'recycling:newspaper', t.tags->'recycling:magazines') AS newspaper,
t.tags->'recycling:paper_packaging' AS paper_packaging,
COALESCE(t.tags->'recycling:green_waste', t.tags->'recycling:garden_waste') AS green_waste,
t.tags->'recycling:shoes' AS shoes,
t.tags->'recycling:organic' AS organic,
t.tags->'recycling:books' AS books,
t.tags->'recycling:electrical_appliances' AS electrical_appliances,
t.tags->'recycling:beverages_cartons' AS beverages_cartons,
t.tags->'recycling:small_appliances' AS small_appliances,
t.tags->'recycling:wood' AS wood,
t.tags->'recycling:aluminium' AS aluminium,
t.tags->'recycling:computers' AS computers,
t.tags->'recycling:toys' AS toys,
<ADM8REF> AS com_insee, <ADM8NAME> AS com_nom, <GEOM>
FROM <TABLE>
WHERE t.amenity = 'recycling' AND <GEOMCOND>
--METADATA={ "name:fr": "Toilettes", "name:en": "Toilets", "theme:fr": "Infrastructures", "keywords:fr": [ "toilettes", "wc" ], "description:fr": "Toilettes publiques ou dans des établissements recevant du public issues d'OpenStreetMap (amenity=toilets ou toilets=yes, avec access!=private)" }
--GEOMETRY=point,polygon
SELECT
<OSMID> as osm_id,
CASE WHEN t.amenity = 'toilets' THEN 'toilettes_publiques' ELSE 'toilettes_erp' END AS type,
t.tags->'name' AS name,
t.tags->'operator' AS operator,
COALESCE(t.tags->'toilets:wheelchair', t.wheelchair) AS wheelchair,
COALESCE(t.tags->'toilets:access', t.tags->'access') AS access,
COALESCE(t.tags->'toilets:opening_hours', t.tags->'opening_hours') AS opening_hours,
COALESCE(t.tags->'toilets:fee', t.tags->'fee') AS fee,
COALESCE(t.tags->'toilets:supervised', t.tags->'supervised') AS supervised,
COALESCE(t.tags->'toilets:unisex', t.tags->'unisex') AS for_everyone,
COALESCE(t.tags->'toilets:child', t.tags->'child') AS for_child,
COALESCE(t.tags->'toilets:female', t.tags->'female') AS for_women,
COALESCE(t.tags->'toilets:male', t.tags->'male') AS for_men,
t.tags->'drinking_water' AS drinking_water,
t.tags->'toilets:disposal' AS toilets_disposal,
t.tags->'toilets:position' AS toilets_position,
t.tags->'toilets:paper_supplied' AS paper_supplied,
t.tags->'toilets:handwashing' AS handwashing,
t.tags->'changing_table' AS changing_table,
<ADM8REF> AS com_insee, <ADM8NAME> AS com_nom, <GEOM>
FROM <TABLE>
WHERE
(t.amenity = 'toilets' OR t.toilets = 'yes')
AND (t.access IS NULL OR t.access != 'private')
AND <GEOMCOND>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment