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

Update Lot Infos #26

Open
wants to merge 3 commits into
base: master
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
44 changes: 42 additions & 2 deletions new/bochum.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"geometry": {
"type": "Point",
"coordinates": [
7.21582,
51.48043
7.21589,
51.48017
]
}
},
Expand Down Expand Up @@ -101,6 +101,26 @@
]
}
},
{
"type": "Feature",
"properties": {
"id": "bochum-17",
"name": "PH Husemann Karree",
"type": "garage",
"public_url": "https://www.parken-in-bochum.de/parkhaeuser/parkhaus/ph-husemann-karree/",
"source_url": "https://www.parken-in-bochum.de/parkhaeuser/",
"address": "Bochumer Innenstadt, zwischen Kortumstraße (Fußgängerzone) und Junggesellenstraße",
"capacity": 510,
"has_live_capacity": false
},
"geometry": {
"type": "Point",
"coordinates": [
7.2159511,
51.4800041
]
}
},
{
"type": "Feature",
"properties": {
Expand Down Expand Up @@ -201,6 +221,26 @@
]
}
},
{
"type": "Feature",
"properties": {
"id": "bochum-7",
"name": "P7 Kurt-Schumacher-Platz",
"type": "garage",
"public_url": "https://www.parken-in-bochum.de/parkhaeuser/parkhaus/p7-kurt-schumacher-platz/",
"source_url": "https://www.parken-in-bochum.de/parkhaeuser/",
"address": "Bochumer Innenstadt, direkt am Hauptbahnhof",
"capacity": 432,
"has_live_capacity": false
},
"geometry": {
"type": "Point",
"coordinates": [
7.221024,
51.4781061
]
}
},
{
"type": "Feature",
"properties": {
Expand Down
9 changes: 8 additions & 1 deletion original/kaiserslautern.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class Kaiserslautern(ScraperBase):
)

def get_lot_data(self) -> List[LotData]:
# The folowing parkings have been renamed and need to be mapped
# to their legacy_id
LOT_NAME_TO_LEGACY_ID_MAPPPING = {
"PH Sparkasse": "phkreissparkasse"
}

timestamp = self.now()
soup = self.request_soup(self.POOL.source_url)

Expand All @@ -29,7 +35,8 @@ def get_lot_data(self) -> List[LotData]:
last_updated = self.to_utc_datetime(soup.find("zeitstempel").text)

for ph in soup.find_all("parkhaus"):
lot_name = ph.find("name").text
lot_name_source = ph.find("name").text
lot_name = LOT_NAME_TO_LEGACY_ID_MAPPPING.get(lot_name_source, lot_name_source)
lot_actual = int(ph.find("aktuell").text)
lot_total = int(ph.find("gesamt").text)

Expand Down
100 changes: 30 additions & 70 deletions original/luebeck.geojson
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"id": "luebeckamburgtor",
"name": "Am Burgtor",
"type": "garage",
"public_url": "https://www.parken-luebeck.de/detail/ph-am-burgtor/",
"source_url": null,
"address": "Kanalstraße 1-5\n23552 Lübeck",
"capacity": 99,
"has_live_capacity": true
},
"geometry": {
"type": "Point",
"coordinates": [
10.692226,
53.873013
]
}
},
{
"type": "Feature",
"properties": {
Expand All @@ -30,7 +10,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-am-fischereihafen/",
"source_url": null,
"address": "Travemünder Landstraße\n23570 Travemünde",
"capacity": 358,
"capacity": 393,
"has_live_capacity": true
},
"geometry": {
Expand Down Expand Up @@ -101,26 +81,6 @@
]
}
},
{
"type": "Feature",
"properties": {
"id": "luebeckfalkenstrasse",
"name": "Falkenstraße",
"type": "garage",
"public_url": "https://www.parken-luebeck.de/detail/ph-falkenstrasse/",
"source_url": null,
"address": "Falkenstraße 27\n23564 Lübeck",
"capacity": 130,
"has_live_capacity": true
},
"geometry": {
"type": "Point",
"coordinates": [
10.698406,
53.870015
]
}
},
{
"type": "Feature",
"properties": {
Expand Down Expand Up @@ -150,7 +110,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-hafenbahnhof/",
"source_url": null,
"address": "Vogteistraße\n23570 Travemünde",
"capacity": 57,
"capacity": 46,
"has_live_capacity": true
},
"geometry": {
Expand All @@ -170,7 +130,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-kanalstrasse-p1/",
"source_url": null,
"address": "Kanalstraße\n23552 Lübeck",
"capacity": 105,
"capacity": 107,
"has_live_capacity": true
},
"geometry": {
Expand All @@ -190,7 +150,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-kanalstrasse-p2/",
"source_url": null,
"address": "Kanalstraße\n23552 Lübeck",
"capacity": 216,
"capacity": 204,
"has_live_capacity": true
},
"geometry": {
Expand All @@ -210,7 +170,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-kanalstrasse-p3/",
"source_url": null,
"address": "Kanalstraße\n23552 Lübeck",
"capacity": 160,
"capacity": 122,
"has_live_capacity": true
},
"geometry": {
Expand Down Expand Up @@ -250,7 +210,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-kanalstrasse-p5/",
"source_url": null,
"address": "Kanalstraße\n23560 Lübeck",
"capacity": 45,
"capacity": 46,
"has_live_capacity": true
},
"geometry": {
Expand Down Expand Up @@ -290,7 +250,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-lastadie-p3/",
"source_url": null,
"address": "Willy-Brandt-Allee\n23554 Lübeck",
"capacity": 33,
"capacity": 35,
"has_live_capacity": true
},
"geometry": {
Expand All @@ -301,26 +261,6 @@
]
}
},
{
"type": "Feature",
"properties": {
"id": "luebecklastadiep5",
"name": "Lastadie P5",
"type": "lot",
"public_url": "https://www.parken-luebeck.de/detail/pp-lastadie-p5/",
"source_url": null,
"address": "Willy-Brandt-Allee\n23554 Lübeck",
"capacity": 254,
"has_live_capacity": true
},
"geometry": {
"type": "Point",
"coordinates": [
10.67872,
53.87153
]
}
},
{
"type": "Feature",
"properties": {
Expand All @@ -330,7 +270,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-leuchtenfeld/",
"source_url": null,
"address": "Trelleborgallee\n23570 Travemünde",
"capacity": 528,
"capacity": 550,
"has_live_capacity": true
},
"geometry": {
Expand Down Expand Up @@ -390,7 +330,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-muk/",
"source_url": null,
"address": "Willy-Brandt-Alle (Nähe 10)\n23554 Lübeck",
"capacity": 330,
"capacity": 350,
"has_live_capacity": true
},
"geometry": {
Expand Down Expand Up @@ -430,7 +370,7 @@
"public_url": "https://www.parken-luebeck.de/detail/pp-radisson-blue/",
"source_url": null,
"address": "Willy-Brandt-Alle (Nähe 8)\n23554 Lübeck",
"capacity": 57,
"capacity": 61,
"has_live_capacity": true
},
"geometry": {
Expand Down Expand Up @@ -460,6 +400,26 @@
53.868977
]
}
},
{
"type": "Feature",
"properties": {
"id": "luebeckbeachbaypriwall",
"name": "BeachBay / Priwall",
"type": "garage",
"public_url": "https://www.parken-luebeck.de/detail/parkhaus-beachbay-parkhaus-priwall/",
"source_url": null,
"address": "Dünenweg 2a\n23570 Travemünde",
"capacity": 283,
"has_live_capacity": true
},
"geometry": {
"type": "Point",
"coordinates": [
10.8817,
53.954689
]
}
}
]
}
Loading