Skip to content

Commit

Permalink
#43 prepare case where getfeatureinfo returns adhoc xml (eg. esri, th…
Browse files Browse the repository at this point in the history
…redds)
  • Loading branch information
eblondel committed Jul 7, 2021
1 parent a40fc07 commit d82c6aa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion R/WMSLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,18 @@ WMSLayer <- R6Class("WMSLayer",
write(obj, destfile)
}

ftFeatures <- sf::st_read(destfile, quiet = TRUE)
ftFeatures <- NULL
if(destext == "xml"){
rootname <- xmlName(xmlChildren(xml)[[1]])
if(rootname == "FeatureInfoResponse"){
#TODO build sf(s) based on a FeatureInfoResponse xml (eg. case of Thredds data servers)
}else{
ftFeatures <- sf::st_read(destfile, quiet = TRUE)
}
}else{
ftFeatures <- sf::st_read(destfile, quiet = TRUE)
}

if(is.null(st_crs(ftFeatures))){
st_crs(ftFeatures) <- self$getDefaultCRS()
}
Expand Down

0 comments on commit d82c6aa

Please sign in to comment.