[mapserver-users] PostGIS geography layer doesn't render in Mapserver

Raj Singh rsingh at opengeospatial.org
Thu Sep 13 10:01:41 PDT 2012


I believe my problem is similar to this:
http://osgeo-org.1560.n6.nabble.com/Cannot-get-a-PostGIS-layer-to-render-in-Mapserver-td4233163.html

But that post is from 2010 and surprisingly I can't find anything newer with this issue. 
I want Mapserver to serve data in PostGIS 1.5.3 that has a geography point column (NOT geometry!). 
I'm using leaflet and trying to display a WMS layer out of mapserver on top of cloudmade tiles. When I make the query, mapserver debugging output gives me the following. Help!

[Thu Sep 13 11:45:55 2012].55933 msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  function st_force_2d(geography) does not exist
LINE 1: select encode(ST_AsBinary(ST_Force_2D("geogpt"),'NDR'),'hex'...
                                  ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Here is how the layer is defined in the .map file (p.s. if I use a geometry column everything works fine)
  LAYER
    NAME         mylayer
    METADATA
      "wms_title" "mywms"
      "wms_enable_request" "*"
      "gml_include_items" "all"
    END
    TYPE         POINT
    PROJECTION
      "init=epsg:4326"
    END
	CONNECTIONTYPE POSTGIS
	CONNECTION	"host=localhost dbname=mydb user=myuser password=mypw"
    DATA         "geogpt from mytable using srid=4326 using unique oid"
    ....
---
Raj




More information about the mapserver-users mailing list