gem / oq-platform

DEPRECATED. Please refer to https://github.com/gem/oq-platform2
8 stars 3 forks source link

Exposure export does not work in specific cases #518

Closed daniviga closed 8 years ago

daniviga commented 8 years ago

Using the Exposure export to download data from Greece and Portugal and maybe more gives an error.

How to reproduce:

You'll get a new web page wit this error:

The export can not be performed because the total grid count for study region id xyz exceeds the threshold (NNNNN > 100000)

You should get the possibility of drawing a box on the map to reduce the exported area instead (like Italy).

Thanks to @monellid for discovering the bug: https://groups.google.com/forum/#!topic/openquake-users/a4rlxtAYFIs

pslh commented 8 years ago

I think we have two distinct and inconsistent checks for "area too large" in the UI and the backend:

https://github.com/gem/oq-platform/blob/1b165c6be2bc6cf42c462ad0dd4882329da69fcf/openquakeplatform/openquakeplatform/exposure/static/exposure/exposure_controller.js#L167

https://github.com/gem/oq-platform/blob/master/openquakeplatform/openquakeplatform/exposure/views.py#L86

https://github.com/gem/oq-platform/blob/master/openquakeplatform/openquakeplatform/exposure/views.py#L123

I suspect that the backend value of 100k is probably safer: users on a slow line will probably have trouble downloading the gridded data for 300k cells. Reassigning to Ben.

ptormene commented 8 years ago

Thank you Paul. That's what I was suspecting. Perhaps we should define the threshold only once, in a shared file, to avoid this kind of inconsistency.

daniviga commented 8 years ago

Personally I would like to have a setting in the local_settings.py. It shouldn't be a big deal.

pslh commented 8 years ago

I agree, we should have a single value and it should be configurable via local settings.