Dear everybody,<br>  <br>                          I've been trying to get a shapefile displayed from my postgis database on my site. I've somehow been unable to do so. The site on opening says, "msDrawMap(): Image handling error. Failed to draw layer named 'Road'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  column "geom" does not exist
LINE 1: select "name",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR'),...
                                                     ^
 
". I set the debug variables on in my mapfile and it came up with this.<br><br>[Sun Apr 22 00:23:48 2012].720775 msPostGISLayerOpen called: geom from asia_southern_asia_india_delhi_highway<br>[Sun Apr 22 00:23:48 2012].721115 msPostGISLayerOpen: No connection in pool, creating a fresh one.<br>

[Sun Apr 22 00:23:48 2012].919149 msConnPoolRegister(Road,user=postgres password=***************** dbname=delhiroads host=localhost,0x91c6630)<br>[Sun Apr 22 00:23:48 2012].961144 msPostGISLayerOpen: Got PostGIS version 10500.<br>

[Sun Apr 22 00:23:48 2012].961217 msPostGISLayerFreeItemInfo called.<br>[Sun Apr 22 00:23:48 2012].961257 msPostGISLayerInitItemInfo called.<br>[Sun Apr 22 00:23:48 2012].961293 msPostGISLayerWhichShapes called.<br>[Sun Apr 22 00:23:48 2012].961335 msPostGISParseData called.<br>

[Sun Apr 22 00:23:48 2012].961397 msPostGISRetrievePK called.<br>[Sun Apr 22 00:23:48 2012].961440 msPostGISRetrievePK: select attname from pg_attribute, pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname = 'asia_southern_asia_india_delhi_highway' and pg_table_is_visible(pg_class.oid) and pg_constraint.conkey[2] is null<br>

[Sun Apr 22 00:23:48 2012].970777 msPostGISParseData: unique_column=gid, srid=, geom_column_name=geom, table_name=asia_southern_asia_india_delhi_highway<br>[Sun Apr 22 00:23:48 2012].970865 msPostGISBuildSQL called.<br>[Sun Apr 22 00:23:48 2012].970899 msPostGISBuildSQLItems called.<br>

[Sun Apr 22 00:23:48 2012].970935 msPostGISBuildSQLItems: 1 items requested.<br>[Sun Apr 22 00:23:48 2012].970966 msPostGISBuildSQLFrom called.<br>[Sun Apr 22 00:23:48 2012].971015 msPostGISBuildSQLWhere called.<br>[Sun Apr 22 00:23:48 2012].971045 msPostGISBuildSQLSRID called.<br>

[Sun Apr 22 00:23:48 2012].971076 msPostGISBuildSQLSRID: Building find_srid line.<br>[Sun Apr 22 00:23:48 2012].971106 msPostGISBuildSQLSRID: Found table (asia_southern_asia_india_delhi_highway)<br>[Sun Apr 22 00:23:48 2012].971140 msPostGISBuildSQLBox called.<br>

[Sun Apr 22 00:23:48 2012].971246 msPostGISLayerWhichShapes query: select "name",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR'),'hex') as geom,"gid" from asia_southern_asia_india_delhi_highway where geom && GeomFromText('POLYGON((76.8164150612777 28.410443,76.8164150612777 28.862691,77.4196089387223 28.862691,77.4196089387223 28.410443,76.8164150612777 28.410443))',find_srid('','asia_southern_asia_india_delhi_highway','geom'))<br>

[Sun Apr 22 00:23:48 2012].974241 msPostGISLayerWhichShapes query status: PGRES_FATAL_ERROR (7)<br>[Sun Apr 22 00:23:48 2012].974320 Error (msPostGISLayerWhichShapes()<br>) executing query: ERROR:  column "geom" does not exist<br>

LINE 1: select "name",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR'),...<br>                                                     ^<br>[Sun Apr 22 00:23:48 2012].974372 msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  column "geom" does not exist<br>

LINE 1: select "name",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR'),...<br>                                                     ^<br> <br>[Sun Apr 22 00:23:48 2012].974411 msPostGISLayerFreeItemInfo called.<br>

[Sun Apr 22 00:23:48 2012].974444 msPostGISLayerClose called: geom from asia_southern_asia_india_delhi_highway<br>[Sun Apr 22 00:23:48 2012].974478 msConnPoolRelease(Road,user=postgres password=Christbearers dbname=delhiroads host=localhost,0x91c6630)<br>

