diff --git a/.github/workflows/run_maven_tests.yml b/.github/workflows/run_maven_tests.yml index a2a1d91599..4cf7cc1fbb 100644 --- a/.github/workflows/run_maven_tests.yml +++ b/.github/workflows/run_maven_tests.yml @@ -32,8 +32,8 @@ jobs: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Copy app.config for API test - run: cp ./openrouteservice-api-tests/conf/ors-config-test.json ./openrouteservice/src/main/resources/app.config + - name: Copy ors test config for API tests + run: cp ./openrouteservice-api-tests/conf/ors-config-test.json ./openrouteservice/src/main/resources/ors-config.json - name: Test, build, run API tests run: mvn -B -f openrouteservice/pom.xml verify jacoco:report - name: run SonarLint checks diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index d403507b81..8ea8a36425 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -3,7 +3,7 @@ #### Here's what I did - + --- #### Here's what I got diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 337d3b5c9e..671068f5a5 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,18 +1,28 @@ ### Pull Request Checklist - -- [ ] 1. I have [**rebased**][rebase] the latest version of the master branch into my feature branch and all conflicts have been resolved. -- [ ] 2. I have added information about the change/addition to functionality to the CHANGELOG.md file under the [Unreleased] heading. + +- [ ] 1. I have [**rebased**][rebase] the latest version of the master branch into my feature branch and all conflicts + have been resolved. +- [ ] 2. I have added information about the change/addition to functionality to the CHANGELOG.md file under the + [Unreleased] heading. - [ ] 3. I have documented my code using JDocs tags. - [ ] 4. I have removed unnecessary commented out code, imports and System.out.println statements. - [ ] 5. I have written JUnit tests for any new methods/classes and ensured that they pass. - [ ] 6. I have created API tests for any new functionality exposed to the API. -- [ ] 7. If changes/additions are made to the app.config file, I have added these to the [app.config documentation][config] along with a short description of what it is for, and documented this in the Pull Request (below). +- [ ] 7. If changes/additions are made to the ors-config.json file, I have added these to the [ors config documentation][config] + along with a short description of what it is for, and documented this in the Pull Request (below). - [ ] 8. I have built graphs with my code of the Heidelberg.osm.gz file and run the api-tests with all test passing - [ ] 9. I have referenced the Issue Number in the Pull Request (if the changes were from an issue). -- [ ] 10. For new features or changes involving building of graphs, I have tested on a larger dataset (at least Germany) and the graphs build without problems (i.e. no out-of-memory errors). -- [ ] 11. For new features or changes involving the graphbuilding process (i.e. changing encoders, updating the importer etc.), I have generated longer distance routes for the affected profiles with different options (avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end points generated from the current live ORS. If there are differences then the reasoning for these **MUST** be documented in the pull request. -- [ ] 12. I have written in the Pull Request information about the changes made including their intended usage and why the change was needed. -- [ ] 13. For changes touching the API documentation, i have tested that the API playground [renders correctly][api]. +- [ ] 10. For new features or changes involving building of graphs, I have tested on a larger dataset + (at least Germany), and the graphs build without problems (i.e. no out-of-memory errors). +- [ ] 11. For new features or changes involving the graphbuilding process (i.e. changing encoders, updating the + importer etc.), I have generated longer distance routes for the affected profiles with different options + (avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end + points generated from the current live ORS. + If there are differences then the reasoning for these **MUST** be documented in the pull request. +- [ ] 12. I have written in the Pull Request information about the changes made including their intended usage + and why the change was needed. +- [ ] 13. For changes touching the API documentation, I have tested that the API playground [renders correctly][api]. Fixes # . @@ -20,10 +30,10 @@ Fixes # . - Key functionality added: - Reason for change: -### Examples and reasons for differences between live ORS routes and those generated from this pull request +### Examples and reasons for differences between live ORS routes, and those generated from this pull request - -### Required changes to app.config (if applicable) +### Required changes to ors config (if applicable) - [config]: https://GIScience.github.io/openrouteservice/installation/Configuration-(app.config).html diff --git a/openrouteservice/.gitignore b/openrouteservice/.gitignore index 9c6d0ab7e3..89d3e3857d 100644 --- a/openrouteservice/.gitignore +++ b/openrouteservice/.gitignore @@ -4,10 +4,10 @@ TODO.txt .settings/ .classpath .project -#/WebContent/WEB-INF/app.config +#/WebContent/WEB-INF/ors-config.json *.iws *.ipr cgiar-cache srtm_38_03.zip logs/ -.attach_* \ No newline at end of file +.attach_* diff --git a/openrouteservice/src/main/java/org/heigit/ors/api/requests/isochrones/IsochronesRequestHandler.java b/openrouteservice/src/main/java/org/heigit/ors/api/requests/isochrones/IsochronesRequestHandler.java index a431c9ce61..8099340236 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/api/requests/isochrones/IsochronesRequestHandler.java +++ b/openrouteservice/src/main/java/org/heigit/ors/api/requests/isochrones/IsochronesRequestHandler.java @@ -55,7 +55,7 @@ public IsochronesRequestHandler() { public void generateIsochronesFromRequest(IsochronesRequest request) throws Exception { isochroneRequest = convertIsochroneRequest(request); - // request object is built, now check if app config allows all settings + // request object is built, now check if ors config allows all settings List travellers = isochroneRequest.getTravellers(); // TODO where should we put the validation code? diff --git a/openrouteservice/src/main/java/org/heigit/ors/api/responses/routing/gpx/GPXEmail.java b/openrouteservice/src/main/java/org/heigit/ors/api/responses/routing/gpx/GPXEmail.java index e6fa31e074..5c0e982b5a 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/api/responses/routing/gpx/GPXEmail.java +++ b/openrouteservice/src/main/java/org/heigit/ors/api/responses/routing/gpx/GPXEmail.java @@ -40,7 +40,7 @@ public GPXEmail() throws InternalServerException { domain = parts[1]; } } catch (Exception e) { - throw new InternalServerException(RoutingErrorCodes.UNKNOWN, "Error creating GPX Email attribute, has it been set in the app.config?"); + throw new InternalServerException(RoutingErrorCodes.UNKNOWN, "Error creating GPX Email attribute, has it been set in the ors-config.json?"); } } @@ -51,4 +51,4 @@ public String getId() { public String getDomain() { return domain; } -} \ No newline at end of file +} diff --git a/openrouteservice/src/main/java/org/heigit/ors/api/util/SystemMessage.java b/openrouteservice/src/main/java/org/heigit/ors/api/util/SystemMessage.java index 5751b991e5..35c36fa657 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/api/util/SystemMessage.java +++ b/openrouteservice/src/main/java/org/heigit/ors/api/util/SystemMessage.java @@ -124,7 +124,7 @@ private static void loadMessages() { } catch (Exception e) { // ignore otherwise incomplete messages entirely - LOGGER.warn(String.format("Invalid SystemMessage object in app.config %s.", message.toString().substring(18))); + LOGGER.warn(String.format("Invalid SystemMessage object in ors config %s.", message.toString().substring(18))); } } LOGGER.info(String.format("SystemMessage loaded %s messages.", messages.size())); diff --git a/openrouteservice/src/main/java/org/heigit/ors/fastisochrones/partitioning/FastIsochroneParameters.java b/openrouteservice/src/main/java/org/heigit/ors/fastisochrones/partitioning/FastIsochroneParameters.java index 8eec6eabba..ad81d0afbb 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/fastisochrones/partitioning/FastIsochroneParameters.java +++ b/openrouteservice/src/main/java/org/heigit/ors/fastisochrones/partitioning/FastIsochroneParameters.java @@ -1,7 +1,8 @@ package org.heigit.ors.fastisochrones.partitioning; /** - * Parameters for fast isochrone algorithm preprocessing and query processing. Some defaults can be changed via app.config + * Parameters for fast isochrone algorithm preprocessing and query processing. + * Some defaults can be changed via ors-config.json * * @author Hendrik Leuschner */ diff --git a/openrouteservice/src/main/java/org/heigit/ors/globalresponseprocessor/gpx/GpxResponseWriter.java b/openrouteservice/src/main/java/org/heigit/ors/globalresponseprocessor/gpx/GpxResponseWriter.java index 7c239c3856..3875c8a0a7 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/globalresponseprocessor/gpx/GpxResponseWriter.java +++ b/openrouteservice/src/main/java/org/heigit/ors/globalresponseprocessor/gpx/GpxResponseWriter.java @@ -63,7 +63,8 @@ private GpxResponseWriter () {} /** * toGPX can be used to convert a {@link RoutingRequest} and {@link RouteResult} to a gpx. - * Specific values should be set in the App.config. If not, the process continues with empty values and a log4j error message. + * Specific values should be set in the ors-config.json. + * If not, the process continues with empty values and a log4j error message. * * @param rreq The {@link RoutingRequest} object holds route specific information like language... * @param routeResults The function needs a {@link RouteResult} as input. diff --git a/openrouteservice/src/main/java/org/heigit/ors/isochrones/statistics/postgresql/PostgresSQLStatisticsProvider.java b/openrouteservice/src/main/java/org/heigit/ors/isochrones/statistics/postgresql/PostgresSQLStatisticsProvider.java index ad9bad9d44..d8eda5bb5b 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/isochrones/statistics/postgresql/PostgresSQLStatisticsProvider.java +++ b/openrouteservice/src/main/java/org/heigit/ors/isochrones/statistics/postgresql/PostgresSQLStatisticsProvider.java @@ -44,10 +44,10 @@ public class PostgresSQLStatisticsProvider implements StatisticsProvider { private String geomColumn = null; private HikariDataSource dataSource; /** - * This function initializes the connection to the server according to the settings in the app.config. - * The connection is established using a {@link HikariDataSource} object with the configuration data from the app.config. + * This function initializes the connection to the server according to the settings in the ors-config.json. + * The connection is established using a {@link HikariDataSource} object with the configuration data from the ors-config.json. * - * @param parameters {@link Map} holding the server configuration data from the app.config. + * @param parameters {@link Map} holding the server configuration data from the ors-config.json. * @throws Exception */ @Override diff --git a/openrouteservice/src/main/java/org/heigit/ors/logging/LoggingConfigFactory.java b/openrouteservice/src/main/java/org/heigit/ors/logging/LoggingConfigFactory.java index 26e1c3aa2f..1102003af7 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/logging/LoggingConfigFactory.java +++ b/openrouteservice/src/main/java/org/heigit/ors/logging/LoggingConfigFactory.java @@ -21,7 +21,7 @@ public class LoggingConfigFactory extends ConfigurationFactory{ protected static final Logger LOGGER = Logger.getLogger(LoggingConfigFactory.class); public Configuration getConfiguration(LoggerContext context, ConfigurationSource source) { - // We need to read the settings from the app.config if it is available + // We need to read the settings from the ors-config.json if it is available if (LoggingSettings.getEnabled()) { String settingsFileName = LoggingSettings.getLevelFile(); diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java b/openrouteservice/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java index a1da737a21..05a3b0ce8a 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java @@ -1,15 +1,15 @@ /* This file is part of Openrouteservice. * - * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 + * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the + * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * You should have received a copy of the GNU Lesser General Public License along with this library; - * if not, see . + * You should have received a copy of the GNU Lesser General Public License along with this library; + * if not, see . */ package org.heigit.ors.routing.configuration; @@ -80,7 +80,7 @@ public static RoutingManagerConfiguration loadFromFile(String path) throws IOExc List newProfiles = new ArrayList<>(); List fastIsochroneProfileList = IsochronesServiceSettings.getParametersList(IsochronesServiceSettings.SERVICE_NAME_FASTISOCHRONES + "profiles.active"); Map defaultFastIsochroneParams = IsochronesServiceSettings.getParametersMap(IsochronesServiceSettings.SERVICE_NAME_FASTISOCHRONES + "profiles.default_params", true); - if (defaultFastIsochroneParams == null) { // default to disabled if ors.services.isochrones.fastisochrones not available in app.config + if (defaultFastIsochroneParams == null) { // default to disabled if ors.services.isochrones.fastisochrones not available in ors-config.json defaultFastIsochroneParams = new HashMap<>(); defaultFastIsochroneParams.put("enabled", false); } @@ -116,7 +116,7 @@ else if (defaultParams != null) { for(Map.Entry defParamItem : defaultParams.entrySet()) { if (!profileParams.containsKey(defParamItem.getKey())) profileParams.put(defParamItem.getKey(), defParamItem.getValue()); - } + } } if (profileParams != null) { @@ -161,7 +161,7 @@ else if (defaultParams != null) { } break; case "ext_storages": - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Map storageList = (Map)paramItem.getValue(); for(Map.Entry storageEntry : storageList.entrySet()) { @@ -177,7 +177,7 @@ else if (defaultParams != null) { } break; case "graph_processors": - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Map storageList2 = (Map)paramItem.getValue(); for(Map.Entry storageEntry : storageList2.entrySet()) { @@ -211,7 +211,7 @@ else if (defaultParams != null) { profile.setMaximumWayPoints(Integer.parseInt(paramItem.getValue().toString())); break; case "extent": - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") List bbox = (List)paramItem.getValue(); if (bbox.size() != 4) diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/ORSOSMReader.java b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/ORSOSMReader.java index 2c30dd62eb..3383cd1ed7 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/ORSOSMReader.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/ORSOSMReader.java @@ -1,15 +1,15 @@ /* This file is part of Openrouteservice. * - * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 + * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the + * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * You should have received a copy of the GNU Lesser General Public License along with this library; - * if not, see . + * You should have received a copy of the GNU Lesser General Public License along with this library; + * if not, see . */ package org.heigit.ors.routing.graphhopper.extensions; @@ -355,8 +355,8 @@ protected void onProcessEdge(ReaderWay way, EdgeIteratorState edge) { LOGGER.warn(ex.getMessage() + ". Way id = " + way.getId()); } } - - @Override + + @Override protected boolean onCreateEdges(ReaderWay way, LongArrayList osmNodeIds, IntsRef wayFlags, List createdEdges) { try @@ -366,7 +366,7 @@ protected boolean onCreateEdges(ReaderWay way, LongArrayList osmNodeIds, IntsRef catch (Exception ex) { LOGGER.warn(ex.getMessage() + ". Way id = " + way.getId()); } - + return false; } @@ -423,7 +423,7 @@ protected double getElevation(ReaderNode node) { double ele = node.getEle(); if (Double.isNaN(ele)) { if (!getElevationFromPreprocessedDataErrorLogged) { - LOGGER.error("elevation_preprocessed set to true in app.config, still found a Node with invalid ele tag! Set this flag only if you use a preprocessed pbf file! Node ID: " + node.getId()); + LOGGER.error("elevation_preprocessed set to true in ors config, still found a Node with invalid ele tag! Set this flag only if you use a preprocessed pbf file! Node ID: " + node.getId()); getElevationFromPreprocessedDataErrorLogged = true; } ele = 0; diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/core/CoreLMOptions.java b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/core/CoreLMOptions.java index 4b8f6f5460..6f440ceb11 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/core/CoreLMOptions.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/core/CoreLMOptions.java @@ -40,7 +40,7 @@ public void setRestrictionFilters(List tmpCoreLMSets) { } /** - * Creates all LMSet-Filters from the sets specified in the app.config + * Creates all LMSet-Filters from the sets specified in the ors-config.json * The filter is an LMEdgeFilterSequence, consisting of at most ONE AvoidFeaturesFilter and ONE AvoidCountriesFilter * These can contain multiple avoidfeatures and avoidcountries * diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/edgefilters/core/MaximumSpeedCoreEdgeFilter.java b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/edgefilters/core/MaximumSpeedCoreEdgeFilter.java index 4786326550..ff8fbe27e9 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/edgefilters/core/MaximumSpeedCoreEdgeFilter.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/edgefilters/core/MaximumSpeedCoreEdgeFilter.java @@ -20,7 +20,7 @@ import org.heigit.ors.config.AppConfig; /** - * This class includes in the core all edges with speed more than the one set in the app.config file max_speed. + * This class includes in the core all edges with speed more than the one set in the ors-config.json file max_speed. * * @author Athanasios Kogios */ diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/BordersGraphStorageBuilder.java b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/BordersGraphStorageBuilder.java index 6d236d9e24..baa7e73a27 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/BordersGraphStorageBuilder.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/BordersGraphStorageBuilder.java @@ -56,7 +56,7 @@ public BordersGraphStorageBuilder() { /** * Initialize the Borders graph extension

