[R-sig-Geo] rgeos::gArea() to all polygons within sp polygons DF

Agustin Lobo alobolistas at gmail.com
Mon Apr 9 17:12:40 CEST 2012


Thanks Edzer,

b2 <- gArea(BorneoLCg, byid=T)

I get many warnings such as:
40: In RGEOSMiscFunc(spgeom, byid, "rgeos_area") :
  Polygons object missing comment attribute ignoring hole(s). See
function createSPComment.

is this normal?

The result is identical to
b <- sapply(BorneoLCg at polygons, function(x) x at area)

while it is different than the one provided by QGIS (known to be wrong for very
large polygons only because of a format problem) and postgis (assumed
to be correct). Please give a look to:
http://hub.qgis.org/issues/5332

Agus


El día 8 de abril de 2012 17:26, Edzer Pebesma
<edzer.pebesma at uni-muenster.de> escribió:
> Agus, have you tried
>
> gArea(BorneoLCg, byid = TRUE)
>
> ?
>
> On 04/08/2012 04:52 PM, Agustin Lobo wrote:
>> Hi!
>>
>> How do I  apply gArea()) to all polygons within an spatial pol. DF?
>> I've tried
>> areas <- apply(BorneoLCg,gArea)
>> and
>> areas <- sapply(BorneoLCg,gArea)
>>
>> but this is not correct.
>>
>> I want to compare to
>> areas <- sapply(BorneoLCg at polygons, function(x) x at area)
>>
>> Thanks
>>
>> Agus
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
> 8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
> http://www.52north.org/geostatistics      e.pebesma at wwu.de
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list