Mapserver PostGIS Custom SRID Problem

Paul Moen pmoen at OFFROADSOFTWARE.COM
Tue Jan 29 13:49:17 EST 2008


I get the following error when trying to draw a layer that exists in postgis.

[MapServer Error]: msPOSTGISLayerWhichShapes(): Error executing POSTGIS SQL statement (in FETCH ALL): DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from mt_counties WHERE the_geom && setSRID('BOX3D(1792876.6493994 343910,2160707.3506006 612229)'::BOX3D, 1038007 )
-ERROR:  Operation on two geometries with different SRIDs

If I issue the following sql command in postgis two rows are returned rather than the error.

 SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from mt_counties WHERE the_geom && setSRID('BOX3D(1792876.6493994 343910,2160707.3506006 612229)'::BOX3D, 1038007 )

The custom SRID has been added to the spatial_ref_sys table in postgis and the epsg file in the proj resources.  These layers display exactly the way I want when viewing with Qgis connected as postGIS layers.

Does anyone have any ideas on what I can do to further troubleshoot this?  Is this a problem with mapserver, postgis, or something I am doing?  

Version info.

Mac OS 10.4.11

"POSTGIS="1.2.1" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel. 4.5.0, 22 Oct 2006" USE_STATS"

MapServer Version    MapServer version 4.10.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
PHP MapScript Version    ($Revision: 1.260.2.1 $ $Date: 2006/11/22 19:34:45 $)

Thanks,

Paul



More information about the mapserver-users mailing list