AIFDR / riab

Risk in a Box - main project
Other
17 stars 6 forks source link

Crash when bounding box is too small for specified resolution #101

Closed uniomni closed 12 years ago

uniomni commented 13 years ago

In cases where one dataset has a very small bounding box, we get the error below. This will probabably have to be revisited when we start controlling the raster resolution, but for now have the Risiko have a minimum bounding box size.

Traceback: File "/home/nielso/dev/riab_env/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, _callback_args, *_callback_kwargs) File "/home/nielso/dev/riab_env/lib/python2.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
  2. resp = view_func(_args, *_kwargs) File "/home/nielso/dev/riab_env/lib/python2.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
  3. return view_func(_args, *_kwargs) File "/home/nielso/dev/riab/impact/views.py" in calculate
  4. H = download(hazard_server, hazard_layer, bbox) File "/home/nielso/dev/riab/impact/storage/io.py" in download
  5. filename = get_file(download_url, suffix) File "/home/nielso/dev/riab/impact/storage/io.py" in get_file
  6. raise Exception(msg)

Exception Type: Exception at /api/v1/calculate/ Exception Value: File download failed. URL: http://localhost:8001/geoserver-geonode-dev/ows?version=1.0.0&service=wcs&request=getcoverage&format=GeoTIFF&store=false&coverage=geonode:earthquake_ground_shaking&crs=EPSG:4326&bbox=106.818998,-6.185852,106.822645,-6.181054&resx=0.008333333333000&resy=0.008333333333000 Error message: <?xml version="1.0" encoding="UTF-8"?> java.lang.IllegalArgumentException: The specified dimensional parameter is non-positive. The specified dimensional parameter is non-positive.

uniomni commented 13 years ago

Fixed by commits https://github.com/AIFDR/riab/commit/9c01faf7bc323dc3ae5629089f64fdf8dc2bdeaa https://github.com/AIFDR/riab/commit/cd9f33a1a25aae13344ff1fc3d5f8cd184dbb939

uniomni commented 13 years ago

Tried it again today 18th October, with the minimal bbox removed which should be OK now that raster resolution is variable. However, still got this error message. Why?

File download failed. URL: http://localhost:8001/geoserver-geonode-dev/ows?version=1.0.0&service=wcs&request=getcoverage&format=GeoTIFF&store=false&coverage=geonode:mentawai_90_shakemap&crs=EPSG:4326&bbox=100.388067,-0.929714,100.395738,-0.922785&resx=0.016233332&resy=0.016233332 Error message: java.lang.IllegalArgumentException: The specified dimensional parameter is non-positive. The specified dimensional parameter is non-positive.

uniomni commented 13 years ago

Tried a few other combination directly in the browser with the following results:


http://localhost:8001/geoserver-geonode-dev/ows?version=1.0.0&service=wcs&request=getcoverage&format=GeoTIFF&store=false&coverage=geonode:mentawai_90_shakemap&crs=EPSG:4326&bbox=100.388067,-0.929714,100.395738,-0.922785&resx=0.016233332&resy=0.016233332

java.lang.IllegalArgumentException: The specified dimensional parameter is non-positive. The specified dimensional parameter is non-positive.


localhost:8001/geoserver-geonode-dev/ows?version=1.0.0&service=wcs&request=getcoverage&format=GeoTIFF&store=false&coverage=geonode:mentawai_90_shakemap&crs=EPSG:4326&bbox=100.388067,0.922785,100.395738,0.929714&resx=0.016233332&resy=0.016233332

java.lang.NullPointerException


localhost:8001/geoserver-geonode-dev/ows?version=1.0.0&service=wcs&request=getcoverage&format=GeoTIFF&store=false&coverage=geonode:mentawai_90_shakemap&crs=EPSG:4326&bbox=100.388067,0.922785,100.395738,0.929714&resx=0.0001&resy=0.0001

java.lang.NullPointerException

uniomni commented 13 years ago

It appears to be related to resolution as the error goes away when resolution is reduced (which kind of makes sense)

http://localhost:8001/geoserver-geonode-dev/ows?version=1.0.0&service=wcs&request=getcoverage&format=GeoTIFF&store=false&coverage=geonode:mentawai_90_shakemap&crs=EPSG:4326&bbox=100.388067,-0.929714,100.395738,-0.922785&resx=0.001&resy=0.001

uniomni commented 12 years ago

Road tested this - we can now zoom in as hard as we like and Risiko responds sensibly with the ability to interpolate at the finest zoom level and a nice error message if there is no data points in the view port.