MappiaEarth / mappia_publisher

Share your maps online, just create the layout in QGIS and use this plugin to easily publish it online.
http://mappia.earth
GNU General Public License v2.0
3 stars 3 forks source link

AttributeError: 'list' object has no attribute 'split' #4

Closed Barl75 closed 3 years ago

Barl75 commented 3 years ago

Hi, when I try to install the plugin (QGIS: 3.10.7, Python: 3.6.9, UBUNTU 18.04 LTS) i get this python error:

_Traceback (most recent call last): File ".......local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 518, in initAlgorithm defaultValue=self.getGitDefault(options) File "........local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 562, in getGitDefault elif UTILS.which("git.exe") is not None: File "......local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/UTILS.py", line 233, in which for path in UTILS.getenvsystem("PATH").split(os.pathsep): AttributeError: 'list' object has no attribute 'split'

Can you suggest a solution? Luca

asfixia commented 3 years ago

Hi!

I've found the problem, and the fix will be published soon! Thanks for your report.

To work around this problem, please fill out the git executable path in plugin window.

PS: To discovery if you have GIT in your system, just type in terminal: "git" PS2: To get the path to your git type in terminal: which git

asfixia commented 3 years ago

Thanks to your reply, now the version 2.9.1 will fix this issue. (Waiting QGIS approval)

Barl75 commented 3 years ago

thanks to you, but I've the problem with the current version of mappia (2.9.1) installed. about the workaround, yes i've git installed, and the path setted. but i don't see in the plugin window a row where to add the executable path. what i'm wronging? Schermata del 2020-07-01 10-34-03

Luca

asfixia commented 3 years ago

Hi Barl75, You can click on "Parametri avanzati" to expand and see the "Git Executable" parameter.

If you can please consider update your plugin version, its already available at qgis plugins. ae

Please let me know if it solved.

Barl75 commented 3 years ago

Hi, after updating the plugin the original problem has been solved . but now the process stop after creating the repo in my github (this one https://github.com/Barl75/Mappia_Example ) This is the log: _Started: Verify the input options. Automatic Step: Checking remote repository. Creating the new repository: MappiaExample Automatic Step: Checking git executable. Select your git executable program. It can be downloadable at: https://git-scm.com/downloads Esecuzione fallita dopo 4.26 secondi (Execution failed after 4.26 seconds)

If I add in advanced parameters the github executable path, my Username (and also tried with Access token), the process stop earlier (it doesn't create the repository on github.)

Bye Luca

asfixia commented 3 years ago

Thanks again Barl75

We really had a problem in linux. Now we've tested the plugin in a linux and fixed bugs. All because this issue you've reported. Sorry for the delayed response. The new plugin version "Mappia Publisher" 2.9.3 has improved the linux OS support.

Please inform if the issue was solved. If the result was not what you expected, please tell us too, what is missing so we could improve the results too. Thank you.

Barl75 commented 3 years ago

Dear Danilo, I updated the plugin but the problem is still present. The creation of repository on Github works, but it doesn't upload the data. The original shapefile is a Multipolygon (epsg 3857) the log say:

File "...local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 752, in processAlgorithm return self.generate(writer, parameters, context, feedback) File "....../.local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 553, in generate if self.isPointLayer(layer): File "......local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 520, in isPointLayer return isinstance(layer, QgsVectorLayer) and layer.geometryType() == QgsWkbTypes.GeometryType.PointGeometry AttributeError: type object 'GeometryType' has no attribute 'PointGeometry'

If it could be useful for your testing, I will continue to try on linux your (amazing) work!

Luca

asfixia commented 3 years ago

Hi Luca!

The plugin is compatible with QGIS version 3.x+, this error happens probably on an older 2.x version. Where the PointGeometry doesn't exist.

And again an improvement for the plugin, a QGIS version warning check for older versions. I hope this plugin become usefull for most and most people. Thank you very much, hope these issues soon!

Danilo

Barl75 commented 3 years ago

Dear danilo, I Have qgis 3.10.... I'll try next Plugin version anyway! Bye

asfixia commented 3 years ago

Hi Luca!

I've installed a linux with a QGIS 3.10.4 but couldnt find the version 3.10.7 to check. I hope it will work on the next version (2.9.4).

Please let me know! Thanks!

Edit: The new version was accept by QGIS.

Barl75 commented 3 years ago

I just try the 2.9.4 plugin version, still problem "AttributeError: type object 'GeometryType' has no attribute 'PointGeometry'"

Anyway I will test next versions! bye Luca

asfixia commented 3 years ago

Sorry i dont know what is happening. The PointGeometry is described as part of QGIS 3.10 api. I've added a code to treat this 'PointGeometry' error and ignore it, when this problem occour all maps will be published equally (even the map with geometry of points). This verification if your map has a point geometry that was causing this error.

Edit: Is your map a public data ? Could you send me for testing purposes? Thank you! Please let me know if it solved this issue.

Edit: Published the version (2.9.5) with this fix.

Barl75 commented 3 years ago

Hi Danilo, just tested 2.9.5, but it still not work. here the file that I used to test the plugin, a polygon shapefile (epsg 3857) test.zip

now I have a new problem: "AttributeError: type object 'Flag' has no attribute 'UseRenderingOptimization'"

here the log:

Publishing layer: a Warning: Error to identify the Geometry type type object 'GeometryType' has no attribute 'PointGeometry' Generating tiles to publish online Error, publication failed! Reporting error to Mappia development team. Traceback (most recent call last): File "...local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 777, in processAlgorithm return self.generate(writer, parameters, context, feedback) File "...local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 584, in generate layerRenderSettings = self.createLayerRenderSettings(layer, dest_crs, outputFormat) File "...local/share/QGIS/QGIS3/profiles/default/python/plugins/mappia_publisher/mappia_publisher_algorithm.py", line 668, in createLayerRenderSettings settings.setFlag(QgsMapSettings.Flag.UseRenderingOptimization, on=False) AttributeError: type object 'Flag' has no attribute 'UseRenderingOptimization'

asfixia commented 3 years ago

Hi Lucas,

I've added some catches for possible errors, hope it work now! (2.9.6). Thanks!

Barl75 commented 3 years ago

Dear Danilo, it works! here the test: https://maps.csr.ufmg.br/calculator/?queryid=152&storeurl=https://github.com/Barl75/Mappia_test2//&remotemap=GH:a;1 my configuration: Ubuntu 18.04.4 LTS, QGIS 3.10.7, mappia plugin 2.9.6 now i will deepen how to customize the map in the editor mode. Thanks for your support, Luca

asfixia commented 3 years ago

Great news! Thank you very much for your patience and help improving our system! Mappia