GithubHelp home page GithubHelp logo

north-road / inasafe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inasafe/inasafe

0.0 0.0 0.0 241.27 MB

InaSAFE - QGIS plugin for estimating impact from natural disasters

Home Page: www.inasafe.org

License: GNU General Public License v3.0

Makefile 0.34% Python 85.01% Shell 0.69% Batchfile 0.01% CSS 0.18% HTML 1.49% QML 9.72% JavaScript 0.01% C 2.27% XSLT 0.17% NSIS 0.14%

inasafe's People

Contributors

akbargumbira avatar alexbruy avatar assefay avatar borysiasty avatar bungcip avatar cchristelis avatar dichapabe avatar dynaryu avatar easmetz avatar gustry avatar gvallarelli avatar ingenieroariel avatar ismailsunni avatar ivanbusthomi avatar kolesovdmitry avatar lucernae avatar mach0 avatar maning avatar manombawa avatar mariasolovyeva avatar mbernasocchi avatar misugijunz avatar myarjunar avatar rudithiede avatar samweli avatar ted-dunstone avatar timlinux avatar uniomni avatar vanpuk avatar wonder-sk avatar

Watchers

 avatar  avatar

inasafe's Issues

[Shakemap Grid Importer] Error on converting grid.xm

Problem

AttributeError: type object 'QgsColorRampShader' has no attribute 'INTERPOLATED' 
Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/shake_grid/shakemap_converter_dialog.py", line 278, in accept
    mmi_ramp_roman(self.output_layer)
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/utilities/styling.py", line 66, in mmi_ramp_roman
    ramp_shader.setColorRampType(QgsColorRampShader.INTERPOLATED)
AttributeError: type object 'QgsColorRampShader' has no attribute 'INTERPOLATED'

It works fine in QGIS 2.18 and InaSAFE 4.4

[Reporting] Expression is not evaluated properly

Problem

Analysis: Flood Polygon and Population
InaSAFE 5:
screen shot 2018-06-12 at 14 26 39

InaSAFE 4.4:
screen shot 2018-06-12 at 14 35 22

Note:

  • I change the disclaimer text from the options menu (for both InaSAFE version)
  • The date also not evaluated properly

[InaSAFE Help] Click on link, get empty dialog

Problem

Opening help dialog, and click the link in InaSAFE v5, give me empty white page. See below:
link_in_help_page

In QGIS 2.18/InaSAFE v4.4, I got this kind of behavior:
link_in_help_page_4

Expected Behaviour

Should have the same behavior in InSAFE v4.4

Environment

  • InaSAFE : north-road/nr-migration-merge
  • QGIS : master
  • OS : MacOS

[Batch Runner] Failed Scenario on InaSAFE 5 compared to InaSAFE 4.4

Problem

Reproduce:

  • Create two scenarios from the layer test, save them in the same file. Something like this in the file:
  1 [Flood Polygon]
  2 exposure = /Users/ismailsunni/dev/python/inasafe-5/safe/test/data/exposure/pop_binary_raster_20_20.asc
  3 hazard = /Users/ismailsunni/dev/python/inasafe-5/safe/test/data/hazard/flood_multipart_polygons.shp
  4 extent = 106.586798, -6.379716, 107.072764, -6.081757
  5 extent_crs = EPSG:4326
  6 
  7 [Volcano KRB]
  8 exposure = /Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/test/data/exposure/census.geojson
  9 hazard = /Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/test/data/hazard/volcano_krb.shp
 10 extent = 106.468919, -6.489070, 107.238269, -6.017360
 11 extent_crs = EPSG:4326

  • Open batch runner
  • Run all scenario

I ran it in InaSAFE 5.0, I got 1 success 1 failed. The volcano KRB is failed.
If I ran it in InaSAFE 4.4, all succeed.

[Analysis] AttributeError on running simple analysis

Problem

I use the test layers from "Add test layers" button, and I tried to run analysis for:

  • Exposure: Census
  • Hazard: Continuous Flood
  • Aggregation: Entire Area

I got this error:

Problem
The following problem(s) were encountered whilst running the analysis.

AttributeError
Suggestion
You can try the following to resolve the issue:

