[R-sig-Geo] rasterTopolygons: singleparts often needed

Agustin Lobo alobolistas at gmail.com
Sun Feb 26 20:39:32 CET 2017


Yes, this is correct. I refer to integrating disaggregate as an option, as
I think that this is what the user needs in most cases.
Agus

On Sun, Feb 26, 2017 at 1:14 PM, John Baumgartner <johnbaums at gmail.com> wrote:
> Not at my computer, but does sp::disaggregate(v) return your singlepart
> polygons?
>
> On Sun, 26 Feb 2017 at 22:40, Agustin Lobo <alobolistas at gmail.com> wrote:
>
>> Could raster::rasterTopolygons() be modified in future versions
>>
>> to optionally output singlepart polygons? e.g, in the following
>>
>> r <-raster(nrow=16, ncol=16)
>>
>> d <- rep(rep(1:4,rep(4,4)),8)
>>
>> r[] <- c(d,rev(d))
>>
>> plot(r)
>>
>> v <- rasterToPolygons(r,dissolve=TRUE)
>>
>> plot(v[1,])
>>
>> dim(v at data)
>>
>>
>>
>> the new option
>>
>> v <- rasterToPolygons(r,dissolve=TRUE,single=TRUE)
>>
>> would result on
>>
>> plot(v[1,])
>>
>> displaying one single square and
>>
>> dim(v at data)
>>
>> would be 8 rows and 1 column
>>
>>
>>
>> (equivalent to gdal_polygonize)
>>
>>
>>
>> Agus
>>
>>
>>
>> _______________________________________________
>>
>> R-sig-Geo mailing list
>>
>> R-sig-Geo at r-project.org
>>
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>
>         [[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



More information about the R-sig-Geo mailing list