Hi Andreas,

(so great to see the QGIS + MapServer communities working together here)

Inspired by your questions today, I gave another round of updates to the MapServer documentation, improving the examples for GetFeatureInfo etc.

Besides what was mentioned already, you might also consider setting the "gml_" metadata parameters for your layer, to send the geometry as part of the "Feature" response (in the Identify Results / GetFeatureInfo window of QGIS, select "Feature" in the dropdown box) [note that often that Feature dropdown is blank in that QGIS window until I first chose either "text" or "html" and reselect "Feature" to get the GML format request through GetFeatureInfo sent back to QGIS]. Here are those parameters:

MAP
 ...
   WEB
     ...
     METADATA
       "wms_title"          "WMS Demo Server"  ##required
"wms_abstract" "Longer description of your service" ##recommended "wms_onlineresource" "http://yourpath/cgi-bin/mapserv.exe?map=/path/to/your-mapfile.map"; ##required (must change mapfile path) "wms_srs" "EPSG:3978 EPSG:3857 EPSG:4269 EPSG:4326" ##recommended
        "wms_enable_request" "*"   ##required
"wms_getfeatureinfo_formatlist" "text/plain,text/html,application/vnd.ogc.gml,gml" ##recommended
    END #metadata
  END #web
  ...
  LAYER
    ...
    METADATA
      "wms_title"         "Parks"   ##required
      "wms_abstract"      "Longer description of your layer" ##recommended
      "wms_include_items" "all" ##optional
      "gml_include_items" "all" ##optional
      "gml_featureid"     "ogc_fid" ##optional
      "gml_geometries"    "msgeom" ##optional
      "gml_msgeom_type"   "multipolygon" ##optional
    END #metadata
    ...
TEMPLATE "empty" ##recommended (enable GetFeatureInfo / can point to valid .html template)
    ...
  END #layer
END #map

Or see the example WMS Server mapfile at: https://mapserver.org/ogc/wms_server.html#sample-wms-server-mapfile

Again, it's excellent to see the QGIS & MapServer communities working together, thanks for this! :)

PS. I bet I've listed QGIS there on that WMS Server document page for now 20 years, as the recommended desktop client for testing, ha.

-jeff





--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/



On 2022-05-20 4:41 a.m., Andreas Neumann via Qgis-user wrote:
Hi Barend,

Thanks. It's been a while since I last worked with UMN map server.

I must have been "blind" not to see the queryable="0" in the Capabilities response.

Your suggestions helped. All fine now!

Thanks a lot,

ANdreas

On 2022-05-20 09:18, Kobben, Barend (UT-ITC) wrote:

Your mMAP set up apparently is wrong, because contrary to what you think, the layer is NOT queryable:

<Layer queryable="0" opaque="0" cascaded="0">

<Name>cave_entrances</Name>

Usualy this means you have to set appropriate things in the .map file, such as

First, we have to prepare MapServer to actually be set up to respond to the request in a way the OpenLayers script can handle:

Edit your .map file. In *each* LAYER object you want to query, put the lines:

    TOLERANCE 5

    TOLERANCEUNITS pixels

In each LAYER object's METADATA put the extra line:

    "wms_include_items" "all"

In each CLASS object put the extra line:

    TEMPLATE "empty"

/-- /

/Barend Köbben/

On 20/05/2022, 09:10, "Qgis-user on behalf of Andreas Neumann via Qgis-user" <[email protected] <mailto:[email protected]> on behalf of [email protected] <mailto:[email protected]>> wrote:

Hi,

I am experimenting with a very simple/basic WMS served by UMN Mapserver.

For some reasons, GetFeatureInfo does not work, although it is "advertised" as available in the GetCapabilities reponse.

Here is the test service: http://159.100.248.156/cgi-bin/mapserv.fcgi?map=/home/ubuntu/umn_mapfiles/cave_entrances.map <http://159.100.248.156/cgi-bin/mapserv.fcgi?map=/home/ubuntu/umn_mapfiles/cave_entrances.map>

and a link to the GetCapabilities request

http://159.100.248.156/cgi-bin/mapserv.fcgi?map=/home/ubuntu/umn_mapfiles/cave_entrances.map&SERVICE=WMS&REQUEST=GetCapabilities <http://159.100.248.156/cgi-bin/mapserv.fcgi?map=/home/ubuntu/umn_mapfiles/cave_entrances.map&SERVICE=WMS&REQUEST=GetCapabilities>

When I load this layer, i get the two points in the data set, but I can't query them. QGIS says "No feature found at this position" and in the network debugging session I see that no request is sent to the server.

Do you have any idea what might be wrong with this WMS service?

Thank you and greetings,

Andreas


_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to