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 have been trying to get pgWriteRast to work for some large raster files.
Example raster file I'm having issues with https://ufile.io/25trv
I am getting warnings / error "NOTICE: Cannot set value for pixel( x, y) outside raster bounds: X' x Y' ". I dug around a bit and it seems like Line 175 through 180 ST_SnapToGrid is changing the Raster width / height and causing mismatch once you get to Line 189 through 194 where you update pixel values. Could you fix this issue perhaps by adding band within b==1 loop but SnapToGrid after pixel value update?
The text was updated successfully, but these errors were encountered:
isoneo
changed the title
pgWriteRast S
pgWriteRast SnapToGrid causes Raster resizing and mismatch
Nov 6, 2018
Thanks for trying out rpostgis. We hadn't tested this function on irregular grid resolutions (unequal x/y spacing), as is the case with your example raster. The function ST_SnapToGrid was assuming equal x/y, which was causing the issue. I've patched it in 5b3cec0 and it appears to be working with your test raster.
If you get a chance to test and run into any other issues, that would be great to know. You can install the latest version with:
Also, since pgWriteRast is a pure-R solution, it's not very efficient for large rasters. If you have a lot of large raster to process you'll probably want to use command-line raster2pgsql.
I have been trying to get pgWriteRast to work for some large raster files.
Example raster file I'm having issues with https://ufile.io/25trv
I am getting warnings / error "NOTICE: Cannot set value for pixel( x, y) outside raster bounds: X' x Y' ". I dug around a bit and it seems like Line 175 through 180 ST_SnapToGrid is changing the Raster width / height and causing mismatch once you get to Line 189 through 194 where you update pixel values. Could you fix this issue perhaps by adding band within b==1 loop but SnapToGrid after pixel value update?
The text was updated successfully, but these errors were encountered: