Using the following WFS: http://dev-maps.isric.org/mapserv?map=/map/wosis_latest.map on QGIS 2.18 and then opening the QGIS query builder on layer ms:wosis_latest_profiles, and running the following query:

profile_id IN (69728,69916,69525,69903,69486,69607)

We end up with the following error on MapServer's side :

MapServer outputs a msPostGISLayerWhichShapes(): Error (ERROR: Operation on mixed SRID geometries) error.

From the logs we have a rather extensive SQL query: https://pastebin.com/cQDXM0Hp

Basically MapServer sends a query to postgis that contains:

'POLYGON ((-184.2090000000000032 
-184.2090000000000032 -54.8890999999999991))')

And here is the problem, for the query to be successful we need for ST_GeomFromText to indicate the SRID=4326, otherwise we have the error Operation on mixed SRID geometries and no reply from MapServer

The WFS service runs mapserver7.6/gdal2.4/proj4 and postgis ("POSTGIS="2.5.4" [EXTENSION] PGSQL="110" GEOS="3.8.1-CAPI-1.13.3" PROJ="Rel. 7.0.1, May 1st, 2020" GDAL="GDAL 3.0.4)

The mapfile has the indication of layer projection and simple data connection:

        NAME "wosis_latest_profiles"
    CONNECTION "...."
    DATA "geom from web_services.wosis_latest_profiles"

Is this a problem related to the PostGIS version / GDAL combinations, some miss configuration on MapServer, bug on QGIS? Any tips on how to debug it?

  • 1
    Try with DATA "geom from web_services.wosis_latest_profiles using srid=4326"
    – user30184
    Commented Jun 25, 2020 at 15:10
  • The suggestion given by @user30184 is correct and solved the problem Commented Jun 26, 2020 at 7:13

1 Answer 1


The problem was solved usng: DATA "geom from web_services.wosis_latest_profiles using srid=4326"

Your Answer

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

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