[R-sig-Geo] Memory limits in R with shapefiles

Michael Sumner mdsumner at gmail.com
Mon Apr 22 22:59:35 CEST 2013


gdalwarp is not for shapefiles

Dominic: at the command line with GDAL installed you can use *ogr2ogr*
to subset and otherwise manipulate shapefiles and that may be your
best route.  http://www.gdal.org/ogr_utilities.html

But, what is the size of the component files? Sometimes it's the .shp
that is huge, other times the .dbf and not necessarily both of them
due to the relative storage required for geometry vs. attributes.

That might give you more options, since you can read (and write) .dbf
files for shapefiles with the foreign package. You can also hand-craft
a VRT file that defines a subset of the geometry and/or attributes,
though that can be tricky to get right.
http://www.gdal.org/ogr/drv_vrt.html

Cheers, Mike.

On Mon, Apr 22, 2013 at 11:00 PM, Thiago V. dos Santos
<thi_veloso at yahoo.com.br> wrote:
> What kind of operation do you need to perform in the shapefiles?
>
> Depending on it, one solution could be calling gdal commands from within R, by using system(). For example:
>
> system('gdalwarp argument1 argument2 argument3 argument4')
>
> Greetings,
> --
> Thiago V. dos Santos
> PhD student
> Land and Atmospheric Science
> University of Minnesota
> http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm
> Phone: (612) 323 9898
>
>
> ----- Original Message -----
> From: Dominic Roye <dominic.roye at gmail.com>
> To: r-sig-geo at r-project.org
> Cc:
> Sent: Monday, April 22, 2013 6:41 AM
> Subject: [R-sig-Geo] Memory limits in R with shapefiles
>
> Hello everyone,
>
> I have a problem with reading a shape of 300 MB in R. My RAM limits are 8
> GB. So, i can´t work with this shape, because it needs more than 8GB. Have
> anybody an idea how to handle this kind of cases?
>
> Best regards,
>
> Dominic
>
>     [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



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



More information about the R-sig-Geo mailing list