Mapscript 4.10/Oracle Spatial : GetShape and drawQuery problems

Aude Allain aude.allain.ext at MAPPY.COM
Mon Jan 15 06:02:42 EST 2007


Hello, 

 

Since I have installed the ms4w package, version 2.2.1, to have a
compiled mapscript dll which supports oracle spatial, I have some
problems with class methods. 

 

I use:

-          ms4w : php/mapscript_4.10.dll, php 5.2, Apache 2.2

-          Oracle Database 9.2

-          Oracle Client 10g

 

1. GetFeature

 

I have posted a message, without response to date, about the getFeature
function. When I use it, I get the following error : Fatal error: Call
to undefined function getFeature(). I use it because getShape() is
deprecated. And if I get shapeObj with getShape function I always get a
null object. 

 

My code : 

            

                        $layer              = $map->GetLayerByName
($tab_layers[$i]);  

                        $selectedObj   = @$layer->queryByPoint($geoClic,
MS_MULTIPLE, 1); 

                        $nbSelectedObj          =
$layer->getNumResults();

                                                

                        if ($nbSelectedObj == 0)

                        {

                                    continue ;

                        }

            

                        $layer->open();

                        $tabAttName = $layer->getItems();

                        $nbAttL                     =
count($tabAttName);

                        

                        for ( $j=0 ; $j<$nbSelectedObj ; $j++) 

                        {          

                                   $object            =
$layer->getResult ($j);

                                   if ( $object  == null ) echo
"<br>objet NULL ";

 

                                   //$shapeObj     =
$layer->getFeature($object->shapeindex);

 
$layer->getShape($object->tileindex,$object->shapeindex);

 

                        ...  

 

In each class of my mapfile, there is the line TEMPLATE
"ttt_query.html".

 

 

 

2. queryByAttributes 

 

I call this function to get the object which has the 'ID' field and has
the value '10400300001265'

$res = $layer->queryByAttributes'ID', 'ID=10400300001265', MS_MULTIPLE);

 

This call works, it permits to select the object in the layer because
$layer->getNumResults() return 1.

 

Then, I want to display the result so I execute the DrawQuery function
on my map Object. And the returned imageObj is always null.

 

Could you help me ? 

 

 

 

 

 

Aude

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20070115/8797ccf1/attachment.html


More information about the mapserver-dev mailing list