Created
July 31, 2018 19:50
-
-
Save FrieseWoudloper/dd76c5877819a2fcbe4e94da7b05eef3 to your computer and use it in GitHub Desktop.
Parse WFS response in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("XML") | |
library(XML) | |
doc <- xmlParse("http://geodata.nationaalgeoregister.nl/cbsgebiedsindelingen/wfs?request=GetCapabilities", isURL = TRUE) | |
output_formats <- unlist(xpathApply(doc, "//ows:Operation[@name='GetFeature']/ows:Parameter[@name='outputFormat']/ows:AllowedValues/ows:Value/text()", xmlValue)) | |
print(output_formats) | |
feature_types <- unlist(xpathApply(doc,"//wfs:FeatureType/wfs:Name/text()", xmlValue)) | |
head(feature_types) | |
# The server limit | |
max_per_request <- as.integer(unlist(xpathApply(doc,"//ows:Constraint[@name='CountDefault']/ows:DefaultValue/text()", xmlValue))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment