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

Add Bikeep bicycle parking updater #5798

Merged
merged 3 commits into from
Apr 26, 2024
Merged
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
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
Loading