-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5798 from leonardehrenfried/bikeep
Add Bikeep bicycle parking updater
- Loading branch information
Showing
12 changed files
with
609 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -44,6 +44,9 @@ All updaters have the following parameters in common: | |
|
||
<!-- INSERT: noi-open-data-hub --> | ||
|
||
## Bikeep | ||
|
||
<!-- INSERT: bikeep --> | ||
|
||
## Changelog | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
src/ext-test/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdaterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |
303 changes: 303 additions & 0 deletions
303
src/ext-test/resources/org/opentripplanner/ext/vehicleparking/bikeep/bikeep.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.