[Sun Apr 22 00:23:48 2012].974510 msConnPoolClose(user=postgres password=Christbearers dbname=delhiroads host=localhost,0x91c6630)<br>[Sun Apr 22 00:23:48 2012].975210 msDrawMap(): Image handling error. Failed to draw layer named 'Road'.<br>

[Sun Apr 22 00:23:48 2012].976675 msPostGISLayerClose called: geom from asia_southern_asia_india_delhi_highway<br>[Sun Apr 22 00:23:48 2012].977001 freeLayer(): freeing layer at 0x91c8538.<br>[Sun Apr 22 00:23:48 2012].977060 msPostGISLayerIsOpen called.<br>

<br><br>An additional detail is that I've recently installed pgrouting onto my system. I got the deb files for the latest pgrouting package available from the ubuntu repositories. Its installed with support for driving distance. When I ran my mapfile which had been running fine using bare shapefiles, I got an error. Here is the mapfile.<br>

<br><br>MAP # /////////////////////////////////////////////////////////////MAPFILE BEGINS.////////////////////////////////////////////////////////////////////////////<br>    NAME "First"<br>    CONFIG "MS_ERRORFILE" "/var/www/tmp/ms_error.txt"<br>

    CONFIG "ON_MISSING_DATA" "LOG"<br>    CONFIG "PROJ_LIB" "/usr/share/proj/"<br>    CONFIG "PROJ_DEBUG" "ON"<br>    CONFIG "CPL_DEBUG" "ON"<br>

    SIZE 1024 768<br>    IMAGECOLOR 239 245 186<br>    IMAGETYPE PNG<br>    SHAPEPATH "/var/www/Delhi/"<br>    FONTSET /var/www/fonts/fontset.txt<br>    EXTENT 76.898503 28.410443 77.337521 28.862691<br>         <br>

         #<br>        # ///////////////////////////////////////////////////////WEB CONSTRUCT BEGINS. ///////////////////////////////////////////////////////////////<br>         #<br>        <br>        WEB <br>            TEMPLATE "/var/www/roadrefined.html"<br>

            IMAGEPATH "/var/www/tmp/"<br>            IMAGEURL "/tmp/"<br>        END #__________________END OF THE WEB CONSTRUCT._____________________########################################################################<br>

        <br>         #<br>        # //////////////////////////////////////////////////////THE FIRST LAYER. LAYER THAT DRAWS EVERYTHING. ///////////////////////////////////////<br>         #<br><br>        LAYER<br>            NAME "Road"<br>

            CONNECTIONTYPE postgis<br>            CONNECTION "user=postgres password=************** dbname=delhiroads host=localhost"<br>            DEBUG 5<br>            STATUS DEFAULT<br>            TYPE LINE<br>

            DATA "geom from asia_southern_asia_india_delhi_highway"<br>            LABELCACHE ON<br>            LABELITEM "name"<br>                    <br>             #<br>            # //////////////////////////////////////////////////////THE CLASS THAT CLASSIFIES EVERYTHING IN IT. ////////////////////////////////<br>

             #<br><br>            CLASS<br>            <br>                 #<br>                # /////////////////////////////////////////////////////THE STYLE OF DRAWING THIS CLASS. ////////////////////////////////////<br>

                 #<br><br>                STYLE<br>                    OUTLINECOLOR 0 123 0<br>                    COLOR 153 205 205<br>                END #___END OF THE SYLE DECLARATION FOR THIS CLASS.___#####################################################################<br>

<br>                 #<br>                # ////////////////////////////////////////////////////THE LABEL DISCIPLINE FOR THIS CLASS. ////////////////////////////////<br>                 #<br><br>                LABEL<br>
                    MINFEATURESIZE auto<br>
                    COLOR 0 0 0<br>                    FONT "arial"<br>                    TYPE truetype<br>                    ANGLE follow<br>                    SIZE 12<br>                    MINDISTANCE 50<br>

                    REPEATDISTANCE 150<br>                END #________END OF THE LABEL DISCIPLINE FOR THIS CLASS.________###########################################################        <br><br>            END #_________END OF THE CLASS THAT CLASSIFIES EVERYTHING.___________##############################################################<br>

        END #________END OF THE LAYER THAT DRAWS EVERYTHING._________##############################################################################<br>END #_________________________________END OF THE MAPFILE, ATLAST.___________________________________#######################################################<br>

<br><br><br><br>I'm stuck here for long and my project is stuck too. If anybody has any clue how to work this one out, please help.<br><br>Anurag.<br>