Quantcast

Dissolve polygon

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Dissolve polygon

Céline Bellard
Hi,

I am working with  a SpatialPolygonsDataFrame of many islands. There are a
lot of polygons (islands) composing my SpatialPolygonsDataFrame.
I want to extract the elevation of each island.
I need to separate the different polygons (like dissolve function in
arcgis), to have the elevation of each island.

Do you have an idea how can I do that ?

dim(hot)
[1] 10945     5

class(hot)
[1] "SpatialLinesDataFrame"
attr(,"package")
[1] "sp"

Thanks in advance for your help,

Céline

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Dissolve polygon

Barry Rowlingson
On Fri, Jul 20, 2012 at 8:40 PM, Céline Bellard
<[hidden email]> wrote:

> Hi,
>
> I am working with  a SpatialPolygonsDataFrame of many islands. There are a
> lot of polygons (islands) composing my SpatialPolygonsDataFrame.
> I want to extract the elevation of each island.
> I need to separate the different polygons (like dissolve function in
> arcgis), to have the elevation of each island.
>
> Do you have an idea how can I do that ?
>
> dim(hot)
> [1] 10945     5
>
> class(hot)
> [1] "SpatialLinesDataFrame"
> attr(,"package")
> [1] "sp"

 Looks like you have 10945 features in your shapefile...

 The extract function in the raster package will process pixels under
polygons. In this example, I sum a pollution raster over each lake
("Lake Exposure", about half-way down)

http://www.maths.lancs.ac.uk/~rowlings/Teaching/UseR2012/plume.html

 You probably want something like the mean or the max of the pixels
over each island. In your case, you should end up with 10945 values.

Barry

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Loading...