Closed nbanion closed 3 years ago
Hi, thanks for reporting!
This issue is already fixed in #121:
library(hereR)
set_verbose(TRUE)
library(sf)
#> Linking to GEOS 3.8.1, GDAL 3.1.4, PROJ 6.3.1
point <-
c(-73.51263, 44.20958) %>%
st_point() %>% st_sfc() %>% st_sf(crs = "WGS84")
isoline(point, range = 1800)
#> Sending 1 request(s) with 1 RPS to: 'https://isoline.router.hereapi.com/v8/isolines?...'
#> Received 1 response(s) with total size: 5 Kb
#> Simple feature collection with 1 feature and 5 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: -73.90503 ymin: 43.84094 xmax: -73.31863 ymax: 44.64157
#> Geodetic CRS: WGS 84
#> id rank departure arrival range
#> 1 NA 1 2021-05-14 13:34:00 2021-05-14 14:04:00 1800
#> geometry
#> 1 POLYGON ((-73.89885 44.2254...
isoline(point, range = 3600)
#> Sending 1 request(s) with 1 RPS to: 'https://isoline.router.hereapi.com/v8/isolines?...'
#> Received 1 response(s) with total size: 5.9 Kb
#> Simple feature collection with 1 feature and 5 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -74.28955 ymin: 43.42896 xmax: -73.11676 ymax: 45.04395
#> Geodetic CRS: WGS 84
#> id rank departure arrival range
#> 1 NA 1 2021-05-14 13:34:01 2021-05-14 14:34:01 3600
#> geometry
#> 1 MULTIPOLYGON (((-74.27719 4...
Are you using the latest version of the hereR and flexpolyline packages on CRAN?
packageVersion("flexpolyline")
#> [1] '0.2.3'
packageVersion("hereR")
#> [1] '0.7.0'
I was out of date. After updating, the example works for me. Thanks for the fix!
For specific parameter combinations,
hereR::isoline
fails. In these cases, I would expect the function to either (1) return a polygon or (2) throw an error that makes my mistake more obvious.This bug was the motivation to propose workaround #118 . As noted there, it probably makes sense to close that issue and just address the bug directly here.
Below I induce an error by playing with
range
.Created on 2021-05-12 by the reprex package (v2.0.0)