diff --git a/src/main/java/org/opentripplanner/index/IndexGraphQLSchema.java b/src/main/java/org/opentripplanner/index/IndexGraphQLSchema.java index 0658e6857d4..cf62321cfd1 100644 --- a/src/main/java/org/opentripplanner/index/IndexGraphQLSchema.java +++ b/src/main/java/org/opentripplanner/index/IndexGraphQLSchema.java @@ -2448,12 +2448,6 @@ public IndexGraphQLSchema(GraphIndex index) { .type(Scalars.GraphQLFloat) .dataFetcher(environment -> ((BikePark) environment.getSource()).y) .build()) - .field(GraphQLFieldDefinition.newFieldDefinition() - .name("tags") - .description("Additional information labels (tags) for the Bike park") - .type(new GraphQLList(GraphQLNonNull.nonNull(Scalars.GraphQLString))) - .dataFetcher(environment -> ((BikePark) environment.getSource()).tags) - .build()) .build(); ticketType = GraphQLObjectType.newObject() @@ -2557,12 +2551,6 @@ public IndexGraphQLSchema(GraphIndex index) { .type(Scalars.GraphQLFloat) .dataFetcher(environment -> ((CarPark) environment.getSource()).y) .build()) - .field(GraphQLFieldDefinition.newFieldDefinition() - .name("tags") - .description("Additional information labels (tags) for the car park") - .type(new GraphQLList(GraphQLNonNull.nonNull(Scalars.GraphQLString))) - .dataFetcher(environment -> ((CarPark) environment.getSource()).tags) - .build()) .build(); GraphQLInputObjectType filterInputType = GraphQLInputObjectType.newInputObject() diff --git a/src/main/java/org/opentripplanner/routing/bike_park/BikePark.java b/src/main/java/org/opentripplanner/routing/bike_park/BikePark.java index 745dd3a814c..1d0fc327234 100644 --- a/src/main/java/org/opentripplanner/routing/bike_park/BikePark.java +++ b/src/main/java/org/opentripplanner/routing/bike_park/BikePark.java @@ -1,8 +1,6 @@ package org.opentripplanner.routing.bike_park; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; import java.util.Locale; import javax.xml.bind.annotation.XmlAttribute; @@ -41,9 +39,6 @@ public class BikePark implements Serializable { @JsonSerialize public boolean realTimeData = true; - @JsonSerialize - public List tags; - public boolean equals(Object o) { if (!(o instanceof BikePark)) { return false; diff --git a/src/main/java/org/opentripplanner/routing/car_park/CarPark.java b/src/main/java/org/opentripplanner/routing/car_park/CarPark.java index 26bf13fca57..903ab4ffabf 100644 --- a/src/main/java/org/opentripplanner/routing/car_park/CarPark.java +++ b/src/main/java/org/opentripplanner/routing/car_park/CarPark.java @@ -19,8 +19,6 @@ the License, or (at your option) any later version. import javax.xml.bind.annotation.XmlAttribute; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; import java.util.Locale; @@ -62,9 +60,6 @@ public class CarPark implements Serializable { public Geometry geometry; - @JsonSerialize - public List tags; - public boolean equals(Object o) { if (!(o instanceof CarPark)) { return false; diff --git a/src/main/java/org/opentripplanner/updater/bike_park/HslBikeParkDataSource.java b/src/main/java/org/opentripplanner/updater/bike_park/HslBikeParkDataSource.java index 1086c70daf5..e76941c90b4 100644 --- a/src/main/java/org/opentripplanner/updater/bike_park/HslBikeParkDataSource.java +++ b/src/main/java/org/opentripplanner/updater/bike_park/HslBikeParkDataSource.java @@ -1,10 +1,6 @@ package org.opentripplanner.updater.bike_park; -import java.util.ArrayList; -import java.util.List; - import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; @@ -47,21 +43,6 @@ public BikePark makeBikePark(JsonNode node) { } else { station.spacesAvailable = node.path("builtCapacity").path("BICYCLE").asInt(); } - List tags = new ArrayList(); - ArrayNode servicesArray = (ArrayNode) node.get("services"); - if (servicesArray.isArray()) { - for (JsonNode jsonNode : servicesArray) { - tags.add("SERVICE_" + jsonNode.asText()); - } - } - ArrayNode authenticationMethods = (ArrayNode) node.get("authenticationMethods"); - if (authenticationMethods.isArray()) { - for (JsonNode jsonNode : authenticationMethods) { - tags.add("AUTHENTICATION_METHOD_" + jsonNode.asText()); - } - } - tags.add("PRICING_METHOD_" + node.path("pricingMethod").asText()); - station.tags = tags; return station; } catch (Exception e) { log.warn("Error parsing bike rental station " + station.id, e); diff --git a/src/main/java/org/opentripplanner/updater/car_park/HslCarParkDataSource.java b/src/main/java/org/opentripplanner/updater/car_park/HslCarParkDataSource.java index 96246794acc..6ed62140307 100644 --- a/src/main/java/org/opentripplanner/updater/car_park/HslCarParkDataSource.java +++ b/src/main/java/org/opentripplanner/updater/car_park/HslCarParkDataSource.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; @@ -19,10 +18,8 @@ import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; @@ -66,21 +63,6 @@ public CarPark makeCarPark(JsonNode node) { } else { station.spacesAvailable = station.maxCapacity; } - List tags = new ArrayList(); - ArrayNode servicesArray = (ArrayNode) node.get("services"); - if (servicesArray.isArray()) { - for (JsonNode jsonNode : servicesArray) { - tags.add("SERVICE_" + jsonNode.asText()); - } - } - ArrayNode authenticationMethods = (ArrayNode) node.get("authenticationMethods"); - if (authenticationMethods.isArray()) { - for (JsonNode jsonNode : authenticationMethods) { - tags.add("AUTHENTICATION_METHOD_" + jsonNode.asText()); - } - } - tags.add("PRICING_METHOD_" + node.path("pricingMethod").asText()); - station.tags = tags; return station; } catch (Exception e) { log.warn("Error parsing car park " + station.id, e); diff --git a/src/test/java/org/opentripplanner/updater/car_park/TestHslCarParkDataSource.java b/src/test/java/org/opentripplanner/updater/car_park/TestHslCarParkDataSource.java index 67683b508aa..b4b5fad3472 100644 --- a/src/test/java/org/opentripplanner/updater/car_park/TestHslCarParkDataSource.java +++ b/src/test/java/org/opentripplanner/updater/car_park/TestHslCarParkDataSource.java @@ -29,11 +29,6 @@ public void testHslCarParkDataSource() throws Exception { assertEquals(60.4553, ainola.y, 0.0003); assertEquals(46, ainola.maxCapacity); assertEquals(46, ainola.spacesAvailable); - assertEquals(4, ainola.tags.size()); - assertEquals("SERVICE_LIGHTING", ainola.tags.get(0)); - assertEquals("SERVICE_BICYCLE_FRAME_LOCK", ainola.tags.get(1)); - assertEquals("AUTHENTICATION_METHOD_HSL_TRAVEL_CARD", ainola.tags.get(2)); - assertEquals("PRICING_METHOD_PARK_AND_RIDE_247_FREE", ainola.tags.get(3)); CarPark fake = carParks.get(2); assertEquals("Asemakuja itäinen", fake.name.toString()); diff --git a/src/test/resources/bike/hsl.json b/src/test/resources/bike/hsl.json index 55642324f90..ad84889bcd1 100644 --- a/src/test/resources/bike/hsl.json +++ b/src/test/resources/bike/hsl.json @@ -72,9 +72,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": ["LIGHTING","BICYCLE_FRAME_LOCK"], - "authenticationMethods": ["HSL_TRAVEL_CARD"] + ] }, { @@ -146,9 +144,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -220,9 +216,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -299,9 +293,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -373,9 +365,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -447,9 +437,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -521,9 +509,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -595,9 +581,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -670,9 +654,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -744,9 +726,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -818,9 +798,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] }, { @@ -892,9 +870,7 @@ "usages": [ "PARK_AND_RIDE" - ], - "services": [], - "authenticationMethods": [] + ] } ] } \ No newline at end of file