On 18/09/18 16:27, Nick Griffiths wrote: > Hi again list, > > I've noticed that a medium sized raster (.asc) produces inconsistent > results when sampling pixels. It looks like I am getting the pixel to > the left of the one I should be getting, but this behaviour is > consistently inconsistent (in that it always occurs with the same set of > points being sampled, but I can't discern a pattern) and it goes away if > I reopen the grid coverage between samples (which is awfully slow, but > produces correct results) > > I've got it down to a very small reduced test case that reflects the > image field from the GridCoverage2D and them pulls two pixels out from > different tiles. If I reopen the gridcoverage between the samples, it > gets the right values. If I don't, it doesn't. > > I've converted the source data to tiff using gdal_translate and I get > the same results, which tells me it's probably not the file format.
Seems like my gdal_translate didn't work as expected - after correctly transforming the raster to a tiff, I now find the issue only occurs with the original asc file and not the tiff. So perhaps this is an issue with the AsciiGridsImageReader? I dug some more and found the issue only occurs when the pixels being sampled are not in an adjacent tile (note that my raster ends up being carved up in to a 1x(1091/32) grid). So odd, but reassuring that the issue isn't likely to be in PlanarImage and in code that we/I can probably fix. _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users