[R-sig-Geo] Help with GeoRSS

Michael Denslow michael.denslow at gmail.com
Mon May 9 02:57:51 CEST 2011


On Sun, May 8, 2011 at 6:45 PM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> On Sun, May 8, 2011 at 11:41 PM, Barry Rowlingson
> <b.rowlingson at lancaster.ac.uk> wrote:
>
>> My rgdal doesnt have geoRSS, but my command line ogrinfo says there's
>> one layer in the file, called 'georss', and if I get that layer info
>> it seems to work (note I've downloaded the XML file to my working
>> directory - maybe this fails as a URL...):
>
>  Just tried it with the URL and got similar errors to you. OGR can't
> read geoRSS from a URL:
>
> http://www.gdal.org/ogr/drv_georss.html
>
> so it tries geoJSON:
>
> http://www.gdal.org/ogr/drv_geojson.html
>
>  which can take a URL.
>
> Barry
>

Thanks Barry,
It does indeed work if I download the file a specify layer = 'georss'.

Michael

P.S. I was thinking that it might be possible to directly read the xml
file using library(XML) but it seems that it has to be saved to a file
this way as well....

library(XML)
library(rgdal)

xmlTest <- xmlTreeParse('http://earthquake.usgs.gov/earthquakes/catalogs/eqs1hour-M1.xml')

# this seems to be the part I need
xmlTest$doc$children$rss
# save the XML
saveXML(xmlTest$doc$children$rss, file='/Users/michael/Desktop/out.xml')
# get info
ogrInfo(dsn='/Users/michael/Desktop/out.xml',layer='georss')


-- 
Michael Denslow
Adjunct Instructor
Department of Geography and Planning
P.O. Box 32066
Appalachian State University
Boone, North Carolina 28608
-- AND --
Communications Manager
Southeast Regional Network of Expertise and Collections
sernec.org

36.214177, -81.681480 +/- 3103 meters



More information about the R-sig-Geo mailing list