R-ArcGIS / arcgisgeocode

Utilize public or private ArcGIS Geocoder Services from R. Provides reverse geocoding, candidate search, single address, and batch geocoding.
http://r.esri.com/arcgisgeocode/
Apache License 2.0
40 stars 6 forks source link

`esri_wkids` is unavailable unless arcgisgeocode is loaded w/ `library()` #35

Closed elipousson closed 2 months ago

elipousson commented 2 months ago

I have a fix for this ready for a PR – just setting up the issue first.

arcgisgeocode::geocode_addresses(
  "10 N Calvert Street",
  geocoder = arcgisgeocode::geocode_server(
    "https://egis.baltimorecity.gov/egis/rest/services/Locator/EGISCompositeLocator/GeocodeServer"
  )
)
#> Error in parse_wkid(res_list$sr$wkid): object 'esri_wkids' not found

library(arcgisgeocode)

geocode_addresses(
  "10 N Calvert Street",
  geocoder = geocode_server(
    "https://egis.baltimorecity.gov/egis/rest/services/Locator/EGISCompositeLocator/GeocodeServer"
  )
)
#> Simple feature collection with 1 feature and 59 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 1421984 ymin: 591503.9 xmax: 1421984 ymax: 591503.9
#> Projected CRS: NAD_1983_StatePlane_Maryland_FIPS_1900_Feet
#>   result_id     loc_name status score                            match_addr
#> 1         1 EGIS_Address      M   100 10 N CALVERT ST, Baltimore, MD, 21202
#>                              long_label     short_label    addr_type type_field
#> 1 10 N CALVERT ST, Baltimore, MD, 21202 10 N CALVERT ST PointAddress       <NA>
#>   place_name                            place_addr phone  url rank add_bldg
#> 1       <NA> 10 N CALVERT ST, Baltimore, MD, 21202  <NA> <NA>   20     <NA>
#>   add_num add_num_from add_num_to add_range side st_pre_dir st_pre_type st_name
#> 1      10         <NA>       <NA>      <NA> <NA>       <NA>           N CALVERT
#>   st_type st_dir bldg_type bldg_name level_type level_name unit_type unit_name
#> 1      ST   <NA>      <NA>      <NA>       <NA>       <NA>      <NA>      <NA>
#>   sub_addr         st_addr block sector nbrhd district      city metro_area
#> 1     <NA> 10 N CALVERT ST  <NA>   <NA>  <NA>     <NA> Baltimore       <NA>
#>        subregion region region_abbr territory zone postal postal_ext country
#> 1 Baltimore City     MD        <NA>      <NA> <NA>  21202       <NA>    <NA>
#>   cntry_name lang_code distance       x        y display_x display_y    xmin
#> 1         US       ENG        0 1421984 591503.9   1421984  591503.9 1421703
#>      xmax     ymin     ymax ex_info                 geometry
#> 1 1422266 591138.5 591869.3    <NA> POINT (1421984 591503.9)

Created on 2024-09-19 with reprex v2.1.1