Check that you have the latest version of InaSAFE installed - you may have encountered a bug that is fixed in a subsequent release.
Check the InaSAFE documentation to see if you are trying to do something unsupported.
Report the problem using the issue tracker at https://github.com/inasafe/inasafe/issues. Reporting an issue requires that you first create a free account at http://github.com. When you report the issue, please copy and paste the complete contents of this panel into the issue to ensure the best possible chance of getting your issue resolved.
Try contacting one of the InaSAFE development team by sending an email to [email protected]. Please ensure that you copy and paste the complete contents of this panel into the email.
Details
These additional details were reported when the problem occurred.

'InvalidLayerError' object has no attribute 'message'
Diagnostics

In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/impact_function/impact_function.py", line 1448, in run self._run()
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/utilities/profiling.py", line 126, in with_profiling ret = fn(*args, **kwargs)
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/impact_function/impact_function.py", line 1652, in _run self.hazard_preparation()
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/utilities/profiling.py", line 126, in with_profiling ret = fn(*args, **kwargs)
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/impact_function/impact_function.py", line 2149, in hazard_preparation self.hazard = clip_by_extent(self.hazard, extent)
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/utilities/profiling.py", line 126, in with_profiling ret = fn(*args, **kwargs)
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gis/raster/clip_bounding_box.py", line 125, in clip_by_extent LOGGER.exception(get_error_message(e).to_text())
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/utilities/utilities.py", line 97, in get_error_message suggestion = exception.message

It runs fine in QGIS 2.18/InaSAFE v4.4

Expected Behaviour

Environment

  • InaSAFE : master
  • QGIS : master
  • OS : MacOS
  • Data used : see above
    • Exposure :
    • Hazard :
    • Aggregation :
    • Extent :

Checklist:

  • Did you try to run it in debug mode ?
  • Is the data available ?
    • If yes, where (BTSync, data.inasafe.org, zip) ?

Proposed Solution

[Keyword Wizard] Broken UI in Multi Classification Step

Problem

Replicate:

  • Load test data
  • Select Flood Polygon
  • Click next until multi-classification step
  • Change the classification combo box
  • The UI got broken
    See below for the gif:
    broken_keywords_wizard_ui

Note:

  • rerun keyword wizard will make it worse (perhaps there are some un-deleted object)
  • you need to restart QGIS to reset it again

[Batch Runner] Can not re-run scenario

Problem

Related to #41

If I ran the scenario for the second time, I got this warning:

2018-06-13T21:26:10     WARNING    Traceback (most recent call last):
              File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/batch/batch_dialog.py", line 866, in read_scenarios
              parser.read(filename)
              File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 697, in read
              self._read(fp, filename)
              File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 1080, in _read
              raise MissingSectionHeaderError(fpname, lineno, line)
             configparser.MissingSectionHeaderError: File contains no section headers.
             file: '/Users/ismailsunni/Documents/GISData/InaSAFE/inasafe-5/scenario/batch-report-20180613212537.txt', line: 1
             'InaSAFE Batch Report File\n'
             
             During handling of the above exception, another exception occurred:
             
             Traceback (most recent call last):
              File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/batch/batch_dialog.py", line 234, in populate_table
              scenarios = read_scenarios(absolute_path)
              File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/batch/batch_dialog.py", line 872, in read_scenarios
              parser.readfp(StringIO(content))
              File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 763, in readfp
              self.read_file(fp, source=filename)
              File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 718, in read_file
              self._read(f, source)
              File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 1092, in _read
              fpname, lineno)
             configparser.DuplicateOptionError: While reading from '' [line 5]: option 'p' in section 'batch-report-20180613212537' already exists

I can click run all scenario, but only one scenario can run, the other are failed.

If I removed the batch-report-*******.txt, the warning is gone, but I can only run one scenario successfuly.

Port inasafe/parameters

https://github.com/inasafe/parameters

  • test the 2to3 tools
  • check the results
  • run the tests

because it's self-contained, no qgis classes
i'd like you to test the automated conversion tools on it
and let me know what you think - whether they are worth using and if so what issues we need to watch for
so test the tools, but manually read over and validate the results
(again, they have good test coverage which should make this part easy)

[Keyword Wizard] Strange text in multi classification step

Problem

To replicate:

  • Load test layers
  • Open keyword wizard for Flood Polygon
  • Click next until multi-classification step
  • Click edit button
  • It will show unexpected text below the drag and drop area
  • If you click save, there is unwanted text above Value Maps area
    See gif below:
    strange_text_in_keyword_wizard