- * Files required for the process are obtained from the app.config and passed to a CountryBordersReader object + * Files required for the process are obtained from the ors-config.json and passed to a CountryBordersReader object * which stores information required for the process (i.e. country geometries and border types) * * @param graphhopper diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/GreenIndexGraphStorageBuilder.java b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/GreenIndexGraphStorageBuilder.java index 987f62c3b4..6c9df15927 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/GreenIndexGraphStorageBuilder.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/GreenIndexGraphStorageBuilder.java @@ -1,15 +1,15 @@ /* This file is part of Openrouteservice. * - * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 + * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the + * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * You should have received a copy of the GNU Lesser General Public License along with this library; - * if not, see . + * You should have received a copy of the GNU Lesser General Public License along with this library; + * if not, see . */ package org.heigit.ors.routing.graphhopper.extensions.storages.builders; @@ -72,11 +72,11 @@ private void readGreenIndicesFromCSV(String csvFile) throws IOException { row = csvBuffer.readLine(); char separator = row.contains(";") ? ';': ','; String[] rowValues = new String[2]; - + while ((row = csvBuffer.readLine()) != null) { - if (!parseCSVrow(row, separator, rowValues)) + if (!parseCSVrow(row, separator, rowValues)) continue; - + greenIndices.put(Long.parseLong(rowValues[0]), Double.parseDouble(rowValues[1])); } } catch (IOException openFileEx) { @@ -88,7 +88,7 @@ private void readGreenIndicesFromCSV(String csvFile) throws IOException { private boolean parseCSVrow(String row, char separator, String[] rowValues) { if (Helper.isEmpty(row)) return false; - + int pos = row.indexOf(separator); if (pos > 0) { rowValues[0] = row.substring(0, pos).trim(); @@ -129,7 +129,7 @@ private byte calcGreenIndex(long id) { // No such @id key in the _greenIndices, or the value of it is null // We set its green level to TOTAL_LEVEL/2 indicating the middle value for such cases - // TODO this DEFAULT_LEVEL should be put in the app.config file and + // TODO this DEFAULT_LEVEL should be put in the ors-config.json file and // injected back in the code if (gi == null) return (byte) (DEFAULT_LEVEL);