0

Here is how QGIS shows an irrigation network, received by MapServer via WMS and superimposed on OpenStreetMap:

enter image description here

Here is the same thing, but slightly panned to the right:

enter image description here

Several items are obviously missing. In fact there are items missing in the top picture as well. Different items become visible as I zoom and pan differently.

This link provides this tile (which I subsequently show on leaflet):

enter image description here

This is how QGIS shows that area if I manage to zoom and pan in a way that (I think) all information is shown:

enter image description here

What am I doing wrong? I don't see anything in the MapServer logs. MapServer version is 7.6.2 (prepackaged for Debian).

Appendix

Here is parts of the map file:

MAP
    NAME "aira-poros"
    STATUS ON
    SIZE 9040 7731
    EXTENT 103986.57 3850796.18 1007945.14 4623933.00
    UNITS meters
    PROJECTION
        "init=epsg:2100"
    END
    CONFIG MS_ERRORFILE "/var/log/mapserver/extralayers.log"

    # [Omitting some OUTPUTFORMAT sections]

    WEB
        IMAGEPATH "/var/cache/mapserver/"
        IMAGEURL "/mapserver_tmp/"
        METADATA
            "wms_title" "Aira Poros"
            "wms_onlineresource" "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&"
            "wms_srs" "EPSG:4326 EPSG:2100 EPSG:3857"
            "wms_enable_request" "*"
            "wms_feature_info_mime_type" "text/html"

            "wfs_title" "Aira Poros"
            "wfs_onlineresource" "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&"
            "wfs_srs" "EPSG:2100 EPSG:4326 EPSG:3857"
            "wfs_enable_request" "*"
        END
    END

    LAYER
        NAME "irrigation-network" 
        TYPE LINE
        CONNECTIONTYPE OGR
        CONNECTION "irrigation-network.gml"
        METADATA
            "wms_title" "Irrigation network"
            "wfs_title" "Irrigation network"
            "gml_include_items" "all"
            "gml_featureid" "id"
        END
        STATUS ON
        PROJECTION
            "init=epsg:2100"
        END
        CLASSITEM 'category'
        CLASS
            EXPRESSION '1'
            STYLE
                COLOR 0 0 255
                OPACITY 50
                WIDTH 6
            END
            LABEL
                COLOR 0 0 255
                ANGLE FOLLOW
                OFFSET 5 99
                MAXSCALEDENOM 10000
                TEXT "[irri_code]"
            END
            LABEL
                COLOR 0 0 255
                ANGLE FOLLOW
                OFFSET -8 99
                MAXSCALEDENOM 10000
                EXPRESSION (NOT('[Diameter]' = ''))
                TEXT "D=[Diameter] mm"
            END
        END

        # [Omitting three more classes]
    END

    # [Omitting four more layers]
END
10
  • Can you please provide us with the WMS link?
    – DannaC17
    Sep 19, 2022 at 18:29
  • Could you add the network information from QGIS (hit F12)? Sep 19, 2022 at 21:44
  • @swiss_knight You mean the requests? I'm not certain what exactly to copy. I think it might be faster for you to see them yourself than to explain to me what you want. The base URL is poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/…; there are five layers, and the one in question is the "Irrigation network" (although all layers have the problem). Sep 20, 2022 at 6:12
  • @DannaC17 The base URL is poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/…. There's also a link with a specific request in the question immediately above the third image. Sep 20, 2022 at 6:14
  • Why request using EPSG:3857 as per your 'tile' example , when the canvas is EPSG:4326 and the service supports EPSG:4326.
    – nmtoken
    Sep 21, 2022 at 16:46

2 Answers 2

1

It looks like either you have an error in your data, or QGIS/MapServer is having problems reprojecting between EPSG:3857 (WMS requests) and EPSG:2100 (WFS request and native format). You can see looking at them together in QGIS using EPSG:2100.

WMS/WFS data mismatch

It looks like in the layer metadata (map file) you currently have

"WMS_SRS" "EPSG:2100"

perhaps change this to:

"OWS_SRS" "EPSG:2100 EPSG:3857 EPSG:4326"

Then QGIS will allow you to select say EPSG:2100 for both the WMS/WFS.

2
  • I added the map file to the question. I think that the problem you see here is because you've chosen SRS 2700 when you actually meant 2100. I can reproduce what you're seeing with 2700, but not with 2100, 4326 or 3857. Sep 22, 2022 at 7:03
  • oops, you're right that I incorrectly chose 2700, but QGIS should do reprojection on the fly, so the data should align even if QGIS has to do the reprojection from 2100 to 2700.
    – nmtoken
    Sep 22, 2022 at 9:46
0

As @nmtoken had suspected (see his answer), the problem occurred when MapServer was reprojecting the data from EPSG:2100 (Greek grid—the CRS of the data files) to EPSG:3857.

The problem disappeared when I upgraded MapServer from 7.6.2 to 8.0.0. I didn't want to compile MapServer and I used a version from Debian bullseye backports, which only has 8.0.0, so I don't know if the problem exists in 7.6.4.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.