0

I have installed Mapserver 7.4.0 with PostGIS 2.4. However, I can't load any layer with geography column.
This is my MAP file (with contents prior to LAYER omitted):

MAP
<omitted>

  LAYER
    COMPOSITE
    END # COMPOSITE
    CONNECTION "host=127.0.0.1 dbname=testgis user=postgres password=****** port=5432"
    CONNECTIONTYPE POSTGIS
    DATA "geog from srwg"
    METADATA
      "coordsys_name"   "Longitude-Latitude / WGS 84"
    END # METADATA
    NAME "New Layer"
    PROJECTION
      "proj=longlat"
      "datum=WGS84"
      "no_defs"
    END # PROJECTION
    STATUS ON
    TEMPLATE "query"
    TILEITEM "location"
    TYPE POLYGON
    UNITS METERS
    CLASS
      NAME "Class (0)"
      STYLE
        COLOR 255 255 255
        OUTLINECOLOR 0 0 0
        SIZE 8
      END # STYLE
    END # CLASS
  END # LAYER

END # MAP

It comes with the following error:

msPostGISLayerWhichShapes(): Query error. Error executing query

Is Mapserver incompatible with geography columns?

6
  • 1
    Didn't try myself, but it should work: postgis.net/docs/manual-2.4/ch06.html#idm2922 Jul 15, 2019 at 12:19
  • @AndreasMüller It doesn't work. New error: msPostGISLayerWhichShapes(): Error (Error: find_srid() - could not find the corresponding SRID - is the geometry registered in the GEOMETRY_COLUMNS table? Is there an uppercase/lowercase mismatch? (Note: It still treats the layer as geometry and try to find it in GEOMETRY_COLUMNS table) Jul 16, 2019 at 1:48
  • A similar question here: gis.stackexchange.com/a/15941/46073 Jul 16, 2019 at 8:06
  • @AndreasMüller Did you try it yourself? I hope you did. Jul 16, 2019 at 9:15
  • 1
    If I had a solution for you, i would give an answer. Unfortunately i didn't use the geographic data type with mapserver. In my first link it is claimed that mapserver supports geographic columns, in my second link, which i searched for you, there seems to be an answer, using a differnt data entry with a trailing using srid=, so i hoped it may work for you. Jul 16, 2019 at 9:49

0

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.

Browse other questions tagged or ask your own question.