Skip to content

Commit

Permalink
Merge pull request #5798 from leonardehrenfried/bikeep
Browse files Browse the repository at this point in the history
Add Bikeep bicycle parking updater
  • Loading branch information
leonardehrenfried authored Apr 26, 2024
2 parents a6d8e41 + 091e4ed commit 0859b64
Show file tree
Hide file tree
Showing 12 changed files with 609 additions and 48 deletions.
5 changes: 4 additions & 1 deletion doc-templates/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Contact Info

- For HSL Park and Ride updater: Digitransit team, HSL, Helsinki, Finland
- For Bikely and NOI updater: Leonard Ehrenfried, [[email protected]](mailto:[email protected])
- For Bikely, NOI and Bikeep updater: Leonard Ehrenfried, [[email protected]](mailto:[email protected])


## Documentation
Expand Down Expand Up @@ -44,6 +44,9 @@ All updaters have the following parameters in common:

<!-- INSERT: noi-open-data-hub -->

## Bikeep

<!-- INSERT: bikeep -->

## Changelog

Expand Down
6 changes: 6 additions & 0 deletions docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,12 @@ Used to group requests when monitoring OTP.
"fromDateTime" : "-P1D",
"timeout" : 300000
}
},
{
"type" : "vehicle-parking",
"feedId" : "bikeep",
"sourceType" : "bikeep",
"url" : "https://services.bikeep.com/location/v1/public-areas/no-baia-mobility/locations"
}
],
"rideHailingServices" : [
Expand Down
152 changes: 106 additions & 46 deletions docs/sandbox/VehicleParking.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.opentripplanner.ext.vehicleparking.bikeep;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.time.Duration;
import java.util.Set;
import org.junit.jupiter.api.Test;
import org.opentripplanner.test.support.ResourceLoader;
import org.opentripplanner.updater.spi.HttpHeaders;

class BikeepUpdaterTest {

@Test
void parse() {
var uri = ResourceLoader.of(this).uri("bikeep.json");
var parameters = new BikeepUpdaterParameters(
"bikeep",
uri,
"bikeep",
Duration.ofSeconds(30),
HttpHeaders.empty()
);
var updater = new BikeepUpdater(parameters);
updater.update();
var lots = updater.getUpdates();

assertEquals(9, lots.size());

lots.forEach(l -> assertNotNull(l.getName()));

var first = lots.getFirst();
assertEquals("bikeep:224121", first.getId().toString());
assertEquals("(60.40593, 4.99634)", first.getCoordinate().toString());
assertEquals("Ågotnes Terminal", first.getName().toString());
assertEquals(10, first.getAvailability().getBicycleSpaces());
assertEquals(10, first.getCapacity().getBicycleSpaces());
assertEquals(Set.of("FREE", "PRIVATE", "BIKE", "BOOKABLE"), first.getTags());

var last = lots.getLast();
assertEquals("bikeep:224111", last.getId().toString());
assertEquals("(59.88741, 10.5205)", last.getCoordinate().toString());
assertEquals("Sandvika Storsenter Nytorget", last.getName().toString());
assertEquals(13, last.getAvailability().getBicycleSpaces());
assertEquals(15, last.getCapacity().getBicycleSpaces());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
4.996344,
60.405932
]
},
"properties": {
"code": "224121",
"label": "Ågotnes Terminal",
"name": "#224121 Ågotnes Terminal",
"address": "Ågotnes",
"tags": [
"FREE",
"BIKE",
"PRIVATE",
"BOOKABLE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 10,
"online": 10,
"total": 10
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.666802,
59.436443
]
},
"properties": {
"code": "226261",
"label": "Gågata Østre",
"name": "#226261 Gågata Østre",
"address": "Dronningens gate, Moss",
"tags": [
"FREE",
"PRIVATE",
"BOOKABLE",
"BIKE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 7,
"online": 10,
"total": 10
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.661444,
59.435401
]
},
"properties": {
"code": "226259",
"label": "Gågata Vestre",
"name": "#226259 Gågata Vestre",
"address": "Dronningens gate, Moss",
"tags": [
"BIKE",
"FREE",
"PRIVATE",
"BOOKABLE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 5,
"online": 5,
"total": 5
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.774958,
59.946535
]
},
"properties": {
"code": "223443",
"label": "Storo Storsenter",
"name": "#223443 Storo Storsenter",
"address": "Norway",
"tags": [
"BIKE",
"PRIVATE",
"BOOKABLE",
"FREE"
],
"icon": {
"png": "https://assets.bikeep.com/locations/icons/bikeep.png",
"png2x": "https://assets.bikeep.com/locations/icons/[email protected]",
"svg": ""
},
"parking": {
"available": 17,
"online": 20,
"total": 20
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.501222,
59.914578
]
},
"properties": {
"code": "224519",
"label": "Kolsås Sykkelhotell",
"name": "#224519 Kolsås Sykkelhotell",
"address": "Norway",
"tags": [
"PRIVATE",
"FREE",
"BOOKABLE",
"BIKE_HOUSE",
"BIKE"
],
"icon": {
"png": "https://assets.bikeep.com/locations/icons/bikeep.png",
"png2x": "https://assets.bikeep.com/locations/icons/[email protected]",
"svg": ""
},
"parking": {
"available": 13,
"online": 22,
"total": 22
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.663716,
59.435539
]
},
"properties": {
"code": "226260",
"label": "Gågata Midtre",
"name": "#226260 Gågata Midtre",
"address": "Dronningens gate, Moss",
"tags": [
"FREE",
"BOOKABLE",
"PRIVATE",
"BIKE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 5,
"online": 5,
"total": 5
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
5.320344,
60.463246
]
},
"properties": {
"code": "226266",
"label": "Åsane Sykkelhus",
"name": "#226266 Åsane Sykkelhus",
"address": "Åsane terminal",
"tags": [
"BOOKABLE",
"BIKE",
"FREE",
"PRIVATE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 11,
"online": 12,
"total": 12
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.521137,
59.889181
]
},
"properties": {
"code": "224112",
"label": "Sandvika Storsenter Kjørbokollen",
"name": "#224112 Sandvika Storsenter Kjørbokollen",
"address": "Brodtkorbsgate 7, Sandvika",
"tags": [
"PRIVATE",
"FREE",
"BIKE",
"BOOKABLE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 5,
"online": 5,
"total": 5
},
"renting": null
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.520496,
59.887412
]
},
"properties": {
"code": "224111",
"label": "Sandvika Storsenter Nytorget",
"name": "#224111 Sandvika Storsenter Nytorget",
"address": "Sandviksveien 176, Sandvika",
"tags": [
"BIKE",
"BOOKABLE",
"PRIVATE",
"FREE"
],
"icon": {
"png": "",
"png2x": "",
"svg": ""
},
"parking": {
"available": 13,
"online": 15,
"total": 15
},
"renting": null
}
}
]
}
Loading

0 comments on commit 0859b64

Please sign in to comment.