[R-sig-Geo] Area calculation workflow

Mark Payne markpayneatwork at gmail.com
Tue Jul 16 14:28:18 CEST 2013


Hi,

I have a SpatialGridDataFrame with sea-surface temperatures based on
lon/lat coordinates that I want to use to calculate the area (in
square km) contained within an isotherm. I'm still a little unsure in
this type of thing, so just wanted to check that the workflow is
correct.

I can get the isotherm out ok, using as.image.SpatialGridDataFrame(),
contourLines() and then back to sp with ContourLines2SLDF. This gives
me a set of SpatialLines in lat-lon space. But now I get a bit stuck.

I guessing that are three steps
1. Close the lines to make polygons (but how?)
2. Convert to UTM e.g. using spTransform() from rgdal package
3. Extract the area of each individual polygon from the polygons slot

Is this is the quickest and easiest approach? Or have I overlooked
something? And how do I conver the lines to polygons?

Best wishes,

Mark



More information about the R-sig-Geo mailing list