[ms4w-users] get shape boundary !

Jeff McKenna jmckenna at dmsolutions.ca
Fri Aug 31 17:23:32 EDT 2007


You'll have more chance of getting phpmapscript help on the main 
MapServer mailing list, sorry.  (list info at 
http://mapserver.gis.umn.edu/community/mailinglists/mapserver-users/)

--
jeff





Quang Nguyen wrote:
> Hi,
> 
> I use PHP/Mapscript to show a path (from WKT string) on the map 
> dynamically. It worked (my path displayed correctly).
> 
> But I can’t get the boundary of the path. The attributes of RectObj 
> always return -1.
> 
> This is my code:
> 
>  
> 
> $map = ms_newMapobj("test.map");
> 
> $layer = $map->getLayerByName("my_path");
> 
> $path = ms_shapeObjFromWkt(“MULTILINESTRING((…..))”);       
> 
> $boundary = $path->bounds;
> 
>  
> 
> $minx = $boundary->minx; //always return -1
> 
> $miny = $boundary->miny ; //always return -1
> 
> $maxx = $boundary->maxx; //always return -1
> 
> $maxy = $boundary->maxy; //always return -1
> 
>  
> 
>  
> 
> $layer->addFeature($path);       
> 
> $layer->set('status', MS_ON);
> 
> $map->draw();
> 
>  
> 
> Can anybody help ?
> 
> Thanks
> 
> Quang
> 
>  
> 


More information about the ms4w-users mailing list