Re: [gdal-dev] using gdal_viewshed

2019-11-17 Thread Tamas Szekeres
The fix has now been committed to GDAL/master

Tamas

Tamas Szekeres  ezt írta (időpont: 2019. nov. 12., K,
22:37):

> 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.
> I'll prepare a fix in gdal in the next few days and let us see if that
> fixes this issue as well.
>
> Best regards,
>
> Tamas
>
>
> Eli Adam  ezt írta (időpont: 2019. nov. 12., K,
> 22:26):
>
>> Hi Ben,
>>
>> On Sun, Nov 10, 2019 at 3:57 AM Ben Avrahami 
>> wrote:
>> >
>> > 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.
>> >
>> > The input I've been using is:
>> >
>> > gdal_viewshed -md 1000 -ox "691868.511" -oy "3492031.487" > tiff> 
>>
>> It might be helpful to copy and paste your command so if there are
>> typos or otherwise, they can be spotted.
>>
>> A gdalinfo report on your input file could also be helpful.  That
>> would show coordinates of the image and allow looking at things like
>> are those coordinates within the image?  Is it in the coordinate
>> system of the image?  A gdalinfo report details that nicely.
>>
>> >
>> > And I get the response:
>> >
>> > ERROR 5: C:\temp\files\out.tif, band 1: Access window out of range
>> in RasterIO().  Requested
>> > (0,-1) of size 67x1 on raster of 67x67.
>> > ERROR 1: RasterIO error when writing target raster
>>
>> This makes it seem like something isn't lining up correctly.  With the
>> absence of information some random guess include: that the coordinate
>> is not within the image, or perhaps the coordinate is less than -md
>> 1000 units from the edge (although testing that on other data here
>> worked fine), that there are pixel alignment/resolution issues and
>> using coordinates not to three decimal places would work better.
>>
>> I see that gdal_viewshed -md 900 -ox 985710 -oy 658590
>> http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc
>> output2.tif works
>>
>> and
>>
>> gdal_viewshed -md 800 -ox 985710 -oy 658590
>> http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc
>> output3.tif fails with the error:
>>
>> 0ERROR 5: output3.tif, band 1: Access window out of range in
>> RasterIO().  Requested
>> (0,-1) of size 19x1 on raster of 19x19.
>> ERROR 1: RasterIO error when writing target raster
>>
>> it seems that -md must be a multiple of the resolution.
>>
>> Best regards, Eli
>>
>> >
>> > 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.
>> >
>> > regards, Ben
>> > ___
>> > gdal-dev mailing list
>> > gdal-dev@lists.osgeo.org
>> > https://lists.osgeo.org/mailman/listinfo/gdal-dev
>> ___
>> gdal-dev mailing list
>> gdal-dev@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] using gdal_viewshed

2019-11-12 Thread Tamas Szekeres
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.
I'll prepare a fix in gdal in the next few days and let us see if that
fixes this issue as well.

Best regards,

Tamas


Eli Adam  ezt írta (időpont: 2019. nov. 12., K,
22:26):

> Hi Ben,
>
> On Sun, Nov 10, 2019 at 3:57 AM Ben Avrahami 
> wrote:
> >
> > 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.
> >
> > The input I've been using is:
> >
> > gdal_viewshed -md 1000 -ox "691868.511" -oy "3492031.487"  tiff> 
>
> It might be helpful to copy and paste your command so if there are
> typos or otherwise, they can be spotted.
>
> A gdalinfo report on your input file could also be helpful.  That
> would show coordinates of the image and allow looking at things like
> are those coordinates within the image?  Is it in the coordinate
> system of the image?  A gdalinfo report details that nicely.
>
> >
> > And I get the response:
> >
> > ERROR 5: C:\temp\files\out.tif, band 1: Access window out of range
> in RasterIO().  Requested
> > (0,-1) of size 67x1 on raster of 67x67.
> > ERROR 1: RasterIO error when writing target raster
>
> This makes it seem like something isn't lining up correctly.  With the
> absence of information some random guess include: that the coordinate
> is not within the image, or perhaps the coordinate is less than -md
> 1000 units from the edge (although testing that on other data here
> worked fine), that there are pixel alignment/resolution issues and
> using coordinates not to three decimal places would work better.
>
> I see that gdal_viewshed -md 900 -ox 985710 -oy 658590
> http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc
> output2.tif works
>
> and
>
> gdal_viewshed -md 800 -ox 985710 -oy 658590
> http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc
> output3.tif fails with the error:
>
> 0ERROR 5: output3.tif, band 1: Access window out of range in
> RasterIO().  Requested
> (0,-1) of size 19x1 on raster of 19x19.
> ERROR 1: RasterIO error when writing target raster
>
> it seems that -md must be a multiple of the resolution.
>
> Best regards, Eli
>
> >
> > 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.
> >
> > regards, Ben
> > ___
> > gdal-dev mailing list
> > gdal-dev@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/gdal-dev
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] using gdal_viewshed

2019-11-12 Thread Eli Adam
Hi Ben,

On Sun, Nov 10, 2019 at 3:57 AM Ben Avrahami  wrote:
>
> 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.
>
> The input I've been using is:
>
> gdal_viewshed -md 1000 -ox "691868.511" -oy "3492031.487"  
> 

It might be helpful to copy and paste your command so if there are
typos or otherwise, they can be spotted.

A gdalinfo report on your input file could also be helpful.  That
would show coordinates of the image and allow looking at things like
are those coordinates within the image?  Is it in the coordinate
system of the image?  A gdalinfo report details that nicely.

>
> And I get the response:
>
> ERROR 5: C:\temp\files\out.tif, band 1: Access window out of range in 
> RasterIO().  Requested
> (0,-1) of size 67x1 on raster of 67x67.
> ERROR 1: RasterIO error when writing target raster

This makes it seem like something isn't lining up correctly.  With the
absence of information some random guess include: that the coordinate
is not within the image, or perhaps the coordinate is less than -md
1000 units from the edge (although testing that on other data here
worked fine), that there are pixel alignment/resolution issues and
using coordinates not to three decimal places would work better.

I see that gdal_viewshed -md 900 -ox 985710 -oy 658590
http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc
output2.tif works

and

gdal_viewshed -md 800 -ox 985710 -oy 658590
http://download.osgeo.org/gdal/data/aaigrid/095b_dem_90m.asc
output3.tif fails with the error:

0ERROR 5: output3.tif, band 1: Access window out of range in
RasterIO().  Requested
(0,-1) of size 19x1 on raster of 19x19.
ERROR 1: RasterIO error when writing target raster

it seems that -md must be a multiple of the resolution.

Best regards, Eli

>
> 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.
>
> regards, Ben
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] using gdal_viewshed

2019-11-10 Thread Ben Avrahami
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.

The input I've been using is:

gdal_viewshed -md 1000 -ox "691868.511" -oy "3492031.487" 


And I get the response:

ERROR 5: C:\temp\files\out.tif, band 1: Access window out of range in
RasterIO().  Requested
(0,-1) of size 67x1 on raster of 67x67.
ERROR 1: RasterIO error when writing target raster

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.

regards, Ben
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev