-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistencies in pixel allignment after writing, aggregating and plotting heatmaps #602
Comments
I haven't gone in too much detail about the implementation of Rasters.jl, but I don't quite follow why there's an offset for |
Aggregate can't always have the same extent, unless you have perfect integer division. If you want to keep the size, use resample. But resample has other problems, usually you should prefer aggregate when you can. |
But yeah in this case seems it should work... If you have a MWE I can fix it (Maybe you have Points? The logic may not work so well for points. An MWE will clarify this) |
Thanks! This should recreate the behaviour I'm seeing:
|
Ok, what you have are Points, the default. To specify corner intervals, use this: using Rasters.Lookups
src = Raster(rand(100,100); dims=(X(0:99; sampling=Intervals(Start()))),Y(0:99; sampling=Intervals(Start())))) #considering (0,0) as the corner
dst = aggregate(sum, src, 10) And the bounds are Netcdf and GDAL have different standards here so there is no obvious default, and for now Points is it. But maybe points should become intervals after aggregation? I'm not sure. |
Notice how the REPL printing shows if you have points or intervals, and if intervaals have start/center/end locus. ╭───────────────────────────╮
│ 100×100 Raster{Float64,2} │
├───────────────────────────┴────────────────────────────────────────────────────────────────── dims ┐
↓ X Sampled{Int64} 0:99 ForwardOrdered Regular Intervals{Start},
→ Y Sampled{Int64} 0:99 ForwardOrdered Regular Intervals{Start}
├──────────────────────────────────────────────────────────────────────────────────────────── raster ┤
|
Thanks for the clarification! |
Somewhere in this pipeline there are some errors - likely with points/intervals issues and having to shift loci to the center for netcdf.
The text was updated successfully, but these errors were encountered: