[R-sig-Geo] Reading a Shapefile from a website with readOGR?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Oct 9 23:23:15 CEST 2012


On Tue, Oct 9, 2012 at 9:49 PM, Michael Sumner <mdsumner at gmail.com> wrote:
> This can work with a combination of vsizip (or other) and vsicurl, but the
> multiple files will have to be in an archive (zip or other).
>
> http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip
>
> See examples near the bottom of the page for OGR. Keep the zip file name
> the same as the shapefile/layer name and don't have subdirectories for the
> simplest case.
>
> I am pretty sure this cannot work otherwise for a multifile format.

 Neat, but I suspect in practice the underlying code is just
downloading the zip and extracting to a temp file, which is about four
lines of R code. If the shapefile components aren't zipped up, its
just as easy.

 I'd write a wrapper to do that.

Barry



More information about the R-sig-Geo mailing list