Skip to content

Commit

Permalink
spelling fixes, removing more XML2 experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssarosemartin committed Aug 7, 2023
1 parent f30c078 commit f76e5af
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ rnpn 1.1.1 (2020-10-27)
* Total overhaul of the rNPN package
* Added functions for directly downloading different observation record data types
* Added additional utility and lookup type functions
* Added functions for downloading USA-NPN raster data and geospatial values by latitutde/longitude
* Added functions for downloading USA-NPN raster data and geospatial values by latitude/longitude
* Deprecated the following functions: lookup_names, npn_allobssp, npn_indsatstations, npn_indspatstations, npn_species_comm, npn_species_itis, npn_species_sci, npn_stationsbystate, npn_stationswithspp


Expand Down
7 changes: 3 additions & 4 deletions R/npn_geoserver.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ npn_get_layer_details <- function(){
tryCatch({
doc <- GET("http://geoserver.usanpn.org/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities", list())
doc <- httr::content(doc, as = "text", encoding = "UTF-8")
doc.data <- XML::read_xml(file = doc)
doc.data <- XML::xmlParse(file = doc)

capability.list <- XML::as_list(x = doc.data) #note to self - lost the [["Capability"]] parameter, was it a title?
capability.list <- XML::xmlToList(doc.data)[["Capability"]]

layer.list <- capability.list$Layer
layers <- layer.list[names(layer.list) == "Layer"]
Expand Down Expand Up @@ -253,10 +253,9 @@ npn_get_point_data <- function(
})
#Download the data as XML and store it as an XML doc
xml_data <- httr::content(data, as = "text")
doc <- XML::read_xml(xml_data) #note to self replaced InternalTreeParse - does read_xml assume a tree?
doc <- XML::xmlInternalTreeParse(xml_data)

df <- XML::xmlToDataFrame(XML::xpathApply(doc, "//gml:RectifiedGridCoverage/gml:rangeSet/gml:DataBlock/tupleList"))
#note to self cannot find a solution to the ToDataFrame - the xpathApply solution is at line 63 https://github.com/DOI-USGS/geoknife/pull/362/files#diff-580bc730038e74accf0289eb2f9bfae59d84a9d79a9b096546f57bafaf85f9a7L63

v <- as.numeric(as.list(strsplit(gsub("\n","",df[1,"text"]),' ')[[1]])[1])

Expand Down
2 changes: 1 addition & 1 deletion R/npn_stations.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ npn_stations_by_state <- function(...) {
#' @export
#' @template curl
#' @param wkt Required field specifying the WKT geography to use.
#' @return A data frame listing stations filterd based on the WKT geography.
#' @return A data frame listing stations filtered based on the WKT geography.
#' @examples \dontrun{
#' head( npn_stations_by_state(wkt="POLYGON((
#' -110.94484396954107 32.23623109416672,-110.96166678448247 32.23594069208043,
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ knitr::include_graphics("vignettes/figures/7-plot.png")

Please read and review the vignettes for this package to get further information about the full scope of functionality available.

## Acknowledgements
## Acknowledgments

This code was developed, in part, as part of the integrated [Pheno-Synthesis Software Suite (PS3)](https://git.earthdata.nasa.gov/projects/APIS/repos/pheno-synthesis-software-suite/browse). The authors acknowledge funding for this work through NASA's AIST program (80NSSC17K0582, 80NSSC17K0435, 80NSSC17K0538, and 80GSFC18T0003). The University of Arizona and the USA National Phenology Network's efforts with this package are supported in part by US Geological Survey (G14AC00405, G18AC00135) and the US Fish and Wildlife Service (F16AC01075 and F19AC00168).

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ For more details see Vignette VII
Please read and review the vignettes for this package to get further
information about the full scope of functionality available.

## Acknowledgements
## Acknowledgments

This code was developed, in part, as part of the integrated
[Pheno-Synthesis Software Suite
Expand Down
2 changes: 1 addition & 1 deletion man/npn_stations_by_location.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f76e5af

Please sign in to comment.