inasafe / inasafe

InaSAFE - QGIS plugin for estimating impact from natural disasters
www.inasafe.org
GNU General Public License v3.0
259 stars 135 forks source link

Earthquake polygon IF fails on points layer #2200

Closed timlinux closed 9 years ago

timlinux commented 9 years ago

Problem

Using the standard test layers, when I try to do

Hazard: Earthquake Polygons

Exposure: Building centroids

IF: ClassifiedPolygonHazardBuildingFunction

I get this error:

screen shot 2015-08-21 at 10 27 27
In file "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/utilities/analysis.py", line 971, in run_analysis self.impact_layer = calculate_impact(self.impact_function)
In file "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/engine/core.py", line 176, in calculate_impact result_layer = impact_function.run()
In file "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_functions/generic/classified_polygon_building/impact_function.py", line 118, in run self.hazard.layer, self.exposure.layer, wgs84_extent)
In file "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/engine/interpolation_qgis.py", line 60, in interpolate_polygon_polygon result = create_layer(target)
In file "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gis/qgis_vector_tools.py", line 125, in create_layer raise WrongDataTypeException(msg)

Proposed solution

We should do more rigorous checks to see the the data formats provided are acceptable, instead of blindly trusting the keywords.

timlinux commented 9 years ago

This was the scenario:

[Earthquake Polygon]
exposure = ../../Users/timlinux/.qgis2/python/plugins/inasafe/safe/test/data/exposure/building-points.shp
hazard = ../../Users/timlinux/.qgis2/python/plugins/inasafe/safe/test/data/hazard/classified_generic_polygon.shp
function = ClassifiedPolygonHazardBuildingFunction
extent = 39.237270, -6.798558, 39.240305, -6.795975
extent_crs = EPSG:4326
lucernae commented 9 years ago

Is this still valid?

I test this on Windows 10, QGIS 2.10 Pisa, and it ran happily...

timlinux commented 9 years ago

Closing - I cant replicate any more...