Skip to content

Commit 4197858

Browse files
committed
Add Grenoble bike parking integration
1 parent 6da9eea commit 4197858

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env python
2+
#-*- coding: utf-8 -*-
3+
4+
###########################################################################
5+
## ##
6+
## Copyrights XioNoX 2024 ##
7+
## ##
8+
## This program is free software: you can redistribute it and/or modify ##
9+
## it under the terms of the GNU General Public License as published by ##
10+
## the Free Software Foundation, either version 3 of the License, or ##
11+
## (at your option) any later version. ##
12+
## ##
13+
## This program is distributed in the hope that it will be useful, ##
14+
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
15+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
16+
## GNU General Public License for more details. ##
17+
## ##
18+
## You should have received a copy of the GNU General Public License ##
19+
## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
20+
## ##
21+
###########################################################################
22+
23+
from datetime import datetime
24+
25+
from modules.OsmoseTranslation import T_
26+
from .Analyser_Merge import Analyser_Merge_Point, SourceDataGouv, GeoJSON, Load_XY, Conflate, Select, Mapping
27+
28+
class Analyser_Merge_Bicycle_Parking_FR_Grenoble(Analyser_Merge_Point):
29+
def __init__(self, config, logger = None):
30+
Analyser_Merge_Point.__init__(self, config, logger)
31+
self.def_class_missing_official(item = 8150, id = 1, level = 3, tags = ['merge', 'public equipment', 'bicycle', 'fix:survey', 'fix:picture'],
32+
title = T_('Bicycle parking not integrated'))
33+
self.def_class_possible_merge(item = 8151, id = 3, level = 3, tags = ['merge', 'public equipment', 'bicycle', 'fix:survey', 'fix:picture'],
34+
title = T_('Bicycle parking integration suggestion'))
35+
self.def_class_update_official(item = 8152, id = 4, level = 3, tags = ['merge', 'public equipment', 'bicycle', 'fix:survey', 'fix:picture'],
36+
title = T_('Bicycle parking update'))
37+
self.init(
38+
"https://www.data.gouv.fr/fr/datasets/parcs-de-stationnement-velos-de-la-metropole-de-lyon/",
39+
"Localisation des stationnements vélos connus sur le territoire de la Métropole de Lyon",
40+
GeoJSON(
41+
SourceDataGouv(
42+
attribution="data.gouv.fr:Grenoble-Alpes Métropole",
43+
dataset="658053a53e68b91a5a3a5a21",
44+
resource="c9723a83-0ae4-4266-9fbe-ec01da2bb8b8"),
45+
),
46+
Load_XY("geom_x", "geom_y"),
47+
Conflate(
48+
select = Select(
49+
types = ["nodes", "ways"],
50+
tags = {"amenity": "bicycle_parking"}),
51+
conflationDistance = 10,
52+
mapping = Mapping(
53+
static1 = {
54+
"amenity": "bicycle_parking",
55+
"bicycle_parking": "stands",
56+
},
57+
static2 = {
58+
"source": self.source,
59+
"operator": "Grenoble-Alpes Métropole",
60+
},
61+
mapping1 = {
62+
"capacity": lambda res: int(res.get("mob_arce_nb"))*2,
63+
},
64+
mapping2 = {
65+
"start_date": lambda res: datetime.strptime(res.get("mob_arce_datecre"), "%Y%m%d%H%M%S").strftime("%Y-%m-%d"),
66+
"ref:FR:GrenobleAlpesMetropole": "mob_arce_id",
67+
}
68+
)
69+
)
70+
)

osmose_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,10 @@ class gen(default_country):
503503
france_departement("rhone_alpes/ain", 7387, "FR-01")
504504
france_departement("rhone_alpes/ardeche", 7430, "FR-07")
505505
france_departement("rhone_alpes/drome", 7434, "FR-26")
506-
france_departement("rhone_alpes/isere", 7437, "FR-38")
506+
france_departement("rhone_alpes/isere", 7437, "FR-38", include=[
507+
# Grenoble
508+
'merge_bicycle_parking_FR_grenoble',
509+
])
507510
france_departement("rhone_alpes/loire", 7420, "FR-42")
508511
france_departement("rhone_alpes/rhone", 7378, "FR-69", include=[
509512
# Lyon

0 commit comments

Comments
 (0)