R-ArcGIS / arcgislayers

ArcGIS Location Services
http://r.esri.com/arcgislayers/
Apache License 2.0
39 stars 9 forks source link

list_items() should have type checking #139

Closed JosiahParry closed 7 months ago

JosiahParry commented 8 months ago

Describe the bug

list_items() does not have any class checking and will try to work on any R items. It should check for inheritance of MapServer or FeatureServer.

The details of list_items() Rd page should also more clearly document what the fields represent.

E.g. what does -1 parent layer mean?

To Reproduce

library(arcgis)
#> Attaching core arcgis packages:
#>   - {arcgisutils} v0.1.1.9001
#>   - {arcgislayers} v0.1.0
url <- 'https://ags.esri.co/arcgis/rest/services/DatosAbiertos/ELECCIONES_PRESIDENCIALES_2014_MPIO/MapServer/0'
fl <- arc_open(url)
list_items(fl)
#> NULL

Expected behavior

error with informative message of class