Skip to content

Commit

Permalink
Merge pull request #6174 from Jnction/netex_cableway
Browse files Browse the repository at this point in the history
Change the NeTEx mapping of "cableway" to GONDOLA
  • Loading branch information
optionsome authored Oct 22, 2024
2 parents c794227 + ecae035 commit 25c2502
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public class EnumTypes {
.value("air", TransitMode.AIRPLANE)
.value("bicycle", TraverseMode.BICYCLE)
.value("bus", TransitMode.BUS)
.value("cableway", TransitMode.CABLE_CAR)
.value("cableway", TransitMode.GONDOLA)
.value("water", TransitMode.FERRY)
.value("funicular", TransitMode.FUNICULAR)
.value("lift", TransitMode.GONDOLA)
Expand Down Expand Up @@ -455,7 +455,7 @@ public class EnumTypes {
.name("TransportMode")
.value("air", TransitMode.AIRPLANE)
.value("bus", TransitMode.BUS)
.value("cableway", TransitMode.CABLE_CAR)
.value("cableway", TransitMode.GONDOLA)
.value("water", TransitMode.FERRY)
.value("funicular", TransitMode.FUNICULAR)
.value("lift", TransitMode.GONDOLA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private TransitMode mapVehicleMode(StopPlace stopPlace) {
case AIR -> TransitMode.AIRPLANE;
case BUS -> TransitMode.BUS;
case TROLLEY_BUS -> TransitMode.TROLLEYBUS;
case CABLEWAY -> TransitMode.CABLE_CAR;
case CABLEWAY -> TransitMode.GONDOLA;
case COACH -> TransitMode.COACH;
case FUNICULAR -> TransitMode.FUNICULAR;
case METRO -> TransitMode.SUBWAY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public TransitMode mapAllVehicleModesOfTransport(AllVehicleModesOfTransportEnume
return switch (mode) {
case AIR -> TransitMode.AIRPLANE;
case BUS -> TransitMode.BUS;
case CABLEWAY -> TransitMode.CABLE_CAR;
case CABLEWAY -> TransitMode.GONDOLA;
case COACH -> TransitMode.COACH;
case FUNICULAR -> TransitMode.FUNICULAR;
case METRO -> TransitMode.SUBWAY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ void mapWithTransportModeOnly() {
assertNull(transitMode.subMode());
}

@Test
void mapCableway() {
var transitMode = stopPlaceTypeMapper.map(
new StopPlace().withTransportMode(AllVehicleModesOfTransportEnumeration.CABLEWAY)
);
assertEquals(TransitMode.GONDOLA, transitMode.mainMode());
assertNull(transitMode.subMode());
}

@Test
void mapWithSubMode() {
var transitMode = stopPlaceTypeMapper.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ void mapWithTransportModeOnly() throws UnsupportedModeException {
assertNull(transitMode.subMode());
}

@Test
void mapCableway() throws UnsupportedModeException {
var transitMode = transportModeMapper.map(AllVehicleModesOfTransportEnumeration.CABLEWAY, null);
assertEquals(TransitMode.GONDOLA, transitMode.mainMode());
assertNull(transitMode.subMode());
}

@Test
void mapWithSubMode() throws UnsupportedModeException {
var transitMode = transportModeMapper.map(
Expand Down

0 comments on commit 25c2502

Please sign in to comment.