[Mapserver-users] Questions about PHP/MapScript

Ken-ichi kueda at wso.williams.edu
Thu Apr 1 12:27:26 EST 2004


I'm a bit of a MapServer newbie, but I've been playing with allowing 
users to dl layers as well.  I'm not sure if this technique will work in 
3.6.6, but here's what I've been doing in 4.0.1.  First I add a metadata 
element containing the file name to the layer.  Then I create an HTML 
legend template and access that piece of metadata in the layer block to 
create a link to a PHP script, passing along the name of the file.  The 
PHP script then uses the zlib functions to zip up every file in my 
shapepath that has the name stored in the metadata (ie filename.dbf, 
.sbn, .sbx, .shp, .shx, etc), drops the zip to the tmp directory, and 
provides the user with a link.  Or you could just have static, 
pre-zipped versions of all your data and link to them, which would be 
easier and wouldn't stress out your server as much.

I'd provide some code but I just put it together and it's pretty 
sloppy.  Maybe I'll post it here when it's cleaned up.

-Ken-ichi

PS.  I noticed the archive pages for this list don't provide any 
anti-spam encoding of email addresses (of the form kueda at wso dot 
blah, or using HTML entities).  Can this be enabled?

gheysen.t at skynet.be wrote:

> Hello,
>  
> I make a work on the use of web mapping in forestry. I have made a 
> client interface with PHP/MapScript 3.6.6. I have 4 questions about it.
>  
> 1. I want to create a PHP function that export a layer of the current 
> map in a new shapefile that will be download by the client. How can I 
> do this ?
>  
> 2. Someone can exply to me the use of the method getShape ?
>  
> 3. In PHP/MapScript 3.6.6. it was possible to make a search (by the 
> methode queryByAtrributes) on more than one atrribute. Is it still 
> possible with PHP/MapScript 4.0.1 and the new version of this method ?
>  
> 4. It-is possible to make a query on the results of the precedent 
> query ? I have try with queryByFeatures() but I have not results : it 
> draw only the good shapes but I have no results.
>  
> Thanks in advance
>  
> P.S. :  Excuse for my bad english
>  
> Gheysen Thibaut
> Faculté des Sciences Agronomiques de Gembloux.
> gheysen.t at fsagx.ac.be <mailto:gheysen.t at fsagx.ac.be>   
>  
>
>
>  




More information about the mapserver-users mailing list