Skip to content

Commit

Permalink
fix #119
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jan 26, 2024
1 parent 5e2cc9b commit a995d4f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/WCSCoverageSummary.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary",
label = "time", uom = "s", type = "temporal",
coefficients = des$Domain$temporalDomain$instants
)

}
}

Expand All @@ -231,7 +230,8 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary",
self$ERROR("No 'srsName' envelope attribute for CRS interpretation")
return(NULL)
}
srsNameXML <- try(XML::xmlParse(srsName), silent = TRUE)
srsName = gsub("http://", "https://", srsName) #attempt to rewrite http to https
srsNameXML <- try(XML::xmlParse(httr::content(httr::GET(srsName),"text")), silent = TRUE)
if(is(srsNameXML,"try-error")){
self$ERROR(sprintf("Error during CRS interpretation for srsName = '%s'", srsName))
return(NULL)
Expand All @@ -247,8 +247,9 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary",
out_crs <- thecrs
crsHref <- thecrs$attrs[["xlink:href"]]
if(!is.null(crsHref)){
crsHref = gsub("http://", "https://", crsHref) #attempt to rewrite http to https
self$INFO(sprintf("Try to parse CRS from '%s'", crsHref))
crsXML <- try(XML::xmlParse(crsHref))
crsXML <- try(XML::xmlParse(httr::content(httr::GET(crsHref),"text")), silent = TRUE)
if(is(crsXML, "try-error")){
self$ERROR(sprintf("Error during parsing CRS '%s'", crsHref))
return(NULL)
Expand Down

0 comments on commit a995d4f

Please sign in to comment.