Hello, I need help because I have bumped into a weird issue while migrating from Mapserver 4.6 to 4.8.<br>I have several applications running perfectly well based on MS4W 1.3.0. They´re developed in PHPMapscript and I use shapefile and POSTGIS data.<br>When I migrated to mapserver 4.8 (in MS4W 1.5.0), This error appears when I tried to query POSTGIS point layers (only postgis, not shapefiles):<br><br>----------------------------------------------------------------------------------------<br>Warning: [MapServer Error]: prepare_database(): Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from ejidos WHERE the_geom && setSRID('BOX3D(5676966.1875 6041297.8425,5800095.4875 6139801.2825)'::BOX3D, find_srid('','ejidos','the_geom') )'<br><br>Postgresql reports the error as 'ERROR: cursor "mycursor" already exists '<br><br>More Help:<br><br>Error with
POSTGIS data variable. You specified '<check your .map file>'.<br>Standard ways of specifiying are :<br>(1) 'geometry_column from geometry_table'<br>(2) 'geometry_column from (<sub query>) as foo using unique <column name> using SRID=<srid#>'<br><br>Make sure you put in the 'using unique <column name>' and 'using SRID=#' clauses in.<br><br>For more help, please see http://postgis.refractions.net/documentation/<br><br>Mappostgis.c - version of Jan 23/2004. in /opt/fgs/www/htdocs/BA2ss/index.php on line 115<br><br>Fatal error: Call to a member function on a non-object in /opt/fgs/www/htdocs/BA2ss/index.php on line 116 <br><br>----------------------------------------------------------------------------------------<br><br>Analyzing the problem I found out that error occurs when I query a point layer which has other layers below in the map file. For example if I have a cities layers over a state layer error occurs, but if I turn off the polygon
layer don´t. I have to remark that this only happens with POINT layers.<br>I have to say that until mapserver 4.6 all worked perfectly!. By the way, I tried the code in a XP box and in a SUSE 10 one, and the same happens. I´m also using POSTGRESQL 8.1 with POSTGIS 1.1<br><br>The code I use to make the point queries is:<br>----------------------------------------------------------------------------------------<br>$pun_cons = ms_newpointobj();<br> $pun_cons->setxy($geo_x, $geo_y);<br> $layerbyname = layer_seleccionado($_GET['obj_layer1']);<br> $capa_activa = $mapa->getLayerbyname($layerbyname); //layerObj getLayer(int index)<br> //$nombre_layer= $capa_activa->name; //nombre del layer activo consultado<br> //$resul_cons =
@$capa_activa->queryByPoint($pun_cons, MS_SINGLE, -1);<br> if(@$capa_activa->queryByPoint($pun_cons, MS_SINGLE,$tolerancia) == MS_FAILURE) {<br> <br> //return array("NO SE INTERSECTO RASGO!",$nombre_layer);//$resul_cons;//<br> $vacio = "<br><table ALIGN = 'center' border='1' bgcolor='#99FF66'><tr><td>Consulta Vacia</td></tr></table>";<br> return $vacio;<br> exit;<br> }else if ($capa_activa->status == MS_ON){<br><br> $resultados =
$capa_activa->getresult(0); //Returns a resultCacheMemberObj by index from a layer object withindex in the range 0 to numresults-1.<br> //Returns a valid object or FALSE(0) if index is invalid.<br> $shape_index = $resultados->shapeindex; // Instances of ResultCacheMemberObj are always obtained
through<br> //layerObj's getResult() method.<br> $tile_index = $resultados->tileindex;<br> if($capa_activa->open() == MS_FAILURE) {<br> return "No se pudo abrir ".$resultados->name;<br>
exit;<br> }<br> // <br> $shape = $capa_activa->getshape($tileindex, $shape_index);<br> $capa_activa->close;<br>----------------------------------------------------------------------------------------<br><br>Please help me if you can´t because I analized the code and as far as I know seems right to me.<br>Thanks in advance <br><br>Sergio<br>Argentina<br><br><br><p>
<hr size=1>
<a href="http://ar.autos.yahoo.com/">Yahoo! Autos</a>. Más de 100 vehículos vendidos por día.<br>
¿Qué esperás para <B>vender</B> el tuyo? <br>
<a href="http://ar.autos.yahoo.com/vender/"><B>Hacelo ahora y ganate un premio de Yahoo!</B></a>