andreaordonselli / qgis2o.gis

Make O.GIS - Open Source WebGIS
https://opengis.it
GNU General Public License v2.0
14 stars 0 forks source link

Can't export 2 layers with the same name [SOLVED - layers must have different names] #3

Closed corentinmarchand closed 6 months ago

corentinmarchand commented 6 months ago

QGis2OpenGIS version : 3.19

Hello, I wanted to report a bug happening when trying to export layers carrying the same name. Here is a screenshot of my QGIS project where I have two group layers containing 2 layers with the same name :

image

When I try to export that project, only the first 2 layers are being displayed and the symbol of those not being displayed have the wrong color in the legend :

image

When I go into the layers folder, I can only see 2 layers despite the console stating it exported all 4 of them:

image image

When having unique layer names, the export works fine. I think the plugin is either overwriting the js files or writing 2 layers into the same file.

I haven't tried the 3.20 version yet to see if the issue still exists, but the current qgis2web version seems to handle that situation just fine. Thanks for having a look into this and for all the work you're doing on both plugins!

andreaordonselli commented 6 months ago

Yes, two layers cannot have the same name if you want to export with qgis2opengis. I chose this path, different from qgis2web, as many users make changes to the project after its export and having layers with unique names it is possible to easily take the additional programming that is done and apply it to the same project that is exported again. Maybe you can call the layers "G. Low Risk" and "E. Low Risk" ?

corentinmarchand commented 6 months ago

Thanks for your reply, the output didn't look like an intended behavior so I will keep your recommendation in mind whenever I encounter that situation. Having unique layer names is an easy fix although it can take a bit of time when many automatized outputs are generated with the same name.

andreaordonselli commented 6 months ago

Providing different names to the layers also allows you to better understand the data displayed in the popup. If you have two levels called Low Risk you will not distinguish them in the popup, but only as a color on the map.