我正在尝试将以下网址(http://sdi.fish.govt.nz/sdi/mapserver.wfs?SERVICE=WFS&REQUEST=GetFeature&TYPENAME=Annual%20distribution%20of%20Albacore%20tuna&VERSION=1.1.0)读入R(3.2.2)。从网站上看,它看起来是gml或graphml格式。我想将它转换为可用的shapefile,但我在导入阶段陷入困境。
library(RCurl)
library(igraph)
test_url <- 'http://sdi.fish.govt.nz/sdi/mapserver.wfs?SERVICE=WFS&REQUEST=GetFeature&TYPENAME=Annual%20distribution%20of%20Albacore%20tuna&VERSION=1.1.0'
getURL(test_url)
# example of some of the substantial amount of output
# [1] "<?xml version=\"1.0\"?><wfs:FeatureCollection xmlns:gml=\"http://www.opengis.net/gml\" xmlns:fish=\"http://www.fish.govt.nz/fish\" xmlns:gmlsf=\"http://www.opengis.net/gmlsf\"
read_graph(testURl, format='graphml')
# Error in .Call("R_igraph_read_graph_graphml", file, as.numeric(index), :
# At foreign-graphml.c:1350 : Graph index was too large, Invalid value
是否有一种方法可以将图形索引转换为大型或替代方法来读取数据?
答案 0 :(得分:2)
网址既不是GraphML也不是GML格式。它有一个名为gml
的命名空间,但它引用Geography Markup Language,而不是Graph Markup Language(GraphML)或Graph Modelling Language(也是GML)。