Skip to content

Commit

Permalink
feat: add snapping endpoint (#1524)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatRefrigerator committed Oct 6, 2023
2 parents 2790384 + efb7f76 commit a9f8487
Show file tree
Hide file tree
Showing 28 changed files with 1,297 additions and 115 deletions.
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

0 comments on commit a9f8487

Please sign in to comment.