3

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:

((st_intersects(geom,ST_GeomFromText(
'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:

 LAYER
        NAME "wosis_latest_profiles"
    PROJECTION
        'init=epsg:4326'
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "...."
    PROCESSING "CLOSE_CONNECTION=DEFER"
    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?

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

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, privacy policy and cookie policy

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