1

I use a shapefile with CRS ("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"). I want to calculate a buffer around the points with 'extract' from raster package. How can I know the units in this layer? Is it in meters? My idea is to calculate 1X1 km , thus buffer=1000. Is that correct?

try1 <- extract(raster, 
                points,
                fun=mean, na.rm=T,
                sp = TRUE, # create spatial object
                buffer = 1000,
                method='simple',
                weights=T, 
                normalizeWeights=F)
  • @GabrielDeLuca's answer is the better way, but for a very very very rough approximation, buffer by 0.01. (your units are decimal degrees, 1 deg ~ 111km at the equator) – user2856 Feb 7 at 23:46
5

+proj=longlat is in angular units, degrees by default.

Better if you can project your dataset before, to a conformal projection (to preserve the circular buffer shape) appropriate for your work area (so that the distance deforms as little as possible).

  • Thank you! @GabrielDeLuca Can you advise how to re-project my raster and the points? witch CRS would be suitable to United States? – Alina Feb 8 at 15:28
  • @Alina, I know how to reproject in QGIS, but are you working in R? Also, from the console, with ogr2ogr for the points and gdalwarp for the raster. United States is a large area, and it's not easy to preserve shapes and distances in larges areas. Is your work area the whole country or can it be a smaller area? I'm used to projecting in transverse mercator, tangential to an internal point of the work area, but I usually work with smaller surfaces. – Gabriel De Luca Feb 8 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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