Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add snapping endpoint #1524

Merged
merged 18 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RELEASING:
## [Unreleased]

### Added
- snapping service endpoints for returning nearest points on the graph ([#1519](https://github.com/GIScience/openrouteservice/issues/1519))
- workflow for RPM packaging ([#1490](https://github.com/GIScience/openrouteservice/pull/1490))
- workflow for graph building with GitHub environments ([#1468](https://github.com/GIScience/openrouteservice/pull/1468))
- environment variables for adjusting folders and paths during graph build using docker: ([#1468](https://github.com/GIScience/openrouteservice/pull/1468))
Expand Down
24 changes: 17 additions & 7 deletions docs/installation/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,20 @@ descriptions of each block follows below.
### Properties in the `messages` block

The messages property expects a list of elements where each has the following:
| key | type | description | example value |

| key | type | description | example value |
|-----------|---------|-------------------------------------------------------------------|----------------------|
| active | boolean | Enables or disables this message | `true` |
| text | string | The message text | `"The message text"` |
| condition | list | omittable; may contain any of the conditions from the table below | |
| active | boolean | Enables or disables this message | `true` |
| text | string | The message text | `"The message text"` |
| condition | list | omittable; may contain any of the conditions from the table below | |

| condition | value | description |
|--------------------|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|
| time_before | ISO 8601 datetime string | message sent if server local time is before given point in time |
| time_after | ISO 8601 datetime string | message sent if server local time is after given point in time |
| api_version | 1 or 2 | message sent if API version requested through matches value |
| api_format | String with output formats ("json", "geojson", "gpx"), comma separated | message sent if requested output format matches value |
| request_service | String with service names ("routing", "matrix", "isochrones"), comma separated | message sent if requested service matches one of the given names |
| request_service | String with service names ("routing", "matrix", "isochrones", "snap"), comma separated | message sent if requested service matches one of the given names |
| request_profile | String with profile names, comma separated | message sent if requested profile matches one of the given names |
| request_preference | String with preference (weightings for routing, metrics for matrix, rangetype for isochrones) names, comma separated | message sent if requested preference matches one of the given names |

Expand Down Expand Up @@ -127,6 +128,7 @@ The top level element.
| ors.services.routing | object | settings for routing and its profiles | [routing](#orsservicesrouting) |
| ors.services.isochrones | object | settings for isochrones restrictions | [isochrones](#orsservicesisochrones) |
| ors.services.matrix | object | settings for matrix restrictions | [matrix](#orsservicesmatrix) |
| ors.services.snap | object | settings for snap | [matrix](#orsservicesmatrix) |

---

Expand All @@ -140,7 +142,7 @@ The top level element.
| routing_name | string | Specifies the gpx `name` tag that is returned in a gpx response | `"openrouteservice"` |
| sources | list | the osm file to be used, formats supported are `.osm`, `.osm.gz`, `.osm.zip` and `.pbf` | `["heidelberg.osm.gz"]` |
| init_threads | number | The number of threads used to initialize (build/load) graphs. Higher numbers requires more RAM. | `2` |
| attribution | string | | `"openrouteservice.org, OpenStreetMap contributors"` |
| attribution | string | Attribution added to the response metadata | `"openrouteservice.org, OpenStreetMap contributors"` |
| elevation_preprocessed | boolean | Enables or disables reading ele tags for nodes. Default value is false. If enabled, GH's elevation lookup is prevented and all nodes without ele tag will default to 0. Experimental, for use with the ORS preprocessor | `false` |
| profiles | object | | [profiles](#orsservicesroutingprofiles) |

Expand Down Expand Up @@ -358,7 +360,15 @@ The top level element.
| maximum_search_radius | number | Maximum allowed distance between the requested coordinate and a point on the nearest road. The value is measured in meters | `5000` |
| maximum_visited_nodes | number | Maximum allowed number of visited nodes in shortest path computation. This threshold is applied only for Dijkstra algorithm | `100000` |
| allow_resolve_locations | number | Specifies whether the name of a nearest street to the location can be resolved or not. Default value is true | `true` |
| attribution | string | Specifies whether the name of a nearest street to the location can be resolved or not. Default value is true | `"openrouteservice.org, OpenStreetMap contributors"` |
| attribution | string | Attribution added to the response metadata | `"openrouteservice.org, OpenStreetMap contributors"` |

---
#### ors.services.snap

| key | type | description | example value |
|-------------------------|---------|----------------------------------------------------------------|------------------------------------------------------|
| enabled | boolean | Enables or disables (true/false) the end-point (default: true) | `true` |
| attribution | string | Attribution added to the response metadata | `"openrouteservice.org, OpenStreetMap contributors"` |

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class EndpointsProperties {
private EndpointRoutingProperties routing;
private EndpointMatrixProperties matrix;
private EndpointIsochroneProperties isochrone;

private EndpointSnapProperties snap;
private String swaggerDocumentationUrl;

public void setSwaggerDocumentationUrl(String swaggerDocumentationUrl) {
Expand Down Expand Up @@ -60,6 +60,14 @@ public void setIsochrone(EndpointIsochroneProperties isochrone) {
this.isochrone = isochrone;
}

public EndpointSnapProperties getSnap() {
return snap;
}

public void setSnap(EndpointSnapProperties snap) {
this.snap = snap;
}

public static class EndpointDefaultProperties {
private String attribution;

Expand Down Expand Up @@ -433,4 +441,26 @@ public void setAttribution(String attribution) {
}
}
}

public static class EndpointSnapProperties {
private boolean enabled;
private String attribution;

public boolean isEnabled() {
return enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public String getAttribution() {
return attribution;
}

public void setAttribution(String attribution) {
this.attribution = attribution;
}

}
}
Loading
Loading