Mapscript 4.10/Oracle Spatial : GetShape and drawQuery problems

Fernando Simon fsimon at UNIVALI.BR
Thu Jan 18 20:04:15 EST 2007


Hi Aude,
    Sorry for the delay to reply your message. I'm out from the lab
and can't test here, I will go back to the lab just after the day 24
of January.
    About the error, the map (just draw from database) is working?
Another query function is working?
    I didn't found any reference to a GetFeature function the the
PHPMapscript reference
(http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/referencemanual-all-pages),
maybe the best way is the GetShape. Did you already tried with -1 as
tileindex parameter for getshape? 
    About the question #2, the object did you selected is inside of
the actual extent of the map when you draw the map?
    Another thing that can be relate with the both problem is the size
of your ID column, can you try with a type that is small than 14
digits, like 5 digits? Some problems was reported between the size of
some columns and the shapeindex (the place where the UNIQUE will be
stored). Can you try with a column with less digits?
    When I go back to the lab I will test, I can't test here and look
more deep in the maporaclespatial code.
    Best regards from Brazil.


-------------------------------------------
Fernando Simon
UMN Mapserver and Oracle Spatial developer
-------------------------------------------    
    

Citando Aude Allain <aude.allain.ext at MAPPY.COM>:

>  
> 
> 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
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 




-------------------------------------------------
  Univali - Webmail - http://webmail.univali.br



More information about the mapserver-users mailing list