Hot answers tagged

4 votes
Accepted

Saving Mapzen Global Terrain in QGIS with extent layer (-90 to 90 Lat and -180 to 180 Lon)

No. Mapzen Global Terrain tiles will be designed for use in Web Mercator projection, which only goes to ±85.05.. degrees of latitude. From Wikipedia: Because the Mercator projects the poles at ...
user avatar
3 votes
Accepted

How to treat NAs using a custom function in the lapp function of {terra} in R

As @Spacedman says, a vectorized solution should work this function should give you the expected result. t <- lapp(c(r,s), fun = function(a,b){ a[is.na(a)] <- 55 ...
user avatar
2 votes

gdal_calc - How to calculate where raster A is not equal to raster B?

From GDAL version >= 3.3, you can use --hideNoDatata option to ignore the NaNs in the calculation (it takes the NoData value as if it was a real value).
user avatar
2 votes

How to treat NAs using a custom function in the lapp function of {terra} in R

This from the docs: Before you use the function, test it to make sure that it is vectorized. That is, it should work for vectors longer than one, not only for single numbers. Let's test: > fun(...
user avatar
  • 51k
2 votes

Implement plot purchases on fictional map

Here's a workflow using QGIS and some data from the Leaflet examples. Before you start, read the Leaflet tutorial about L.CRS.Simple. I mean it. Stop what you're doing, and read it. Lauch QGIS. Read ...
user avatar
  • 9,285
1 vote

Extracting mean of multiple SpatRasters using Terra?

The terra equivalent of raster::calc is terra::app so, to return the mean for a multi-band raster you would use: rmean <- app(x, mean) or to return the mean for an entire raster: global(x, mean).
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible