danioxoli / HotSpotAnalysis_Plugin

A QGIS plugin for hotspot analysis
GNU General Public License v3.0
55 stars 12 forks source link

If no output filename is specified, ".shp/output.shp" is created #35

Open kannes opened 5 years ago

kannes commented 5 years ago

If no output filename is specified, a directory ".shp" will be created in the directory from which QGIS was launched. Inside that directory, a Shapefile named "output" (so "output.shp", "output.dbf", ...) is created.

danioxoli commented 5 years ago

This is actually an unexpected behaviour.

If no output file is specified this should results in a Python error like:

Traceback (most recent call last): File "/Users/daniele/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/hotspot_analysis.py", line 635, in run y, threshold1) File "/Users/daniele/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/hotspot_analysis.py", line 315, in write_file outLayer = outDataSource.CreateLayer("output", inLayer.GetSpatialRef(), inLayer.GetLayerDefn().GetGeomType())
AttributeError: 'NoneType' object has no attribute 'CreateLayer'

Anyway, I did not get if this is a suggestion or an issue faced during the plugin execution. In the second case, please provide more information such as your OS and both Plugin and QGIS version where you are getting this issue.

Thank you in advance

Daniele

kannes commented 5 years ago

It's meant as bug report, not a suggestion, sorry for not being clear :)

I tested with ne_10m_admin_0_countries.shp.

image

image

QGIS 3.6.3 Python 3.7 Hotspot Analysis Plugin 1.0.3 Linux