7

I am trying to extract raster values using polygon layer with different CRS. Raster is in WGS84 (EPSG:4326) and the polygons in UTM (EPSG:23031).

1. If I want to work in the projection of the polygons, do the cells of the raster need to be resampled?

  • I.e. is converting to different pixel grid, and thus information loss, necessary? Or can the GIS just reproject the edges of the raster cells and handle it without resampling?

2. Is there any general/prefered practice that the polygons are converted to the projection of the raster?

  • E.g. to avoid raster resampling - if answer to question 1 is yes.

In other words, can we work in polygons' CRS without the need for raster resampling?

PS: my use case - I am using raster library in R to do the job. R decides to automatically transform polygons:

> a <- extract(raster, polygons, weights = TRUE)
Warning message:
In .local(x, y, ...) :
  Transforming SpatialPolygons to the CRS of the Raster

However, this means that the already projected polygons (which were actually created as a buffer in UTM projected plane) need to be converted back to WGS84 implicit latlong "projection"... I would prefer to work in the plane defined by UTM, because the projection is much less distorted for my purposes, e.g. weighting by areas would work with minimal distortion etc...

1
  • 2
    As concerns the displayed warning message, you could circumvent that by reprojecting your raster data via projectRaster(raster, crs = projection(polygons)) to the CRS of your polygons before executing extract. However, I'd also appreciate appropriate answers regarding the above questions of yours.
    – fdetsch
    Commented Jul 23, 2013 at 12:43

1 Answer 1

1

The answer to your first question is yes, changing the projection from EPSG:4326 to EPSG:23031 will resample your values. It's easy to imagine knowing that 4326 creates pixels with different size and shape depending of the location of the territory your working with.

Personally, I always convert my polygons and not my raster for two reasons: 1) is because I want to avoid resampling and 2) because it's generally computationally more efficient, as converting vectorial data is easier that raster data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.