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

Michael Sumner mdsumner at gmail.com
Tue Oct 9 23:37:37 CEST 2012


Heh, good point!  There are so many options some times . . .

On Wed, Oct 10, 2012 at 8:23 AM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> 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



-- 
Michael Sumner
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list