Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to use other vector formats as impact/hazard layers #3097

Closed
NyakudyaA opened this issue Aug 1, 2016 · 1 comment
Closed

Failure to use other vector formats as impact/hazard layers #3097

NyakudyaA opened this issue Aug 1, 2016 · 1 comment

Comments

@NyakudyaA
Copy link

Problem

When using a geojson vector layer as a hazard layer, it does not give an error when generating keywords but does not generate any xml with keywords. So trying to run the impact function results in error.

An error has occurred while executing Python code: 

ReadLayerError: Could not read /home/admire/Downloads/export.geojson. Extension ".geojson" has not been implemented 
Traceback (most recent call last):
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/gui/widgets/dock.py", line 1157, in accept
    self.show_next_analysis_extent()
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/gui/widgets/dock.py", line 2131, in show_next_analysis_extent
    valid, extents = self.validate_extents()
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/gui/widgets/dock.py", line 2203, in validate_extents
    impact_function = self.prepare_impact_function()
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/gui/widgets/dock.py", line 1269, in prepare_impact_function
    impact_function.hazard = self.get_hazard_layer()
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/impact_functions/bases/classified_vh_continuous_re.py", line 42, in hazard
    ImpactFunction.hazard.fset(self, value)
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/impact_functions/base.py", line 366, in hazard
    self._hazard = SafeLayer(convert_to_safe_layer(layer))
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/utilities/gis.py", line 463, in convert_to_safe_layer
    return safe_read_layer(layer.source())
  File "/home/admire/.qgis2/python/plugins/inasafe/safe/storage/core.py", line 34, in read_layer
    raise ReadLayerError(msg)
ReadLayerError: Could not read /home/admire/Downloads/export.geojson. Extension ".geojson" has not been implemented

After creating keywords the dock actually selects the layer although no keywords .xml is generated.
tza

Expected Behaviour

Support using various vector formats as hazard/exposure layers.

Environment

  • InaSAFE : 3.5
  • QGIS : Master
  • OS : 16.04
  • Data used :
    • Exposure :
    • Hazard : Wetlands from tanzania
    • Aggregation :

Proposed Solution

Implement multiple vector formats if they are not yet supported .

@Gustry
Copy link
Contributor

Gustry commented Jan 17, 2017

GeoJSON is working fine in InaSAFE V4 now, I will close this ticket.

@Gustry Gustry closed this as completed Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants