north-road / inasafe Goto Github PK
View Code? Open in Web Editor NEWThis project forked from inasafe/inasafe
InaSAFE - QGIS plugin for estimating impact from natural disasters
Home Page: www.inasafe.org
License: GNU General Public License v3.0
This project forked from inasafe/inasafe
InaSAFE - QGIS plugin for estimating impact from natural disasters
Home Page: www.inasafe.org
License: GNU General Public License v3.0
Replicate:
In QGIS 2.18 / InaSAFE 4.4 the changes are saved even after closing QGIS (written to QSettings)
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
For both main repo and parameters repo
When migration is done
Reproduce:
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
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.
I use the test layers from "Add test layers" button, and I tried to run analysis for:
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
Checklist:
Replicate:
Note:
Currently disabled until migration is completed
Currently disabled until migration is completed
Migration of the main plugin
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.
https://github.com/inasafe/parameters
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)
To replicate:
Notes:
Check if this is needed (WorldOSM.gdal) or if it can be replaced by the native xyz provider
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
this is not technically required.
Reproduce:
Minimum Needs Manager
New
buttonAttributeError: 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'
Replicate:
Multi exposure...
) and Flood polygon, Population, and Road (under layer from canvas
)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.
Check if after the migration any useful function is left in this module
How to replicate:
The affected PDFs:
It works fine in QGIS 2.18/InaSAFE v4.4
A portrait report should be printed as a portrait.
Replicate:
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'
Reproduce:
Minimum Needs Manager
tool, and edit one of the resourcesAttributeError: '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:
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
Previously, it was stored in ~/.qgis2/inasafe/minimum_needs
, now it is moved to the current QGIS profile directory. We need to make sure all the help is properly changed.
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())
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.
I'm not sure what to do here, I'll update the test for now, please let me know if we need some more logic to maintain the original behavior: https://github.com/inasafe/inasafe/blob/master/safe/common/test/test_utilities.py#L127
ale@blackhole:/dev/python/inasafe$ python2 -c 'print int(round(10.5))'/dev/python/inasafe$ python3 -c 'print(int(round(10.5)))'
11
ale@blackhole:
10
Maybe due to zonal stats differenced in QGIS2 and 3
Copy/paste some InaSAFE logs here if it was an error.
Checklist:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.