You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When I copy a GeoService URL from a layer information page on a ArcGIS Hub site, it always has a default query appended "/query?outFields=*&where=1%3D1". The URL returns an error that isn't even very helpful at figuring out what went wrong.
Describe the solution you'd like
If possible, I'd like to see arcgislayers support queries passed as part of the URL. This would also be handy for setting up filtered views interactively with a non-R user and then reusing the generated URL rather than needing to reconstruct the query separately.
Either way, it may be helpful to add appropriate warning or error messages for URLs an appended query to avoid confusion by users.
This reprex illustrates a basic potential solution that could be incorporated into arc_select():
library(arcgislayers)
url<-"https://geodata.md.gov/imap/rest/services/Boundaries/MD_PhysicalBoundaries/FeatureServer/1/query?outFields=*&where=1%3D1"data<- arc_read(url)
#> Error in `arc_read()`:#> ! `url` is not a supported type: "FeatureLayer", "Table", or#> "ImageServer"#> ℹ found "FeatureServer"
@elipousson what do you think about something along the lines of this?
# get the urlurl<-"https://geodata.md.gov/imap/rest/services/Boundaries/MD_PhysicalBoundaries/FeatureServer/1/query?outFields=*&where=1%3D1"# parse the urlparsed_url<-httr2::url_parse(url)
# enumerate known path typesknown_content_types<- c("FeatureServer", "MapServer", "ImageServer", "GeocodeServer")
# make regexcontent_pattern<- paste(known_content_types, collapse="|")
# extrect kind from URLurl_type<-stringr::str_extract(parsed_url$path, content_pattern)
url_type#> [1] "FeatureServer"
Is your feature request related to a problem? Please describe.
When I copy a GeoService URL from a layer information page on a ArcGIS Hub site, it always has a default query appended "/query?outFields=*&where=1%3D1". The URL returns an error that isn't even very helpful at figuring out what went wrong.
Describe the solution you'd like
If possible, I'd like to see arcgislayers support queries passed as part of the URL. This would also be handy for setting up filtered views interactively with a non-R user and then reusing the generated URL rather than needing to reconstruct the query separately.
Either way, it may be helpful to add appropriate warning or error messages for URLs an appended query to avoid confusion by users.
This reprex illustrates a basic potential solution that could be incorporated into
arc_select()
:Created on 2024-08-06 with reprex v2.1.0
Describe alternatives you've considered
This may be related to the URL validation proposed for arcgisutils so could be incorporated into that package instead: R-ArcGIS/arcgisutils#31
The text was updated successfully, but these errors were encountered: