Hi I am hoping someone can help with this. I am having trouble with the zoom to 'extent read from layer feature'.
I am using pmapper 3.1.0 with mapscript 4.10.0. I am using DD units. I have a map with several ogr (tab file) layers and postgis layers. I want to start pmapper zoomed to the extent defined by a polygon in one of the postgis layers. If i use a simple url http://.../map.phtml the map loads fine I can search and so-on but if I try http://.../map.phtml?zoomLayer=Paddocks&[EMAIL PROTECTED]@[EMAIL PROTECTED]@0 I get errors. The error recordeed in the log is: PHP Fatal error: zoomPoint failed : Max Georeferenced coordinates minx >= maxx after a bit of investigating I found a suppressed error was occurring in (initmap.php:495): [MapServer Error]: prepare_database(): Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT \"isfallow\"::text,\"c_farm\"::text,asbinary(force_collection(force_2d(the_g eom)),'NDR'),OID::text from p.v_pad_export WHERE (c) and (the_geom && setSRID( 'BOX3D(152.09666 -29.70515,153.66666 -28.21139)'::BOX3D,find_srid('','p.v_pad_export','the_geom') ))'\n\n Postgresql reports the error as 'ERROR: column \"c\" does not exist at character 165\n'\n\nMore Help:\n\nError with POSTGIS data variable. You specified 'check your .map file'.\nStandard ways of specifiying are : \n(1) 'geometry_column from geometry_table' \n(2) 'geometry_column from (sub query) as foo using unique column name using SRID=srid#' \n\nMake sure you put in the 'using unique column name' and 'using SRID=#' clauses in.\n\nFor more help, please see http://postgis.refractions.net/documentation/ \n\nMappostgis.c - version of Jan 23/2004.\n\n the line where the error occurs is: // Query layer @$qLayer->queryByAttributes($queryField, $queryValue, MS_MULTIPLE); and at this point in the script: $queryField = "c_farm"; $queryValue = "c_farm='8001'"; if I extract the failed query - drop the transactional stuff and remove the slashes - I get: SELECT "isfallow"::text,"c_farm"::text,asbinary(force_collection(force_2d(the_geom) ),'NDR'),OID::text from p.v_pad_export WHERE (c) and (the_geom && setSRID( 'BOX3D(152.09666 -29.70515,153.66666 -28.21139)'::BOX3D,find_srid('','p.v_pad_export','the_geom') )) which doesn't work because of the WHERE (c) bit if we replace that with WHERE (c_farm='8001') it does work. is this a bug in mapscript ? Thanks in advance Gabe below is my map layer: LAYER NAME "Paddocks" GROUP "Paddocks" STATUS ON DATA "the_geom from p.v_pad_export" TYPE POLYGON CONNECTIONTYPE postgis CONNECTION "user=user password=pass dbname=productivity host=localhost port=5432" REQUIRES "![Photography]" MAXSCALE 2000000 LABELITEM "c_linkcode" LABELMINSCALE 400 LABELMAXSCALE 50000 TOLERANCE 10 TOLERANCEUNITS pixels TEMPLATE "void" METADATA "DESCRIPTION" "Paddocks" "RESULT_FIELDS" "c_farm, c_paddock, area_ha, variety, class, age, group_no, date_pl, date_rat, distance, yield, cut, standovr, soil, isfallow, area_ha1" "RESULT_HEADERS" "Farm, Paddock, Area, Variety, Class, Age, Group, Planted, Ratooned, Distance, Yield, Cut, StandOver, Soil, Fallow, Area1" END CLASSITEM "isfallow" CLASS EXPRESSION "f" NAME "Paddock" LABEL TYPE truetype FONT "Vera" SIZE 6 POSITION AUTO OFFSET 0 0 MINDISTANCE 400 COLOR 0 0 0 OUTLINECOLOR 255 255 255 PARTIALS FALSE END STYLE SYMBOL "stippled" COLOR 0 128 0 OUTLINECOLOR 255 255 0 END END CLASS EXPRESSION "t" NAME "Fallow" LABEL TYPE truetype FONT "Vera" SIZE 6 POSITION AUTO OFFSET 0 0 MINDISTANCE 400 COLOR 0 0 0 OUTLINECOLOR 255 255 255 PARTIALS FALSE END STYLE SYMBOL "stippled" COLOR 255 128 0 OUTLINECOLOR 255 255 0 END END END ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users