shawnlaffan / biodiverse

A tool for the spatial analysis of diversity
http://shawnlaffan.github.io/biodiverse/
GNU General Public License v3.0
74 stars 19 forks source link

Basedata raster imports shifted south by one pixel #845

Closed shawnlaffan closed 1 year ago

shawnlaffan commented 1 year ago

The y-coordinates for groups imported from raster files are offset by one pixel southwards. The issue is that the half pixel distance is subtracted from instead of being added when calculating the final cell coordinate.

This is a long standing bug. The main impact is where data are imported from multiple sources, e.g. raster and shapefile. Otherwise the cells will be consistently shifted so any calculations are consistently offset (think of it as a spatially global error for an internally consistent data set). Another point of impact is where shapefiles are used to define regions in spatial conditions when analysing such offset basedatas. It is unclear how common this is.

Update: This only affects north-oriented rasters, i.e. those that list the rows of the raster from the bottom up. Most do the reverse, i.e. the top row is listed first in the file.

Update 2: Nope, this affected a range of files, not just north orientated

shawnlaffan commented 1 year ago

Changes are on master. CI failure is a server timeout.