You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found some incorrect behavior when using distance() with a SpatRaster and a SpatVector. In particular, when finding a raster representing the distance from lines or polygons, the distance is only calculated from the vertices (plots 1 and 3, below). In the case of polygons, the entire area covered by the polygon is correctly represented as having distance 0, but the distance for areas outside the polygons uses the vertices only (plot 1). When rasterize = TRUE, the distance is calculated as I would expect - the distance from the entire line or polygon, not just the vertices (plots 2 and 4).
I see the following sentence in the documentation for distance: "For lines and polygons this is done after rasterization; and only the overlapping areas of the vector and raster are considered (for now)." Based on this, I'm assuming that rasterization is supposed to always happen for lines and polygons, but this isn't the case right now.
I've found some incorrect behavior when using
distance()
with aSpatRaster
and aSpatVector
. In particular, when finding a raster representing the distance from lines or polygons, the distance is only calculated from the vertices (plots 1 and 3, below). In the case of polygons, the entire area covered by the polygon is correctly represented as having distance 0, but the distance for areas outside the polygons uses the vertices only (plot 1). Whenrasterize = TRUE
, the distance is calculated as I would expect - the distance from the entire line or polygon, not just the vertices (plots 2 and 4).I see the following sentence in the documentation for
distance
: "For lines and polygons this is done after rasterization; and only the overlapping areas of the vector and raster are considered (for now)." Based on this, I'm assuming that rasterization is supposed to always happen for lines and polygons, but this isn't the case right now.Created on 2024-03-19 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: