private void start() { IsochroneApi isochrone = new IsochroneApi(); String key = System.getProperty("graphhopper.key", ""); try { // Please note: the request string for the point has the order "lat,lon" but the response contains // an array with the order [lon,lat] IsochroneResponse rsp = isochrone.isochroneGet("51.183728,14.42801", key, 10 * 60, -1, "car", 3, false); final IsochroneResponsePolygon isochrone0 = rsp.getPolygons().get(0); ResponseCoordinatesArray exteriorRing = isochrone0.getGeometry().getCoordinates().get(0); System.out.println(exteriorRing); double lon0 = ((Number) exteriorRing.get(0).get(0)).doubleValue(); double lat0 = ((Number) exteriorRing.get(0).get(1)).doubleValue(); System.out.println("first coord " + lat0 + ", " + lon0); } catch (Exception ex) { throw new RuntimeException(ex); } } }
@SuppressWarnings("rawtypes") private com.squareup.okhttp.Call isochroneGetValidateBeforeCall(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'point' is set if (point == null) { throw new ApiException("Missing the required parameter 'point' when calling isochroneGet(Async)"); } // verify the required parameter 'key' is set if (key == null) { throw new ApiException("Missing the required parameter 'key' when calling isochroneGet(Async)"); } com.squareup.okhttp.Call call = isochroneGetCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, progressListener, progressRequestListener); return call; }
/** * Isochrone Request * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * @param point Specify the start coordinate (required) * @param key Get your key at graphhopper.com (required) * @param timeLimit Specify which time the vehicle should travel. In seconds. (optional, default to 600) * @param distanceLimit Specify which distance the vehicle should travel. In meter. (optional, default to -1) * @param vehicle Possible vehicles are bike, car, foot and [more](https://graphhopper.com/api/1/docs/supported-vehicle-profiles/) (optional, default to car) * @param buckets For how many sub intervals an additional polygon should be calculated. (optional, default to 1) * @param reverseFlow If `false` the flow goes from point to the polygon, if `true` the flow goes from the polygon \"inside\" to the point. Example usage for `false`&#58; *How many potential customer can be reached within 30min travel time from your store* vs. `true`&#58; *How many customers can reach your store within 30min travel time.* (optional, default to false) * @return IsochroneResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public IsochroneResponse isochroneGet(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow) throws ApiException { ApiResponse<IsochroneResponse> resp = isochroneGetWithHttpInfo(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow); return resp.getData(); }
/** * Isochrone Request * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * @param point Specify the start coordinate (required) * @param key Get your key at graphhopper.com (required) * @param timeLimit Specify which time the vehicle should travel. In seconds. (optional, default to 600) * @param distanceLimit Specify which distance the vehicle should travel. In meter. (optional, default to -1) * @param vehicle Possible vehicles are bike, car, foot and [more](https://graphhopper.com/api/1/docs/supported-vehicle-profiles/) (optional, default to car) * @param buckets For how many sub intervals an additional polygon should be calculated. (optional, default to 1) * @param reverseFlow If `false` the flow goes from point to the polygon, if `true` the flow goes from the polygon \"inside\" to the point. Example usage for `false`&#58; *How many potential customer can be reached within 30min travel time from your store* vs. `true`&#58; *How many customers can reach your store within 30min travel time.* (optional, default to false) * @return ApiResponse<IsochroneResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<IsochroneResponse> isochroneGetWithHttpInfo(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow) throws ApiException { com.squareup.okhttp.Call call = isochroneGetValidateBeforeCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, null, null); Type localVarReturnType = new TypeToken<IsochroneResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
/** * Isochrone Request * * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * * @throws ApiException * if the Api call fails */ @Test public void isochroneGetTest() throws ApiException { String point = null; String key = null; Integer timeLimit = null; Integer distanceLimit = null; String vehicle = null; Integer buckets = null; Boolean reverseFlow = null; IsochroneResponse response = api.isochroneGet(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow); // TODO: test validations }
/** * Isochrone Request * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * @param point Specify the start coordinate (required) * @param key Get your key at graphhopper.com (required) * @param timeLimit Specify which time the vehicle should travel. In seconds. (optional, default to 600) * @param distanceLimit Specify which distance the vehicle should travel. In meter. (optional, default to -1) * @param vehicle Possible vehicles are bike, car, foot and [more](https://graphhopper.com/api/1/docs/supported-vehicle-profiles/) (optional, default to car) * @param buckets For how many sub intervals an additional polygon should be calculated. (optional, default to 1) * @param reverseFlow If `false` the flow goes from point to the polygon, if `true` the flow goes from the polygon \"inside\" to the point. Example usage for `false`&#58; *How many potential customer can be reached within 30min travel time from your store* vs. `true`&#58; *How many customers can reach your store within 30min travel time.* (optional, default to false) * @param weighting Can be fastest or shortest (optional, default to fastest) * @return ApiResponse<IsochroneResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<IsochroneResponse> isochroneGetWithHttpInfo(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow, String weighting) throws ApiException { com.squareup.okhttp.Call call = isochroneGetValidateBeforeCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, weighting, null, null); Type localVarReturnType = new TypeToken<IsochroneResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
/** * Isochrone Request * * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * * @throws ApiException * if the Api call fails */ @Test public void isochroneGetTest() throws ApiException { String point = null; String key = null; Integer timeLimit = null; Integer distanceLimit = null; String vehicle = null; Integer buckets = null; Boolean reverseFlow = null; IsochroneResponse response = api.isochroneGet(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow); // TODO: test validations }
/** * Isochrone Request * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * @param point Specify the start coordinate (required) * @param key Get your key at graphhopper.com (required) * @param timeLimit Specify which time the vehicle should travel. In seconds. (optional, default to 600) * @param distanceLimit Specify which distance the vehicle should travel. In meter. (optional, default to -1) * @param vehicle Possible vehicles are bike, car, foot and [more](https://graphhopper.com/api/1/docs/supported-vehicle-profiles/) (optional, default to car) * @param buckets For how many sub intervals an additional polygon should be calculated. (optional, default to 1) * @param reverseFlow If `false` the flow goes from point to the polygon, if `true` the flow goes from the polygon \"inside\" to the point. Example usage for `false`&#58; *How many potential customer can be reached within 30min travel time from your store* vs. `true`&#58; *How many customers can reach your store within 30min travel time.* (optional, default to false) * @return ApiResponse<IsochroneResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<IsochroneResponse> isochroneGetWithHttpInfo(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow) throws ApiException { com.squareup.okhttp.Call call = isochroneGetValidateBeforeCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, null, null); Type localVarReturnType = new TypeToken<IsochroneResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
@SuppressWarnings("rawtypes") private com.squareup.okhttp.Call isochroneGetValidateBeforeCall(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'point' is set if (point == null) { throw new ApiException("Missing the required parameter 'point' when calling isochroneGet(Async)"); } // verify the required parameter 'key' is set if (key == null) { throw new ApiException("Missing the required parameter 'key' when calling isochroneGet(Async)"); } com.squareup.okhttp.Call call = isochroneGetCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, progressListener, progressRequestListener); return call; }
/** * Isochrone Request * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * @param point Specify the start coordinate (required) * @param key Get your key at graphhopper.com (required) * @param timeLimit Specify which time the vehicle should travel. In seconds. (optional, default to 600) * @param distanceLimit Specify which distance the vehicle should travel. In meter. (optional, default to -1) * @param vehicle Possible vehicles are bike, car, foot and [more](https://graphhopper.com/api/1/docs/supported-vehicle-profiles/) (optional, default to car) * @param buckets For how many sub intervals an additional polygon should be calculated. (optional, default to 1) * @param reverseFlow If `false` the flow goes from point to the polygon, if `true` the flow goes from the polygon \"inside\" to the point. Example usage for `false`&#58; *How many potential customer can be reached within 30min travel time from your store* vs. `true`&#58; *How many customers can reach your store within 30min travel time.* (optional, default to false) * @return IsochroneResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public IsochroneResponse isochroneGet(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow) throws ApiException { ApiResponse<IsochroneResponse> resp = isochroneGetWithHttpInfo(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow); return resp.getData(); }
com.squareup.okhttp.Call call = isochroneGetValidateBeforeCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, weighting, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<IsochroneResponse>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback);
@SuppressWarnings("rawtypes") private com.squareup.okhttp.Call isochroneGetValidateBeforeCall(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow, String weighting, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'point' is set if (point == null) { throw new ApiException("Missing the required parameter 'point' when calling isochroneGet(Async)"); } // verify the required parameter 'key' is set if (key == null) { throw new ApiException("Missing the required parameter 'key' when calling isochroneGet(Async)"); } com.squareup.okhttp.Call call = isochroneGetCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, weighting, progressListener, progressRequestListener); return call; }
/** * Isochrone Request * The GraphHopper Isochrone API allows calculating an isochrone of a locations means to calculate 'a line connecting points at which a vehicle arrives at the same time,' see [Wikipedia](http://en.wikipedia.org/wiki/Isochrone_map). It is also called **reachability** or **walkability**. * @param point Specify the start coordinate (required) * @param key Get your key at graphhopper.com (required) * @param timeLimit Specify which time the vehicle should travel. In seconds. (optional, default to 600) * @param distanceLimit Specify which distance the vehicle should travel. In meter. (optional, default to -1) * @param vehicle Possible vehicles are bike, car, foot and [more](https://graphhopper.com/api/1/docs/supported-vehicle-profiles/) (optional, default to car) * @param buckets For how many sub intervals an additional polygon should be calculated. (optional, default to 1) * @param reverseFlow If `false` the flow goes from point to the polygon, if `true` the flow goes from the polygon \"inside\" to the point. Example usage for `false`&#58; *How many potential customer can be reached within 30min travel time from your store* vs. `true`&#58; *How many customers can reach your store within 30min travel time.* (optional, default to false) * @param weighting Can be fastest or shortest (optional, default to fastest) * @return IsochroneResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public IsochroneResponse isochroneGet(String point, String key, Integer timeLimit, Integer distanceLimit, String vehicle, Integer buckets, Boolean reverseFlow, String weighting) throws ApiException { ApiResponse<IsochroneResponse> resp = isochroneGetWithHttpInfo(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, weighting); return resp.getData(); }
com.squareup.okhttp.Call call = isochroneGetValidateBeforeCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<IsochroneResponse>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback);
com.squareup.okhttp.Call call = isochroneGetValidateBeforeCall(point, key, timeLimit, distanceLimit, vehicle, buckets, reverseFlow, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<IsochroneResponse>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback);