<div dir="ltr">The fix has now been committed to GDAL/master<div><br></div><div>Tamas</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Tamas Szekeres <<a href="mailto:szekerest@gmail.com">szekerest@gmail.com</a>> ezt írta (időpont: 2019. nov. 12., K, 22:37):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I've recently fixed the implementation in my local version causing a similar issue (RasterIO error when writing target raster), where the given maxdistance setting would produce an empty row at the top or the bottom of the result image.</div><div>I'll prepare a fix in gdal in the next few days and let us see if that fixes this issue as well.</div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Eli Adam <<a href="mailto:eadam@co.lincoln.or.us" target="_blank">eadam@co.lincoln.or.us</a>> ezt írta (időpont: 2019. nov. 12., K, 22:26):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ben,<br>
<br>
On Sun, Nov 10, 2019 at 3:57 AM Ben Avrahami <<a href="mailto:avrahami.ben@gmail.com" target="_blank">avrahami.ben@gmail.com</a>> wrote:<br>
><br>
> Hello all, I've been trying trying to use the newest gdal_viewshed in gdal-dev release, and I've run into an error I can't quite understand.<br>
><br>
> The input I've been using is:<br>
><br>
>     gdal_viewshed -md 1000 -ox "691868.511" -oy "3492031.487" <input tiff> <output tiff><br>
<br>
It might be helpful to copy and paste your command so if there are<br>
typos or otherwise, they can be spotted.<br>
<br>
A gdalinfo report on your input file could also be helpful.  That<br>
would show coordinates of the image and allow looking at things like<br>
are those coordinates within the image?  Is it in the coordinate<br>
system of the image?  A gdalinfo report details that nicely.<br>
<br>
><br>
> And I get the response:<br>
><br>
>     ERROR 5: C:\temp\files\out.tif, band 1: Access window out of range in RasterIO().  Requested<br>
>     (0,-1) of size 67x1 on raster of 67x67.<br>
>     ERROR 1: RasterIO error when writing target raster<br>
<br>
This makes it seem like something isn't lining up correctly.  With the<br>
absence of information some random guess include: that the coordinate<br>
is not within the image, or perhaps the coordinate is less than -md<br>
1000 units from the edge (although testing that on other data here<br>
worked fine), that there are pixel alignment/resolution issues and<br>
using coordinates not to three decimal places would work better.<br>
<br>
I see that gdal_viewshed -md 900 -ox 985710 -oy 658590<br>
<a href="http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc" rel="noreferrer" target="_blank">http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc</a><br>
output2.tif works<br>
<br>
and<br>
<br>
gdal_viewshed -md 800 -ox 985710 -oy 658590<br>
<a href="http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc" rel="noreferrer" target="_blank">http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc</a><br>
output3.tif fails with the error:<br>
<br>
0ERROR 5: output3.tif, band 1: Access window out of range in<br>
RasterIO().  Requested<br>
(0,-1) of size 19x1 on raster of 19x19.<br>
ERROR 1: RasterIO error when writing target raster<br>
<br>
it seems that -md must be a multiple of the resolution.<br>
<br>
Best regards, Eli<br>
<br>
><br>
> I get a similar error if I try to use the GDALViewshedGenerate C-API function. The input us a valid WGS84-UTM tiff file, and the output is a valid path, but the file does not actually exist until I run the command. After I run the command, the output file is created but only filled halfway. Any help at wall would be appreciated.<br>
><br>
> regards, Ben<br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div></div>
</blockquote></div>