Skip to content
Prev 26483 / 29559 Next

Issues with a GDB file in R?

On Thu, 3 May 2018, Aguirre Perez, Roman wrote:

            
On the contrary. The geoTiffs are coded as described in the documentation. 
Your output is simply the count of raster cells by NUTS3 for each of the 
categories. The geoTiff is in ETRS_1989_LAEA, so is projected; it includes 
a lot of sea and no data because of the French overseas territories.

You could possibly use PostGIS to do the intersections, or use GRASS for 
raster-vector counts (say through rgrass7). In R, you would want to add a 
NUTS3 ID band to the land cover raster, then aggregate by NUTS3 ID.

I would suggest using GRASS as the most obvious route, reading the raster, 
reading the NUTS3 boundaries into a separate location, projecting to LAEA, 
then rasterising the NUTS3 regions (v.to.rast) and running r.cross. You 
get 32K output categories, the 48 corine categories times the count of 
NUTS3 regions minus the nulls (there aren't many glaciers in most 
regions). You'll then need to match back the Corine codes and the NUTS3 
codes - see in the category label file shown by r.category.

I'll try to provide code tomorrow.

Roger