buffer around vector features

Lowell.Filak lfilak at MEDINACO.ORG
Mon Dec 19 06:38:08 PST 2005


William, 

Steve has probably solved your problem but if needed here is a quick Perl 
example that was created to test 4.6.1 is: 

#
# Open the specified shapefile.
$shapefile = new mapscript::shapefileObj($file, -1) or die "Unable to open 
shapefile $file";
#
# Place the nth shape into the shape object for analysis.
$shapefile->get($i, $shape);
#
# Take the existing shape and buffer it.
$geosbuff = $shape->buffer($buffit);
#
# Set the bounds of the new shape.
$geosbuff->setBounds();
#
# Now operate using the new buffered shape.
# Including queryByShape( mapObj map, shapeObj shape )
$result = $layer->queryByShape($map, $geosbuff)
#
# ... 

HTH 

Lowell 

william paul writes: 

> Dear Lowell Filak:
>    
>   Yes, I am very interested in using mapscript. I am working more with java, but if the example is with php I can understand
>    
>   Thank's
>    
>   William 
> 
> "Lowell.Filak" <lfilak at MEDINACO.ORG> wrote:
>   william paul writes:  
> 
>> Hello: 
>> 
>> It is possible to create buffer around a vector feature? and use the buffer to select the features insight the buffer? 
>> 
>> Does someone have a working example? 
>> 
>> Thank you in advance
> 
> William,  
> 
> You can do all of that with SWIG MapScript except select "within", it only 
> does a "passthru" method.
> I can dig up a sample if you are interested in using MapScript.  
> 
> Lowell 
>    
> 
> 
> 			
> ---------------------------------
> Yahoo! Shopping
>  Find Great Deals on Holiday Gifts at Yahoo! Shopping 
 



More information about the MapServer-users mailing list