Notes:

  • Move my double finger (scroll action), will fix it immediately

[GeoNode Upload] Python Error on Uploading Layer

Problem

I tried to upload a layer to geonode, I got this python error

2018-06-13T22:10:40     WARNING    Traceback (most recent call last):
              File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/geonode_uploader.py", line 165, in accept
              geonode_session = login_user(url, login, password)
              File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/utilities/geonode/upload_layer_requests.py", line 131, in login_user
              match = expression_compiled.search(result.content)
             TypeError: cannot use a string pattern on a bytes-like object

I never got this error in InaSAFE 4.4

[Minimum Needs] Error on Creating New Minimum Needs Profile

Problem

Reproduce:

  • Open Minimum Needs Manager
  • Click New button
  • Error is shown
AttributeError: module 'qgis.PyQt.QtGui' has no attribute 'QFileDialog' 
Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/minimum_needs/needs_manager_dialog.py", line 729, in new_profile
    options=QtGui.QFileDialog.DontUseNativeDialog)
AttributeError: module 'qgis.PyQt.QtGui' has no attribute 'QFileDialog'

[Multi Exposure] Run multi exposure analysis with custom order give an error

Problem

Replicate:

  • Load test layers
  • Choose Flood polygon, population, and road layer in the analysis tab
  • Choose Aggregation Summary, Analysis summary (under Multi exposure...) and Flood polygon, Population, and Road (under layer from canvas)
  • Run it
Problem
The following problem(s) were encountered whilst running the analysis.

AttributeError
Suggestion
You can try the following to resolve the issue:

Check that you have the latest version of InaSAFE installed - you may have encountered a bug that is fixed in a subsequent release.
Check the InaSAFE documentation to see if you are trying to do something unsupported.
Report the problem using the issue tracker at https://github.com/inasafe/inasafe/issues. Reporting an issue requires that you first create a free account at http://github.com. When you report the issue, please copy and paste the complete contents of this panel into the issue to ensure the best possible chance of getting your issue resolved.
Try contacting one of the InaSAFE development team by sending an email to [email protected]. Please ensure that you copy and paste the complete contents of this panel into the email.
Details
These additional details were reported when the problem occurred.

'QgsLayerTree' object has no attribute 'setVisible'
Diagnostics

In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/multi_exposure_dialog.py", line 634, in accept self.iface)
In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/analysis_utilities.py", line 155, in add_layers_to_canvas_with_custom_orders root.setVisible(False) # Make all layers hidden.

[Reporting] Got Landscape PDF for a Potrait Supposed PDF

Problem

How to replicate:

  • Load test layers
  • Run analysis on Volcano KRB and Census
  • Print all PDF reports

The affected PDFs:

  • impact-report-output.pdf
  • action-checklist-output.pdf
  • analysis-provenance-details-report-output.pdf

screen shot 2018-06-12 at 11 40 53

screen shot 2018-06-12 at 11 41 15

It works fine in QGIS 2.18/InaSAFE v4.4

Expected Behaviour

A portrait report should be printed as a portrait.

[Batch Runner] Not able to open batch runner dialog

Problem

Replicate:

  • Try to open batch runner dialog, got this error
AttributeError: 'QgisInterface' object has no attribute 'legendInterface' 
Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/plugin.py", line 971, in show_batch_runner
    dock=self.dock_widget)
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/batch/batch_dialog.py", line 88, in __init__
    self.legend = iface.legendInterface()
AttributeError: 'QgisInterface' object has no attribute 'legendInterface'

[Minimum Needs] Python Error when Set Value more than max value

Problem

Reproduce:

  • Open Minimum Needs Manager tool, and edit one of the resources
  • Set the value to more than maximum value
  • Python Error is shown, see gif below
    error-more-than-max
AttributeError: 'ValueOutOfBounds' object has no attribute 'message' 
Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/minimum_needs/needs_manager_dialog.py", line 604, in save_resource
    parameter.value = float(resource['Default'])
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe_extras/parameters/parameters/numeric_parameter.py", line 157, in value
    self._maximum_allowed_value))
parameters.parameter_exceptions.ValueOutOfBounds: Value (20000.0) must be greater than 0.167 and less than 0.2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/minimum_needs/needs_manager_dialog.py", line 607, in save_resource
    'Problem - default value is invalid') + '\n' + e.message
