<html><head><base href="http://tilesr2.texaswideopen.com/tilecache?LAYERS=parcels&FORMAT=image%2Fpng&TILED=true&COUNTY=tx-bell&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=-10844885.23159,3639014.3820941,-10844273.735364,3639625.8783203&WIDTH=256&HEIGHT=256"></head><body style="-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><base href="http://tilesr2.texaswideopen.com/tilecache?LAYERS=parcels&FORMAT=image%2Fpng&TILED=true&COUNTY=tx-bell&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=-10844885.23159,3639014.3820941,-10844273.735364,3639625.8783203&WIDTH=256&HEIGHT=256"><div>I am using tilecache with mapserver to serve map tiles. I seem to be having a problem because my geometry column is not named 'geom'. Below is my mapfile exerpt and the error message. You can see the the SQL that is built is not correct. I did some digging in the source code and found the lines I think are the culprit. I have also included these below.</div><div><br></div><div><br></div><div>Mapfile Exerpt</div><div><div> CONNECTIONTYPE postgis</div><div> CONNECTION "dbname='gisdb' host='localhost' port=5432 user='webuser' password='*********' sslmode=disable"</div><div> DATA 'shape FROM "maps_parcel" USING UNIQUE id USING srid=4326'</div></div><div><br></div><div><br></div>ERROR<div><span class="Apple-style-span" style="font-family: monospace; white-space: pre-wrap; ">An error occurred: msDrawMap(): Image handling error. Failed to draw layer named 'parcels'.</span></div><pre style="word-wrap: break-word; white-space: pre-wrap;">msPostGISLayerWhichShapes(): Query error. Error (ERROR: column "shape" does not exist
LINE 1: ..."color",encode(AsBinary(force_collection(force_2d("shape")),...
^
) executing query: select "id","color",encode(AsBinary(force_collection(force_2d("shape")),'NDR'),'hex') as geom,"id" from "maps_parcel" where shape && GeomFromText('POLYGON((-97.4212539097114 31.0482371048694,-97.4212539097114 31.0529247835391,-97.4157822026614 31.0529247835391,-97.4157822026614 31.0482371048694,-97.4212539097114 31.0482371048694))',4326)
File "/srv/ve/two-release/lib/python2.6/site-packages/TileCache/Service.py", line 303, in wsgiHandler
format, image = service.dispatchRequest( fields, path_info, req_method, host )
File "/srv/ve/two-release/lib/python2.6/site-packages/TileCache/Service.py", line 208, in dispatchRequest
return self.renderTile(tile, params.has_key('FORCE'))
File "/srv/ve/two-release/lib/python2.6/site-packages/TileCache/Service.py", line 138, in renderTile
data = layer.render(tile, force=force)
File "/srv/ve/two-release/lib/python2.6/site-packages/TileCache/Layer.py", line 444, in render
return self.renderTile(tile)
File "/srv/ve/two-release/lib/python2.6/site-packages/TileCache/Layers/MapServer.py", line 51, in renderTile
mapImage = wms.draw()
File "/srv/ve/two-release/lib/python2.6/site-packages/mapscript.py", line 1466, in draw
def draw(*args): return _mapscript.mapObj_draw(*args)
</pre><div>Links are to trac source code</div><div><a href="http://trac.osgeo.org/mapserver/browser/trunk/mapserver/mappostgis.c#L1612">1612</a> - from msPostGISBuildSQLItems</div><div>It aliases all geom columns to 'geom'</div><div><br></div><div><br></div><div><br></div><div><a href="http://trac.osgeo.org/mapserver/browser/trunk/mapserver/mappostgis.c#L1861">1861</a> - from msPostGISBuildSQLWhere</div><div>It builds the BBOX part of the where clause with the geom column from the config file</div><div><br></div><div><br></div><div><br></div></body></html>