{"id":16552395,"url":"https://github.com/dieghernan/arcgeocoder","last_synced_at":"2025-10-28T19:30:19.366Z","repository":{"id":216186146,"uuid":"739454763","full_name":"dieghernan/arcgeocoder","owner":"dieghernan","description":"Lite interface for geocoding with ArcGIS REST API","archived":false,"fork":false,"pushed_at":"2025-01-20T03:41:00.000Z","size":32582,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T17:35:11.054Z","etag":null,"topics":["api-rest","arcgis","arcgis-api","cran","cran-r","geocoding","gis","r","r-package","reverse-geocoding"],"latest_commit_sha":null,"homepage":"https://dieghernan.github.io/arcgeocoder/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dieghernan.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json"}},"created_at":"2024-01-05T15:54:29.000Z","updated_at":"2025-01-07T14:47:42.000Z","dependencies_parsed_at":"2024-03-18T12:00:30.911Z","dependency_job_id":"48f3787f-d869-4aab-b9d7-0dbc20cb621f","html_url":"https://github.com/dieghernan/arcgeocoder","commit_stats":{"total_commits":68,"total_committers":4,"mean_commits":17.0,"dds":0.25,"last_synced_commit":"917c8579a7adffd0fe5748f52f09ae76f9106561"},"previous_names":["dieghernan/arcgeocoder"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieghernan%2Farcgeocoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieghernan%2Farcgeocoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieghernan%2Farcgeocoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieghernan%2Farcgeocoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dieghernan","download_url":"https://codeload.github.com/dieghernan/arcgeocoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238700711,"owners_count":19515980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","arcgis","arcgis-api","cran","cran-r","geocoding","gis","r","r-package","reverse-geocoding"],"created_at":"2024-10-11T19:44:42.618Z","updated_at":"2025-10-28T19:30:18.870Z","avatar_url":"https://github.com/dieghernan.png","language":"R","readme":"---\noutput: github_document\nbibliography: inst/REFERENCES.bib\nlink-citations: true\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  warning = FALSE,\n  message = FALSE,\n  dev = \"ragg_png\",\n  tidy = \"styler\",\n  fig.path = \"man/figures/README-\",\n  dpi = 120,\n  out.width = \"100%\"\n)\n```\n\n# arcgeocoder \u003ca href=\"https://dieghernan.github.io/arcgeocoder/\"\u003e\u003cimg src=\"man/figures/logo.png\" alt=\"arcgeocoder website\" align=\"right\" height=\"139\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![CRAN\nstatus](https://www.r-pkg.org/badges/version/arcgeocoder)](https://CRAN.R-project.org/package=arcgeocoder)\n[![CRAN\nresults](https://badges.cranchecks.info/worst/arcgeocoder.svg)](https://cran.r-project.org/web/checks/check_results_arcgeocoder.html)\n[![Downloads](https://cranlogs.r-pkg.org/badges/arcgeocoder)](https://CRAN.R-project.org/package=arcgeocoder)\n[![R-CMD-check](https://github.com/dieghernan/arcgeocoder/actions/workflows/check-full.yaml/badge.svg)](https://github.com/dieghernan/arcgeocoder/actions/workflows/check-full.yaml)\n[![R-hub](https://github.com/dieghernan/arcgeocoder/actions/workflows/rhub.yaml/badge.svg)](https://github.com/dieghernan/arcgeocoder/actions/workflows/rhub.yaml)\n[![codecov](https://codecov.io/gh/dieghernan/arcgeocoder/graph/badge.svg)](https://app.codecov.io/gh/dieghernan/arcgeocoder)\n[![r-universe](https://dieghernan.r-universe.dev/badges/arcgeocoder)](https://dieghernan.r-universe.dev/arcgeocoder)\n[![CodeFactor](https://www.codefactor.io/repository/github/dieghernan/arcgeocoder/badge)](https://www.codefactor.io/repository/github/dieghernan/arcgeocoder)\n[![Project Status: Active -- The project has reached a stable, usable state and\nis being actively\ndeveloped.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![DOI](https://img.shields.io/badge/DOI-10.32614/CRAN.package.arcgeocoder-blue)](https://doi.org/10.32614/CRAN.package.arcgeocoder)\n[![status](https://tinyverse.netlify.app/status/arcgeocoder)](https://CRAN.R-project.org/package=arcgeocoder)\n\n\u003c!-- badges: end --\u003e\n\nThe goal of **arcgeocoder** is to provide a light interface for geocoding\naddresses and reverse geocoding location trough the [ArcGIS REST API Geocoding\nService](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm).\n\nFull site with examples and vignettes on\n\u003chttps://dieghernan.github.io/arcgeocoder/\u003e\n\n## Why **arcgeocoder**?\n\n**arcgeocoder** is a package that provides a lightweight interface for geocoding\nand reverse geocoding with the ArcGIS REST API service. The goal of\n**arcgeocoder** is to access the ArcGIS REST API with fewer dependencies, such\nas **curl**. In some situations, **curl** may not be available or accessible, so\n**arcgeocoder** uses base functions to overcome this limitation.\n\nThe interface of **apigeocoder** is built with the aim of easing the access to\nall the features provided by the API. The API endpoints used by **arcgeocoder**\nare `findAddressCandidates` and `reverseGeocode`, which can be accessed\n[**without**]{.underline} the need for an [**API key**]{.underline}.\n\n## Recommended packages\n\nThere are other packages much more complete and mature than **arcgeocoder**,\nthat presents similar features:\n\n-   [**tidygeocoder**](https://jessecambon.github.io/tidygeocoder/)\n    [@R-tidygeocoder]. Allows to interface with ArcGIS, Nominatim\n    (OpenStreetMaps), Google, TomTom, Mapbox, etc. for geocoding and reverse\n    geocoding.\n-   [**nominatimlite**](https://dieghernan.github.io/nominatimlite/)\n    [@R-nominatimlite]. Similar to **arcgeocoder** but using data from\n    OpenStreetMaps trough the [Nominatim\n    API](https://nominatim.org/release-docs/latest/) service.\n\n## Installation\n\nInstall **arcgeocoder** from\n[**CRAN**](https://CRAN.R-project.org/package=arcgeocoder) with:\n\n```{r, eval=FALSE}\ninstall.packages(\"arcgeocoder\")\n```\n\nYou can install the developing version of **arcgeocoder** with:\n\n```{r, eval=FALSE}\nremotes::install_github(\"dieghernan/arcgeocoder\")\n```\n\nAlternatively, you can install **arcgeocoder** using the\n[r-universe](https://dieghernan.r-universe.dev/arcgeocoder):\n\n```{r, eval=FALSE}\n# Install arcgeocoder in R:\ninstall.packages(\"arcgeocoder\",\n  repos = c(\n    \"https://dieghernan.r-universe.dev\",\n    \"https://cloud.r-project.org\"\n  )\n)\n```\n\n## Usage\n\n### Geocoding and reverse geocoding\n\n*Note: examples adapted from **tidygeocoder** package*\n\nIn this first example we will geocode a few addresses using the `arc_geo()`\nfunction. Note that **arcgeocoder** works straight away, and you don't need to\nprovide any API key to start geocoding!\n\n```{r example}\nlibrary(arcgeocoder)\nlibrary(dplyr)\n\n# create a dataframe with addresses\nsome_addresses \u003c- tribble(\n  ~name,                  ~addr,\n  \"White House\",          \"1600 Pennsylvania Ave NW, Washington, DC\",\n  \"Transamerica Pyramid\", \"600 Montgomery St, San Francisco, CA 94111\",\n  \"Willis Tower\",         \"233 S Wacker Dr, Chicago, IL 60606\"\n)\n\n# geocode the addresses\nlat_longs \u003c- arc_geo(some_addresses$addr, lat = \"latitude\", long = \"longitude\")\n```\n\nOnly a few fields are returned from the geocoder service in this example, but\n`full_results = TRUE` can be used to return all of the data from the geocoder\nservice.\n\n```{r echo=FALSE}\nknitr::kable(lat_longs)\n```\n\nTo perform reverse geocoding (obtaining addresses from geographic coordinates),\nwe can use the `arc_reverse_geo()` function. The arguments are similar to the\n`arc_geo()` function, but now we specify the input data columns with the `x` and\n`y` arguments. The dataset used here is from the geocoder query above. The\nsingle line address is returned in a column named by the `address`.\n\n```{r}\nreverse \u003c- arc_reverse_geo(\n  x = lat_longs$longitude,\n  y = lat_longs$latitude,\n  address = \"address_found\"\n)\n```\n\n```{r, echo = FALSE}\nknitr::kable(reverse)\n```\n\nIt is possible also to search for specific locations within or near a reference\nare or location using [category\nfiltering](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm).\nSee more information in the documentation of the data base `arc_categories`.\n\nIn the following example we would look for POIs related with food (i.e.\nRestaurants, Coffee Shops, Bakeries) near the Eiffel Tower in France.\n\n```{r eiffel, fig.cap=\"Example: Food places near the Eiffel Tower\"}\nlibrary(ggplot2) # For plotting\n\n# Step 1: Locate Eiffel Tower, using multifield query\n\neiffel_tower \u003c- arc_geo_multi(\n  address = \"Tour Eiffel\",\n  city = \"Paris\",\n  countrycode = \"FR\",\n  langcode = \"FR\",\n  custom_query = list(outFields = \"LongLabel\")\n)\n\n# Display results\neiffel_tower %\u003e%\n  select(lon, lat, LongLabel)\n\n\n# Use lon,lat to boots the search and using category = Food\nfood_eiffel \u003c- arc_geo_categories(\"Food\",\n  x = eiffel_tower$lon,\n  y = eiffel_tower$lat,\n  limit = 50, full_results = TRUE\n)\n\n# Plot by Food Type\nggplot(eiffel_tower, aes(x, y)) +\n  geom_point(shape = 17, color = \"red\", size = 4) +\n  geom_point(data = food_eiffel, aes(x, y, color = Type)) +\n  labs(\n    title = \"Food near the Eiffel Tower\",\n    subtitle = \"Using arcgecoder\",\n    color = \"Type of place\",\n    x = \"\",\n    y = \"\",\n    caption = \"Data from ArcGIS REST API services\"\n  )\n```\n\n### **arcgeocoder** and **r-spatial**\n\nIt is straightforward to convert the results of **arcgeocoder** to an **sf**\nobject (geospatial format):\n\n```{r eiffel_sf, fig.cap=\"Example: Food places near the Eiffel Tower using the sf package.\"}\nlibrary(sf)\n\nfood_eiffel_sf \u003c- st_as_sf(food_eiffel,\n  coords = c(\"lon\", \"lat\"),\n  # The CRS of the resulting coords is here\n  crs = eiffel_tower$wkid\n)\n\nfood_eiffel_sf\n\nggplot(food_eiffel_sf) +\n  geom_sf(aes(color = Type)) +\n  coord_sf(crs = 3035)\n```\n\nSee additional articles showing how **arcgeocoder** can be use in combination\nwith **leaflet** to create [dynamic\nmaps](https://dieghernan.github.io/arcgeocoder/articles/ex_leaflet.html) and\nwith **sf** and **terra** to create [static\nmaps](https://dieghernan.github.io/arcgeocoder/articles/ex_static.html).\n\n## Citation\n\n```{r echo=FALSE, results='asis'}\nprint(citation(\"arcgeocoder\"), style = \"html\")\n```\n\nA BibTeX entry for LaTeX users is\n\n```{r echo=FALSE, comment=\"\"}\ntoBibtex(citation(\"arcgeocoder\"))\n```\n\n## References\n\n::: {#refs}\n:::\n\n## Contributors\n\n\n\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\nAll contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [allcontributors](https://allcontributors.org) specification. Contributions of any kind are welcome!\n\n\u003ctable class=\"table allctb-table\" \u003e\n\n\u003ctr\u003e\n\u003ctd align=\"center\"\u003e\n\u003ca href=\"https://github.com/dieghernan\"\u003e\n\u003cimg src=\"https://avatars.githubusercontent.com/u/25656809?v=4\" width=\"100px;\" class=\"allctb-avatar\" alt=\"\"/\u003e\n\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/dieghernan/arcgeocoder/commits?author=dieghernan\"\u003edieghernan\u003c/a\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieghernan%2Farcgeocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdieghernan%2Farcgeocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieghernan%2Farcgeocoder/lists"}