nextgis / nextgisweb

Web GIS framework by NextGIS
https://nextgis.com/nextgis-web/
GNU General Public License v3.0
217 stars 95 forks source link

QGIS styling not working #608

Closed gerbsen closed 6 years ago

gerbsen commented 6 years ago

Hey, I've installed nextgis locally and can't seem to be able to:

  1. create a QGIS style resource, it just isn't shown. (only MapServer style)
  2. If I create a MapServer style and click Import QGIS style and then upload the attached file I only get (this also happens if I use the hosted version)
    <map>
    <!-- Неизвестный тип: graduatedSymbol -->
    </map>

any ideas? cheers, daniel

(had to rename the style file since github complained about qml) style.qml.txt

gerbsen commented 6 years ago

Okay, I now managed to get the QGIS style layer showing up, but it's not showing up on the map. I do have a problem during installation with this:

For QGIS 2.16 and higher:

# Only for latest QGIS version (2.16 and higher)
export PYTHONPATH=$PYTHONPATH:/usr/bin/python
cp -r `/usr/bin/python -c "import PyQt, os.path; print os.path.split(PyQt.__file__)[0]"` $DST

I always get this error:

Step 39/40 : RUN cp -r `/usr/bin/python -c "import PyQt, os.path; print os.path.split(PyQt.__file__)[0]"` /nextgis/env/lib/python2.7/site-packages
 ---> Running in 536a651ee770
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named PyQt
cp: missing destination file operand after '/nextgis/env/lib/python2.7/site-packages'
Try 'cp --help' for more information.

Is there maybe a system dependency missing?

drnextgis commented 6 years ago

I've updated instructions for nextgisweb_qgis installing. You have to install dependencies such way (qgis-to-env is file from nextgisweb_qgis repository):

qgis-to-env env
gerbsen commented 6 years ago

hey @drnextgis I've used your tips to install the qgis plugin. unfortunately all my geometries are somehow transparent and I do not get any error messages:

screenshot 2018-01-17 22 27 58

If I upload the layer via QGIS to nextgis.com I received normal colored geometries. The QML file is exactly the same for my local installation and nextgis online...

8.qml.txt

drnextgis commented 6 years ago

@gerbsen one of my colleagues faced with the same issue. Try to install qgis package. I've updated instructions.

gerbsen commented 6 years ago

@drnextgis where did you update the instructions?

drnextgis commented 6 years ago

https://github.com/nextgis/nextgisweb_qgis/commit/d774ad0ace7ea603de4daf848c2f2d632f31f02d

gerbsen commented 6 years ago

Hmm.. I'm using your docker install, where this is already added :(

drnextgis commented 6 years ago

Cannot reproduce this issue here with docker. Could you share your data and qml files?

gerbsen commented 6 years ago

Okay, I do see the geometries now. :( Recreated everything and removed a HTST issue with my NGINX server. Sorry for the confusion.

gerbsen commented 6 years ago

So I'm sorry but I have to reopen this issue. I've uploaded a different layer before and that seemed to work. Unfortunately all other layers I have (mostly coming from Postgis) are not displayed. So the steps to reproduce this issue:

  1. Load the Leipzig shape file
  2. Layer style Graduated
  3. Column GRÜNE_per
  4. Classify Equal interval
  5. Import layer to nextgis
  6. create web map

leipzig.zip 15.qml.txt

gerbsen commented 6 years ago

@drnextgis I think I've found the problem! :) I think it is due to an 'Umlaut' -> "Ü" in the attribute name. If I import a shape file with only one column and no umlauts, the layer is shown correctly.

drnextgis commented 6 years ago

It seems that you have at least three broken field names: FREIE W�_1, FREIE W�_2, FREIE W�_3. Rename them and then your layer should be loaded without any problem.

$ ogrinfo -so -al leipzig.shp
INFO: Open of `leipzig.shp'
      using driver `ESRI Shapefile' successful.

Layer name: leipzig
Metadata:
  DBF_DATE_LAST_UPDATE=2018-01-24
Geometry: Polygon
Feature Count: 63
Extent: (307450.169200, 5679889.824000) - (328773.360000, 5702756.016050)
Layer SRS WKT:
PROJCS["SWEREF99_TM",
    GEOGCS["GCS_SWEREF99",
        DATUM["SWEREF99",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",15],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
index: Real (20.0)
Ortsteil: String (254.0)
Wahlkreis: Real (20.0)
Wahlberech: Real (20.0)
Wähler: Real (20.0)
...
FREIE W�_1: Real (24.15)
FREIE W�_2: Real (24.15)
FREIE W�_3: Real (24.15)
...
gerbsen commented 6 years ago

No, I've tried this with a layer that only contains a single column with and without umlauts and ogrinfo does not comlain: one is working one is not :(

leipzig_with_umlaut.zip leipzig_without_umlaut.zip

drnextgis commented 6 years ago

@gerbsen I've renamed these three columns and have uploaded your layer and style to nextgis.com: http://rykovd.nextgis.com/resource/276/display All works fine.

gerbsen commented 6 years ago

@drnextgis If I've a column with Ü the layer is not shown. I've just tried this with the leipzig_with_umlaut.zip first and then renamed the column in qgis to GRUENE and then it shows up.

BishopGIS commented 6 years ago

There is a special alias for non ASCII strings. Please use aliases instead of such field names. Non ASCII field name can be easily rename via Administrative UI. See http://docs.nextgis.com/docs_ngweb/source/layers_settings.html#layer-attributes

drnextgis commented 6 years ago

Have uploaded your two layer onto webmap without any problem. Links to the appropriate style resources:

drnextgis commented 6 years ago

@gerbsen I have reproduced your issue with docker instance.

drnextgis commented 6 years ago

Issue was fixed. You have to update ngwdocker and to perform the following command:

docker-compose up -d
gerbsen commented 6 years ago

Awesome!