diff --git a/original/oldenburg.geojson b/original/oldenburg.geojson index cfecbbd..b904598 100644 --- a/original/oldenburg.geojson +++ b/original/oldenburg.geojson @@ -4,74 +4,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgaerztehaus", - "name": "Ärztehaus", - "type": "lot", - "public_url": null, - "source_url": null, - "address": "Brandenburger Straße 21", - "capacity": null, - "has_live_capacity": false - }, - "geometry": { - "type": "Point", - "coordinates": [ - 8.21986, - 53.11142 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "oldenburgccoparkdeck1", - "name": "CCO Parkdeck 1", - "type": "level", - "public_url": null, - "source_url": null, - "address": "Heiligengeiststraße 4", - "capacity": 190, - "has_live_capacity": false - }, - "geometry": { - "type": "Point", - "coordinates": [ - 8.21322, - 53.14406 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "oldenburgccoparkdeck2", - "name": "CCO Parkdeck 2", - "type": "level", - "public_url": null, - "source_url": null, - "address": "Heiligengeiststraße 4", - "capacity": 230, - "has_live_capacity": false - }, - "geometry": { - "type": "Point", - "coordinates": [ - 8.21322, - 53.14406 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "oldenburgcinemaxx", + "id": "oldenburgparkhausalterstadthafencinemaxx", "name": "Cinemaxx", "type": "garage", "public_url": null, "source_url": null, "address": "Stau 79-85", "capacity": 0, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -84,14 +24,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgcity", + "id": "oldenburgcityparkhausstaulinie", "name": "City", "type": "garage", "public_url": null, "source_url": null, "address": "Staulinie 10", "capacity": 440, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -104,14 +44,14 @@ { "type": "Feature", "properties": { - "id": "oldenburggaleriakaufhof", + "id": "oldenburgparkhausgaleriakaufhof", "name": "Galeria Kaufhof", "type": "garage", "public_url": null, "source_url": null, "address": "Ritterstraße", "capacity": 326, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -124,14 +64,14 @@ { "type": "Feature", "properties": { - "id": "oldenburghbfzob", + "id": "oldenburgparkhausbahnhofzob", "name": "Hbf/ZOB", "type": "garage", "public_url": null, "source_url": null, "address": "Karlstraße", "capacity": 358, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -144,14 +84,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgheiligengeisthoefe", + "id": "oldenburgparkhausheiligengeisthoefe", "name": "Heiligengeist-Höfe", "type": "garage", "public_url": null, "source_url": null, "address": "Georgstraße", "capacity": 275, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -164,14 +104,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgpferdemarkt", + "id": "oldenburgparkplatzpferdemarkt", "name": "Pferdemarkt", "type": "lot", "public_url": null, "source_url": null, "address": "Pferdemarkt 13", "capacity": 401, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -184,14 +124,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgschlosshoefe", + "id": "oldenburgparkhausschlosshoefe", "name": "Schlosshöfe", "type": "garage", "public_url": null, "source_url": null, "address": "Mühlenstraße", "capacity": 430, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -204,14 +144,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgtheatergarage", + "id": "oldenburgparkhaustheatergarage", "name": "Theatergarage", "type": "garage", "public_url": null, "source_url": null, "address": "Roonstraße", "capacity": 107, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -224,14 +164,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgtheaterwall", + "id": "oldenburgparkplatztheaterwall", "name": "Theaterwall", "type": "lot", "public_url": null, "source_url": null, "address": "Theaterwall 4", "capacity": 125, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -244,14 +184,14 @@ { "type": "Feature", "properties": { - "id": "oldenburgwaffenplatz", + "id": "oldenburgparkhausamwaffenplatz", "name": "Waffenplatz", "type": "garage", "public_url": null, "source_url": null, "address": "Waffenplatz 3", "capacity": 650, - "has_live_capacity": false + "has_live_capacity": true }, "geometry": { "type": "Point", @@ -260,6 +200,28 @@ 53.14169 ] } + }, + { + "type": "Feature", + "properties": { + "id": "oldenburgparkhausaugustcarrée", + "name": "August Carrée", + "type": "garage", + "public_url": null, + "source_url": null, + "address": "Auguststraße 7", + "capacity": 650, + "has_live_capacity": true + }, + "geometry": { + "type": "Point", + "coordinates": [ + 8.2032572, + 53.1426765 + ] + } } + ] -} \ No newline at end of file +} + diff --git a/original/oldenburg.py b/original/oldenburg.py index f561256..ae363df 100644 --- a/original/oldenburg.py +++ b/original/oldenburg.py @@ -12,7 +12,7 @@ class Oldenburg(ScraperBase): id="oldenburg", name="Oldenburg", public_url="https://oldenburg-service.de/pls/", - source_url="https://oldenburg-service.de/pls2.php", + source_url="https://oldenburg-service.de/pls.php", timezone="Europe/Berlin", attribution_contributor="Stadt Oldenburg", attribution_license=None, @@ -29,8 +29,10 @@ def get_lot_data(self) -> List[LotData]: last_updated = str(soup.select("body")) start = last_updated.find("Letzte Aktualisierung:") + 23 last_updated = self.to_utc_datetime(last_updated[start:start + 16]) - - for tr in soup.find_all("tr"): + + table = soup.find_all("table") +# The site now uses 2 tables. Table 1 holds the last updated info, table 2 the actual data. Tables dont have any ID or Class so we use 0 and 1 + for tr in table[1].find_all("tr"): if tr.td is None: continue @@ -38,21 +40,21 @@ def get_lot_data(self) -> List[LotData]: parking_name = td[0].string # work-around for the Umlaute-problem: ugly but working if 'Heiligengeist-' in parking_name: - parking_name = 'Heiligengeist-Höfe' + parking_name = 'Parkhaus Heiligengeist-Höfe' elif 'Schlossh' in parking_name: - parking_name = 'Schlosshöfe' - elif 'Aerztehaus' == parking_name: - parking_name = 'Ärztehaus' + parking_name = 'Parkhaus Schlosshöfe' + elif 'August Carr' == parking_name: + parking_name = 'Parkhaus August Carrée' parking_free = None parking_state = LotData.Status.open - if 'Geschlossen' in td[3].text: + if 'Geschlossen' in td[4].text: parking_state = LotData.Status.closed try: - parking_free = int(td[1].text) + parking_free = int(td[2].text) except: parking_state = LotData.Status.nodata - + parking_capacity = int(td[1].text) lots.append( LotData( timestamp=timestamp, @@ -60,6 +62,7 @@ def get_lot_data(self) -> List[LotData]: id=name_to_legacy_id("oldenburg", parking_name), status=parking_state, num_free=parking_free, + capacity=parking_capacity ) )