[R-sig-Geo] importing a shapefile stored on a server

Stéphane Dray dray at biomserv.univ-lyon1.fr
Thu Mar 29 13:23:33 CEST 2007


Dear all,
I am just preparing a course on spatial analysis with R; The course is a 
rnw file. In the file, I want to import a shapefile within R. The 
shapefile is here : http://pbil.univ-lyon1.fr/R/donnees/francedep/

I have try :

> library(maptools)

Le chargement a nécessité le package : foreign

Le chargement a nécessité le package : sp

> library(shapefiles)

Attachement du package : 'shapefiles'

        The following object(s) are masked from package:foreign :

         read.dbf

        The following object(s) are masked from package:foreign :

         write.dbf

> read.shapefile("http://pbil.univ-lyon1.fr/R/donnees/francedep/dep_france_dom")Erreur dans get("read.dbf", "package:foreign")(dbf.name) :

        impossible d'ouvrir le fichier DBF

> read.shape("http://pbil.univ-lyon1.fr/R/donnees/francedep/dep_france_dom.shp")Erreur dans getinfo.shape(filen) : No such file

> readShapePoly("http://pbil.univ-lyon1.fr/R/donnees/francedep/dep_france_dom")

Erreur dans getinfo.shape(filen) : No such file


Is there a way to read directly this file ? One solution would be to use 
download.file and then read the shapefile but I wonder if it would be 
possible to read directly the data from the url.

Cheers.

-- 
Stéphane DRAY (dray at biomserv.univ-lyon1.fr )
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
Tel: 33 4 72 43 27 57       Fax: 33 4 72 43 13 88
http://biomserv.univ-lyon1.fr/~dray/




More information about the R-sig-Geo mailing list