[mapserver-users] help -- PostGIS data not displaying as expected, works with shapefiles though!
Sean Twomey
stwomey at hotmail.com
Mon Apr 30 18:42:54 PDT 2012
Hello,
I get the following error when I execute the map file at the bottom of this message:
msDrawMap(): Image handling error. Failed to draw layer named 'nationalPark'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR: Operation on two geometries with different SRIDs
I can get this to work when its just a shapefile, but it doesn't work when its coming from PostGIS. I am using Mapserver 6.0.2 with postgresql 9.1 and postgis 1.5.3
Thanks for your help!
# Map file created from QGIS project file /htgProject/htgProject_POSTGIS_forMapserver.qgs
# Edit this file to customize for your map interface
# (Created with PyQgis MapServer Export plugin)
MAP
NAME "HTG-MAP"
# Map image size
SIZE 600 600
UNITS meters
EXTENT -68586.071680 -336740.884289 1941518.891992 2241795.401077
FONTSET './fonts/fontset.txt'
SYMBOLSET './symbols/symbols.txt'
SHAPEPATH './data'
PROJECTION
"init=epsg:3005"
END
# Background color for the map canvas -- change as desired
IMAGECOLOR 255 255 255
IMAGEQUALITY 95
IMAGETYPE png
OUTPUTFORMAT
NAME png
DRIVER 'GD/PNG'
MIMETYPE 'image/png'
IMAGEMODE PC256
EXTENSION 'png'
END
# Legend
LEGEND
IMAGECOLOR 255 255 255
STATUS ON
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
END
# Web interface definition. Only the template parameter
# is required to display a map. See MapServer documentation
WEB
# Set IMAGEPATH to the path where MapServer should
# write its output.
IMAGEPATH '/tmp/'
# Set IMAGEURL to the url that points to IMAGEPATH
# as defined in your web server configuration
IMAGEURL '/tmp/'
# WMS server settings
#Scale range at which web interface will operate
# Template and header/footer settings
# Only the template parameter is required to display a map. See MapServer documentation
TEMPLATE './template/template3.html'
END
LAYER
NAME 'nationalPark'
TYPE POLYGON
TEMPLATE './template/template3.html'
EXTENT -68586.071680 -336740.884289 1941518.891992 2241795.401077
CONNECTIONTYPE postgis
CONNECTION "dbname='...' host=... port=5432 user='...' password='...' sslmode=disable"
DATA 'the_geom FROM "nationalPark" USING UNIQUE gid USING srid=3005'
#DATA 'the_geom FROM nationalPark'
#DATA 'nationalPark'
METADATA
'ows_title' 'nationalPark'
END
STATUS default
TRANSPARENCY 100
PROJECTION
"init=epsg:3005"
END # End Projection
CLASS
NAME 'sea_bc_alb'
STYLE
WIDTH 0.91
OUTLINECOLOR 0 0 0
COLOR 158 156 14
END
END # End Class
END # End Layer nationalPark
END
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120430/04aca8c4/attachment.htm>
More information about the MapServer-users
mailing list