Skip to content

Commit

Permalink
Rename app.config
Browse files Browse the repository at this point in the history
- in github workflow
- openrouteservice folder
- template files

refers to #1017
  • Loading branch information
TheGreatRefrigerator committed Jul 27, 2021
1 parent ae401d1 commit 2baa7a1
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_maven_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- https://ask.openrouteservice.org/c/ors-->

#### Here's what I did
<!-- include request URLs, link to app.config or other relevant information -->
<!-- include request URLs, link to ors-config.json or other relevant information -->

---
#### Here's what I got
Expand Down
30 changes: 20 additions & 10 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
### Pull Request Checklist
<!--- Please make sure you have completed the following items BEFORE submitting a pull request (put an x in each box when you have checked you have done them): -->
- [ ] 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.
<!--- Please make sure you have completed the following items BEFORE submitting a pull request (put an x in each box
when you have checked you have done them): -->
- [ ] 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 # .

### Information about the changes
- 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
Expand Down
4 changes: 2 additions & 2 deletions openrouteservice/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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_*
.attach_*
Original file line number Diff line number Diff line change
Expand Up @@ -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<TravellerInfo> travellers = isochroneRequest.getTravellers();

// TODO where should we put the validation code?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?");
}
}

Expand All @@ -51,4 +51,4 @@ public String getId() {
public String getDomain() {
return domain;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public License along with this library;
* if not, see <https://www.gnu.org/licenses/>.
*/
package org.heigit.ors.routing.configuration;

Expand Down Expand Up @@ -80,7 +80,7 @@ public static RoutingManagerConfiguration loadFromFile(String path) throws IOExc
List<RouteProfileConfiguration> newProfiles = new ArrayList<>();
List<String> fastIsochroneProfileList = IsochronesServiceSettings.getParametersList(IsochronesServiceSettings.SERVICE_NAME_FASTISOCHRONES + "profiles.active");
Map<String,Object> 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);
}
Expand Down Expand Up @@ -116,7 +116,7 @@ else if (defaultParams != null) {
for(Map.Entry<String, Object> defParamItem : defaultParams.entrySet()) {
if (!profileParams.containsKey(defParamItem.getKey()))
profileParams.put(defParamItem.getKey(), defParamItem.getValue());
}
}
}

if (profileParams != null) {
Expand Down Expand Up @@ -161,7 +161,7 @@ else if (defaultParams != null) {
}
break;
case "ext_storages":
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
Map<String, Object> storageList = (Map<String, Object>)paramItem.getValue();

for(Map.Entry<String, Object> storageEntry : storageList.entrySet()) {
Expand All @@ -177,7 +177,7 @@ else if (defaultParams != null) {
}
break;
case "graph_processors":
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
Map<String, Object> storageList2 = (Map<String, Object>)paramItem.getValue();

for(Map.Entry<String, Object> storageEntry : storageList2.entrySet()) {
Expand Down Expand Up @@ -211,7 +211,7 @@ else if (defaultParams != null) {
profile.setMaximumWayPoints(Integer.parseInt(paramItem.getValue().toString()));
break;
case "extent":
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
List<Double> bbox = (List<Double>)paramItem.getValue();

if (bbox.size() != 4)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public License along with this library;
* if not, see <https://www.gnu.org/licenses/>.
*/
package org.heigit.ors.routing.graphhopper.extensions;

Expand Down Expand Up @@ -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<EdgeIteratorState> createdEdges)
{
try
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void setRestrictionFilters(List<String> 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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public BordersGraphStorageBuilder() {

/**
* Initialize the Borders graph extension <br/><br/>
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public License along with this library;
* if not, see <https://www.gnu.org/licenses/>.
*/
package org.heigit.ors.routing.graphhopper.extensions.storages.builders;

Expand Down Expand Up @@ -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) {
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2baa7a1

Please sign in to comment.