AttributeError: 'ValueOutOfBounds' object has no attribute 'message'

In QGIS 2.18 / InaSAFE 4.4, it will give you nice message box:
screen shot 2018-06-13 at 15 29 20

[PetaBencana Downloader] Error on downloading PetaBencana Layer

Problem

I got this when I tried to download a PetaBencana layer.
screen shot 2018-06-11 at 17 17 54

Compared to QGIS2.18/InaSAFE 4.4, I got
screen shot 2018-06-11 at 17 16 33

Expected Behaviour

It should show a pretty error message.

Environment

  • InaSAFE : north-road/nr-migration-merge
  • QGIS : master
  • OS : MacOS

Proposed Solution

[Field Mapping Tool] Error on selecting a field

Problem

See this gif below:
field_mapping_error

TypeError: 'set' object is not subscriptable 
Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/widgets/field_mapping_tab.py", line 335, in update_footer
    pretty_unique_values = ', '.join([str(v) for v in unique_values[:10]])
TypeError: 'set' object is not subscriptable

[Multi Exposure] Run multi exposure analysis with custom order give another error

Problem

How to replicate: #30

The python error in #30 is gone, but I got another error:

Problem
The following problem(s) were encountered whilst running the analysis.

AttributeError
Suggestion
You can try the following to resolve the issue:

Check that you have the latest version of InaSAFE installed - you may have encountered a bug that is fixed in a subsequent release.
Check the InaSAFE documentation to see if you are trying to do something unsupported.
Report the problem using the issue tracker at https://github.com/inasafe/inasafe/issues. Reporting an issue requires that you first create a free account at http://github.com. When you report the issue, please copy and paste the complete contents of this panel into the issue to ensure the best possible chance of getting your issue resolved.
Try contacting one of the InaSAFE development team by sending an email to [email protected]. Please ensure that you copy and paste the complete contents of this panel into the email.
Details
These additional details were reported when the problem occurred.

'NoneType' object has no attribute 'id'
Diagnostics

In file "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/gui/tools/multi_exposure_dialog.py", line 676, in accept treelayer = treeroot.findLayer(layer.id())

Check geometry() comparison with None

Testing that
a feature has a geometry is now done using the new hasGeometry() method. Any code which compares QgsFeature::geometry() to
None will need to be modified, as the method will return an empty geometry if the feature has no geometry.

[Minimum Needs Calculator] Description text is squeezed

Problem

In 5.0
screen shot 2018-06-12 at 16 54 11

In 4.4
screen shot 2018-06-12 at 16 55 08

Copy/paste some InaSAFE logs here if it was an error.

Expected Behaviour

Environment

  • InaSAFE :
  • QGIS :
  • OS :
  • Data used :
    • Exposure :
    • Hazard :
    • Aggregation :
    • Extent :

Checklist:

  • Did you try to run it in debug mode ?
  • Is the data available ?
    • If yes, where (BTSync, data.inasafe.org, zip) ?

Proposed Solution

[Set Analysis Area] Python Error on Click Set Analysis Area

Problem

This is not easy to replicate, but I got this error several times.

Basically, try to move around and do things, then at some point click the Set Analysis Area Tool Button.

An error has occurred while executing Python code: 

TypeError: decorated slot has no signature compatible with ExtentSelectorDialog.extent_defined[QgsRectangle, QgsCoordinateReferenceSystem] 
Traceback (most recent call last):
  File "/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe/plugin.py", line 745, in show_extent_selector
    self.dock_widget.define_user_analysis_extent)
TypeError: decorated slot has no signature compatible with ExtentSelectorDialog.extent_defined[QgsRectangle, QgsCoordinateReferenceSystem]


Python version: 3.6.5 (default, Jun 11 2018, 10:41:03) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] 
QGIS version: 3.1.0-Master Master, d3db66b2ff 

Python Path:
/Users/ismailsunni/dev/cpp/QGIS-Master/output/python
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Users/ismailsunni/dev/cpp/QGIS-Master/output/python/plugins
/usr/local/Cellar/gdal2-python/2.1.0_1/lib/python3.6/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe_extras/parameters
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Users/ismailsunni/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/inasafe/safe_extras

Expected Behaviour

Environment

  • InaSAFE : north-road:nr-migration-merge
  • QGIS : master
  • OS : MacOS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.