Duncan Temple Lang wrote:
>
>> not really: the xpath pattern '//coordinates' does say 'find all
>> coordinates nodes searching from the root', but the root here is not the
>> original root of the whole document, but each polygon node in turn.
>> try:
>>
>> root = xmlInternalTreeParse('
>>
Wacek Kusnierczyk wrote:
Duncan Temple Lang wrote:
Wacek Kusnierczyk wrote:
Don MacQueen wrote:
I have an XML file that has within it the coordinates of some polygons
that I would like to extract and use in R. The polygons are nested
rather deeply. For example, I found by trial and error th
Duncan Temple Lang wrote:
>
>
> Wacek Kusnierczyk wrote:
>> Don MacQueen wrote:
>>> I have an XML file that has within it the coordinates of some polygons
>>> that I would like to extract and use in R. The polygons are nested
>>> rather deeply. For example, I found by trial and error that I can
>>>
Wacek Kusnierczyk wrote:
Don MacQueen wrote:
I have an XML file that has within it the coordinates of some polygons
that I would like to extract and use in R. The polygons are nested
rather deeply. For example, I found by trial and error that I can
extract the coordinates of one of them using
Romain Francois wrote:
Hi,
You also might want to check R4X:
# install.packages("R4X", repos="http://R-Forge.R-project.org";)
require( "R4X" )
x <- xml("http://code.google.com/apis/kml/documentation/KML_Samples.kml";)
coords <- x["Polygon///coordinates/#" ]
data <- sapply( strsplit( coords,
Hi,
You also might want to check R4X:
# install.packages("R4X", repos="http://R-Forge.R-project.org";)
require( "R4X" )
x <- xml("http://code.google.com/apis/kml/documentation/KML_Samples.kml";)
coords <- x["Polygon///coordinates/#" ]
data <- sapply( strsplit( coords, "(,|\\s+)" ), as.numeri
Don MacQueen wrote:
> I have an XML file that has within it the coordinates of some polygons
> that I would like to extract and use in R. The polygons are nested
> rather deeply. For example, I found by trial and error that I can
> extract the coordinates of one of them using functions from the XML
A bit over a year ago I got useful advice from Gabor Grothendieck and
Duncan Temple Lang in this thread:
http://finzi.psych.upenn.edu/R/Rhelp02/archive/117140.html
If the coordinates are nested deeply, then it probably safer to search
for a specific tag or tags that are just above them . You
8 matches
Mail list logo