Skip to content

Commit

Permalink
Merge branch 'development' into feature-#377-alternative-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
takb authored Jan 29, 2019
2 parents 9bc7759 + eb3486b commit b9e23f4
Show file tree
Hide file tree
Showing 18 changed files with 230 additions and 68 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added support for ISO 3166-1 Alpha-2 / Alpha-3 codes for routing directions option avoid_countries (Issue #195)
- Added support for GH alternative_route algorithm (Issue #377)
### Fixed
- Fixed `geometry_simplify` parameter, which had no effect before. `geometry_simplify` is incompatible with `extra_info` (#381)
### Changed
- Updated rural speed limit in France to be 80km/h (Issue #355)
- Modified smoothing and buffer distances for small isochrones, aswell as other fixes for smaller isochrones (Issue #382)
- Updated pom to use correct opengeo repo and reordered so this is the last in the list, and use latest ORS-Graphhopper library (Issue #398)
- Added /directions as an endpoint for routing (Issue #384)
### Deprecated

## [4.7.2] - 2018-12-10
Expand Down Expand Up @@ -170,11 +173,10 @@ are attached to roads. (Issue #162)
- Consider turn restrictions if optimized=false is passed.

### Changed
-
-

### Removed
-
-

### Deprecated
-

-
89 changes: 89 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Contribution Guidelines

<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Contribution Guidelines](#contribution-guidelines)
- [Issues](#issues)
- [Technical issues](#technical-issues)
- [Routing issues](#routing-issues)
- [Feature requests](#feature-requests)
- [Pull Requests](#pull-requests)
- [Pull request guidelines](#pull-request-guidelines)
- [Contributing code](#contributing-code)

<!-- /TOC -->

**Firstly, thanks for using the ORS and contributing to making it better for everyone.**

OpenRouteService has been around for over ten years, and as such it has seen many changes and adoption of new methodologies and techniques, as well as the coming and going of multiple developers. To try and keep the OpenRouteService codebase clean and stable, there are a few guidelines that we try to follow.

## Issues

We accept technical issues, routing issues and feature requests. Common questions should be asked at [ask.openrouteservice.org](https://ask.openrouteservice.org).

Please search for issues before creating [a new one](https://github.com/GIScience/openrouteservice/issues/new).

### Technical issues

If you encounter a bug, please make sure to be as descriptive as possible, i.e.:

- operating system (in case of self-hosting)
- request URL (incl. parameters if POST)
- expected outcome
- actual outcome (e.g. JSON output)
- fenced code around the bug, if known

### Routing issues

If you encounter weird or unexpected behavior during routing, please make sure to rule out expected behavior based on road attributes from e.g. [openstreetmap.org](https://openstreetmap.org/query), such as unexpected one-way streets or access restrictions. Find an overview of our tagging filters for all transportation profiles in our [wiki](https://github.com/GIScience/openrouteservice/wiki/Tag-Filtering).

Information to include:

- request URL (incl. parameters if POST)
- expected outcome
- actual outcome (e.g. JSON output)
- screenshots where applicable (e.g. from our [maps](https://maps.openrouteservice.org))

### Feature requests

Here you can be creative, but still descriptive. Make sure to describe the current behavior, your desired behavior and **to give actual use cases**. That makes it whole easier for us to prioritize.

## Pull Requests

We :heart: pull requests! We also aspire to make our commit history cleaner and more sustainable, benefiting our contributors and us maintainers.

### Pull request guidelines

We'd like all pull requests to adhere to the following rules:

- a PR has to **close an issue**. If there is none yet for yours, please [create one](https://github.com/GIScience/openrouteservice/issues/new)
- branch off [development](https://github.com/GIScience/openrouteservice/tree/development)
- name your branch according to `<[hotfix/bugfix/feat/algo]>/<issue#>-<purpose>`, e.g. `[feat]/#381-simplify_geometry`
- if you introduce new functions/classes, write unit or API tests
- **limit the number of commits to a minimum**, i.e. use [`git commit --amend [--no-edit]`](https://www.atlassian.com/git/tutorials/rewriting-history#git-commit--amend)
- use meaningful commit messages, e.g. `commit -m "[feat] include geometry_simplify in API and core code"`
- if your branch needs an update from its base branch, use [`rebase`](https://blog.algolia.com/master-git-rebase/#rebasing-on-the-base-branch), e.g.

```
git checkout my-new-feat
git stash
git rebase development
git stash pop
```

Be extra careful using `rebase` commands when collaborating on a branch with other people.

**Don't merge** `development` branch into your feature branch.

### Contributing code

For a short explanation on how to setup, deploy and test **openrouteservice** locally for development, see our [wiki entry](https://github.com/GIScience/openrouteservice/wiki/Contributing-Code).

Though there are no concrete rules for code that is contributed, we have a few general styles that should be adopted:

- **Descriptive names** for variables, methods and classes
- **Minimal in-line comments**: code should be self-explanatory. **Never** use comments to comment out blocks of code
- **Use JDoc** docstrings to provide context for methods and classes
- **Unit tests!!**
- **API test** when adding API functionality in the corresponding [`openrouteservice-api-tests`](https://github.com/GIScience/openrouteservice/tree/master/openrouteservice-api-tests) subproject
- Keep **methods modular**: rather short and singular functionality than 100s line of code
8 changes: 4 additions & 4 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### 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 merged the latest version of the development branch into my feature branch and all conflicts have been resolved.
- [ ] 1. I have [**rebased**](https://github.com/GIScience/openrouteservice/blob/master/CONTRIBUTE.md#pull-request-guidelines) the latest version of the development 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.
Expand All @@ -17,10 +17,10 @@ Fixes # .

### Information about the changes
- Key functionality added:
- Reason for change:
- Reason for change:

### Examples and reasons for differences between live ORS routes and those generated from this pull request
-
-

### Required changes to app.config (if applicable)
-
-
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Openrouteservice

- [master](https://github.com/GIScience/openrouteservice) [![Build Status](https://travis-ci.org/GIScience/openrouteservice.svg?branch=master)](https://travis-ci.org/GIScience/openrouteservice)
- [development](https://github.com/GIScience/openrouteservice/tree/development) [![Build Status](https://travis-ci.org/GIScience/openrouteservice.svg?branch=development)](https://travis-ci.org/GIScience/openrouteservice)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[master](https://github.com/GIScience/openrouteservice)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [development](https://github.com/GIScience/openrouteservice/tree/development)
[![Build Status](https://travis-ci.org/GIScience/openrouteservice.svg?branch=master)](https://travis-ci.org/GIScience/openrouteservice) [![Build Status](https://travis-ci.org/GIScience/openrouteservice.svg?branch=development)](https://travis-ci.org/GIScience/openrouteservice)

The **openrouteservice API** provides global spatial services by consuming user-generated and collaboratively collected free geographic data directly from [OpenStreetMap](http://www.openstreetmap.org). It is highly customizable, performant and written in Java.

Expand All @@ -12,11 +12,12 @@ The following services are available via a RESTful interface served by Tomcat.

To play around with openrouteservice you may use our [demonstration server](https://maps.openrouteservice.org) which comes with both the backend and a [frontend](https://github.com/GIScience/openrouteservice-app). Or simply sign up for an [API key](https://openrouteservice.org) and fire your requests against the API directly.

Please note that openrouteservice uses a forked and edited version of [graphhopper 0.9](https://github.com/GIScience/graphhopper) which can be found [here](https://github.com/GIScience/graphhopper).
Please note that openrouteservice uses a forked and edited version of [graphhopper 0.10](https://github.com/GIScience/graphhopper) which can be found [here](https://github.com/GIScience/graphhopper).

[![ors client accessibility](https://user-images.githubusercontent.com/23240110/30385487-9eac96b8-98a7-11e7-9357-afd4df8fccdf.png)](https://openrouteservice.org/reach)

**Note**

- Our geocoding API is a separate service running the stack built around [**Pelias**](https://github.com/pelias/pelias).
- Our locations/API is another service which we have coined **openpoiservice** which can be found [here](https://github.com/GIScience/openpoiservice).

Expand All @@ -29,13 +30,7 @@ Please note that openrouteservice uses a forked and edited version of [graphhopp

We appreciate any kind of contribution - bug reports, new feature suggestion or improving our translations are greatly appreciated. Feel free to create an [issue](https://github.com/GIScience/openrouteservice/issues) and label it accordingly. If your issue regards the openrouteservice web-app please use the [corresponding repository](https://github.com/GIScience/openrouteservice-app/issues).

If you want to do contribute your improvements, please follow these steps:

1. [Fork the openrouteservice project](https://help.github.com/articles/fork-a-repo)

2. Create a branch for the improvement from the development branch on your fork and add your contributions there.

3. Create a [pull request](https://help.github.com/articles/using-pull-requests) to our development branch, so we can review your changes before applying them. Please write your pull request description similar to [this](http://api.coala.io/en/latest/Developers/Writing_Good_Commits.html) standard. Also please make sure to reference your pull request to the corresponding issue, for changes regarding multiple issues please create different pullrequests using different branches in your fork.
If you want to contribute your improvements, please follow the steps outlined in [our CONTRIBUTION guidelines](./CONTRIBUTE.md)


## Installation
Expand Down Expand Up @@ -63,7 +58,7 @@ After you have packaged openrouteservice, there are two options for running it.

1. Install Tomcat 8 using `sudo apt-get install tomcat8`.
2. If you want to use system settings (i.e. Java heap size) other than the default, then you need to add these to the `/usr/share/tomcat8/bin/setenv.sh` file. If the file is not present, then you can create it. The settings generally used on our servers are similar to:

```bash
JAVA_OPTS="-server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms114g -Xmx114g -XX:MaxMetaspaceSize=50m"
CATALINA_OPTS="(here we set settings for JMX monitoring)"
Expand Down Expand Up @@ -96,7 +91,7 @@ After obtaining your key you can try out the different endpoints instantly and s

## Questions

For questions please use our [Google Groups Forum](https://groups.google.com/forum/#!forum/openrouteservice) and we will respond to you shortly or add a GitHub issue if it is of technical nature.
For questions please use our [community forum](https://ask.openrouteservice.org).

## Translations

Expand Down
25 changes: 0 additions & 25 deletions contributing.md

This file was deleted.

2 changes: 1 addition & 1 deletion openrouteservice-api-tests/conf/app.config.test
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,4 @@
stdout: true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -754,4 +754,33 @@ public void expectSuppressedWarnings() {
.body("routes[0].containsKey('warnings')", is(false))
.statusCode(200);
}

@Test
public void expectSimplifyGeometry() {
given()
.param("coordinates", getParameter("coordinatesShort"))
.param("profile", getParameter("carProfile"))
.param("geometry_simplify", "true")
.when()
.get(getEndPointName())
.then()
.assertThat()
.body("any { it.key == 'routes' }", is(true))
.statusCode(200);
};

@Test
public void expectIncompatibleParameters() {
given()
.param("coordinates", getParameter("coordinatesShort"))
.param("profile", getParameter("carProfile"))
.param("geometry_simplify", "true")
.param("extra_info", getParameter("extra_info"))
.when()
.get(getEndPointName())
.then()
.assertThat()
.body("error.code", is(RoutingErrorCodes.INCOMPATIBLE_PARAMETERS))
.statusCode(400);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -1500,5 +1500,32 @@ public void testAlternativeRoutes() {
.body("routes[1].summary.duration", is(1414))
.statusCode(200);
}

@Test
public void testSimplifyHasLessWayPoints() {

given()
.param("coordinates", getParameter("coordinatesShort"))
.param("profile", "driving-car")
.param("format", "geojson")
.when()
.get(getEndPointName())
.then()
.assertThat()
.body("features[0].geometry.coordinates.size()", is(75))
.statusCode(200);

given()
.param("coordinates", getParameter("coordinatesShort"))
.param("profile", "driving-car")
.param("format", "geojson")
.param("geometry_simplify", "true")
.when()
.get(getEndPointName())
.then()
.assertThat()
.body("features[0].geometry.coordinates.size()", is(34))
.statusCode(200);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ public class RoutingErrorCodes {
public static int EMPTY_ELEMENT = 2008;
public static int ROUTE_NOT_FOUND = 2009;
public static int POINT_NOT_FOUND = 2010;
public static int INCOMPATIBLE_PARAMETERS = 2011;
public static int UNKNOWN = 2099;
}
1 change: 1 addition & 0 deletions openrouteservice/WebContent/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<servlet-mapping>
<servlet-name>routing</servlet-name>
<url-pattern>/routes</url-pattern>
<url-pattern>/directions</url-pattern>
</servlet-mapping>

<!-- GEOCODING SERVICE -->
Expand Down
30 changes: 15 additions & 15 deletions openrouteservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,6 @@
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org</url>
</repository>
<repository>
<id>bintray-nitram509-jbrotli</id>
<name>bintray</name>
Expand All @@ -193,6 +180,19 @@
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.boundlessgeo.com/main </url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -273,13 +273,13 @@
<dependency>
<groupId>com.github.GIScience.graphhopper</groupId>
<artifactId>graphhopper-core</artifactId>
<version>v0.10.1-8</version>
<version>v0.10.1.12</version>
</dependency>

<dependency>
<groupId>com.github.GIScience.graphhopper</groupId>
<artifactId>graphhopper-reader-osm</artifactId>
<version>v0.10.1-8</version>
<version>v0.10.1.12</version>
</dependency>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* 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
* 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.
* 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/>.
*/
package heigit.ors.exceptions;

import heigit.ors.common.StatusCode;

public class IncompatibleParametersException extends StatusCodeException
{
private static final long serialVersionUID = 507243355121086541L;

public IncompatibleParametersException(int errorCode, String param1, String param2)
{
super(StatusCode.BAD_REQUEST, errorCode, "Parameter '" + param1 + "' is incompatible with parameter '" + param2 + "'.");
}
}

Loading

0 comments on commit b9e23f4

Please sign in to comment.