From de355dd3683281ea59220b7737b2c98b071e2b60 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 22 Jan 2024 10:11:20 +0100 Subject: [PATCH] Incorporate review feedback --- doc-templates/sandbox/MapboxVectorTilesApi.md | 14 +++++++------ docs/sandbox/MapboxVectorTilesApi.md | 20 ++++++++++--------- .../vectortiles/VectorTilesConfigDocTest.java | 2 +- ...leRentalServiceDirectoryConfigDocTest.java | 2 +- .../config/routerconfig/VectorTileConfig.java | 6 +++--- .../doc/BuildConfigurationDocTest.java | 2 +- .../generate/doc/ConfigurationDocTest.java | 2 +- .../doc/FlexConfigurationDocTest.java | 2 +- .../generate/doc/GraphQLTutorialDocTest.java | 2 +- .../generate/doc/RouteRequestDocTest.java | 2 +- .../doc/RouterConfigurationDocTest.java | 2 +- .../generate/doc/RoutingModeDocTest.java | 2 +- .../generate/doc/UpdaterConfigDocTest.java | 2 +- .../generate/doc/VehicleParkingDocTest.java | 2 +- 14 files changed, 33 insertions(+), 29 deletions(-) diff --git a/doc-templates/sandbox/MapboxVectorTilesApi.md b/doc-templates/sandbox/MapboxVectorTilesApi.md index 4e3e047fedb..879ea3755d6 100644 --- a/doc-templates/sandbox/MapboxVectorTilesApi.md +++ b/doc-templates/sandbox/MapboxVectorTilesApi.md @@ -3,18 +3,19 @@ ## Contact Info - HSL, Finland -- IBI Arcardis, US +- Arcadis, US ## Documentation This API produces [Mapbox vector tiles](https://docs.mapbox.com/vector-tiles/reference/), which are -used by eg. [Digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) to show information about +used by [Digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) and +[`otp-react-redux`](https://github.com/opentripplanner/otp-react-redux) to show information about public transit entities on the map. The tiles can be fetched from `/otp/routers/{routerId}/vectorTiles/{layers}/{z}/{x}/{y}.pbf`, where `layers` is a comma separated list of layer names from the configuration. -Maplibre/Mapbox GL JS also require a tilejson.json endpoint which is available at +Maplibre/Mapbox GL JS also requires a tilejson.json endpoint which is available at `/otp/routers/{routerId}/vectorTiles/{layers}/tilejson.json`. Translatable fields in the tiles are translated based on the `accept-language` header in requests. @@ -37,7 +38,8 @@ The feature must be configured in `router-config.json` as follows ```JSON { - "vectorTiles": + "vectorTiles": { + "basePath": "/only/configure/if/required", "layers": [ { "name": "stops", @@ -145,8 +147,8 @@ For each layer, the configuration includes: ### Extending -If more generic layers are created for this API, it should be moved out from the sandbox, into the -core code, with potentially leaving specific property mappers in place. +If more generic layers are created for this API, the code should be moved out from the sandbox, into +the core, perhaps potentially leaving specific property mappers in place. #### Creating a new layer diff --git a/docs/sandbox/MapboxVectorTilesApi.md b/docs/sandbox/MapboxVectorTilesApi.md index 92cd867ecce..a58bd3c30f0 100644 --- a/docs/sandbox/MapboxVectorTilesApi.md +++ b/docs/sandbox/MapboxVectorTilesApi.md @@ -3,18 +3,19 @@ ## Contact Info - HSL, Finland -- IBI Arcardis, US +- Arcadis, US ## Documentation This API produces [Mapbox vector tiles](https://docs.mapbox.com/vector-tiles/reference/), which are -used by eg. [Digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) to show information about +used by [Digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) and +[`otp-react-redux`](https://github.com/opentripplanner/otp-react-redux) to show information about public transit entities on the map. The tiles can be fetched from `/otp/routers/{routerId}/vectorTiles/{layers}/{z}/{x}/{y}.pbf`, where `layers` is a comma separated list of layer names from the configuration. -Maplibre/Mapbox GL JS also require a tilejson.json endpoint which is available at +Maplibre/Mapbox GL JS also requires a tilejson.json endpoint which is available at `/otp/routers/{routerId}/vectorTiles/{layers}/tilejson.json`. Translatable fields in the tiles are translated based on the `accept-language` header in requests. @@ -37,7 +38,8 @@ The feature must be configured in `router-config.json` as follows ```JSON { - "vectorTiles": + "vectorTiles": { + "basePath": "/only/configure/if/required", "layers": [ { "name": "stops", @@ -168,9 +170,9 @@ The path of the vector tile source URLs in `tilejson.json`. This is useful if you have a proxy setup and rewrite the path that is passed to OTP. -If you don't configure this optional value then the path returned in `tilejson.json` is -`/otp/routers/default/vectorTiles/layer1,layer2/{z}/{x}/{x}.pbf`. If you, for example, set -a value of `/otp_test/tiles` then the returned path changes to +If you don't configure this optional value then the path returned in `tilejson.json` is in +the format `/otp/routers/default/vectorTiles/layer1,layer2/{z}/{x}/{x}.pbf`. +If you, for example, set a value of `/otp_test/tiles` then the returned path changes to `/otp_test/tiles/layer1,layer2/{z}/{x}/{x}.pbf`. The protocol and host are always read from the incoming HTTP request. If you run OTP behind @@ -219,8 +221,8 @@ Currently `Digitransit` is supported for all layer types. ### Extending -If more generic layers are created for this API, it should be moved out from the sandbox, into the -core code, with potentially leaving specific property mappers in place. +If more generic layers are created for this API, the code should be moved out from the sandbox, into +the core, perhaps potentially leaving specific property mappers in place. #### Creating a new layer diff --git a/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java b/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java index e758026d02b..233e3fa3737 100644 --- a/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java @@ -32,7 +32,7 @@ public class VectorTilesConfigDocTest { public void updateDoc() { NodeAdapter node = readVectorTiles(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String template = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java b/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java index 51f72c05e3e..4936bb4dd44 100644 --- a/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java @@ -37,7 +37,7 @@ public class VehicleRentalServiceDirectoryConfigDocTest { public void updateConfigurationDoc() { NodeAdapter node = readConfigDefaults(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/main/java/org/opentripplanner/standalone/config/routerconfig/VectorTileConfig.java b/src/main/java/org/opentripplanner/standalone/config/routerconfig/VectorTileConfig.java index 0abc046282d..ad2f109ac8e 100644 --- a/src/main/java/org/opentripplanner/standalone/config/routerconfig/VectorTileConfig.java +++ b/src/main/java/org/opentripplanner/standalone/config/routerconfig/VectorTileConfig.java @@ -57,9 +57,9 @@ public static VectorTileConfig mapVectorTilesParameters(NodeAdapter node, String """ This is useful if you have a proxy setup and rewrite the path that is passed to OTP. - If you don't configure this optional value then the path returned in `tilejson.json` is - `/otp/routers/default/vectorTiles/layer1,layer2/{z}/{x}/{x}.pbf`. If you, for example, set - a value of `/otp_test/tiles` then the returned path changes to + If you don't configure this optional value then the path returned in `tilejson.json` is in + the format `/otp/routers/default/vectorTiles/layer1,layer2/{z}/{x}/{x}.pbf`. + If you, for example, set a value of `/otp_test/tiles` then the returned path changes to `/otp_test/tiles/layer1,layer2/{z}/{x}/{x}.pbf`. The protocol and host are always read from the incoming HTTP request. If you run OTP behind diff --git a/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java b/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java index 287b0145292..4009a455abe 100644 --- a/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java @@ -49,7 +49,7 @@ public class BuildConfigurationDocTest { public void updateBuildConfigurationDoc() { NodeAdapter node = readBuildConfig(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/ConfigurationDocTest.java b/src/test/java/org/opentripplanner/generate/doc/ConfigurationDocTest.java index 2f972e8300a..19a562d8b3f 100644 --- a/src/test/java/org/opentripplanner/generate/doc/ConfigurationDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/ConfigurationDocTest.java @@ -36,7 +36,7 @@ public class ConfigurationDocTest { */ @Test public void updateConfigurationDoc() { - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java b/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java index 2b440d7545a..fd2d7092dc5 100644 --- a/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java @@ -33,7 +33,7 @@ public class FlexConfigurationDocTest { public void updateFlexDoc() { NodeAdapter node = readFlexConfig(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String template = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java b/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java index bf2b092e092..5e858ff4d61 100644 --- a/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java @@ -33,7 +33,7 @@ public class GraphQLTutorialDocTest { */ @Test public void updateTutorialDoc() throws IOException { - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java b/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java index 9a39b3cfa3f..76642db3e5a 100644 --- a/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java @@ -44,7 +44,7 @@ public class RouteRequestDocTest { public void updateRouteRequestConfigurationDoc() { NodeAdapter node = readRoutingDefaults(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java b/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java index a48374e755c..90cdd9de975 100644 --- a/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java @@ -51,7 +51,7 @@ public class RouterConfigurationDocTest { public void updateBuildConfigurationDoc() { NodeAdapter node = readRouterConfig(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/RoutingModeDocTest.java b/src/test/java/org/opentripplanner/generate/doc/RoutingModeDocTest.java index e08de453630..0c6edc7e16b 100644 --- a/src/test/java/org/opentripplanner/generate/doc/RoutingModeDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/RoutingModeDocTest.java @@ -24,7 +24,7 @@ public class RoutingModeDocTest { @Test public void updateDocs() { - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String doc = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java b/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java index 3d0cb547b7a..fa5abca7814 100644 --- a/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java @@ -50,7 +50,7 @@ public class UpdaterConfigDocTest { public void updateRouterConfigurationDoc() { NodeAdapter node = readBuildConfig(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String template = readFile(TEMPLATE); String original = readFile(OUT_FILE); diff --git a/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java b/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java index de9b921c27a..abc9ceee806 100644 --- a/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java @@ -33,7 +33,7 @@ public class VehicleParkingDocTest { public void updateVehicleParkingDoc() { NodeAdapter node = readVehicleUpdaters(); - // Read and close inout file (same as output file) + // Read and close input file (same as output file) String template = readFile(TEMPLATE); String original = readFile(OUT_FILE);