[Mapserver-users] functions to parse a map file?

Vladimir Guzmán bigfoot at main-task.com
Fri Jun 4 14:14:03 PDT 2004


Mark:
If you're using PHP Mapscript, you can access the layer's information 
using something like this:

for($i=0;$i< $map->numlayers;$i++){
$layer=$map->getLayer($i);
print_r($layer);
}

Hope that helps,

-- 
Vladimir Ilich Guzmán R.
------------------------
http://maintask.com 


Mark Adams wrote:

> Hi all,
>
> We are developing a sample site with Mapserver 4.2 and PHP mapscript. 
> We’d like to add some custom functions that require that we can 
> determine at run time certain aspects of the layers being published 
> through the map file, for example what type of data the layer is (e.g. 
> raster, shapefile), what its geometry type is (e.g. polygon, line), 
> etc. We had been thinking we’d parse the map file on initial load, and 
> access it programmatically from a set of arrays; but as the map file 
> structure is not XML based there isn’t an easy way of parsing the map 
> file directly. Are there any built-in functions available to allow us 
> to do this?
>
> Thanks for any help you can provide.
>
> ------------------------------
>
> Mark Adams
>
> Business & Systems Analyst
>
> Cuesta Systems Inc.
>
> 5230 South Service Road
>
> Burlington, ON L7L 5K2
>
> Phone: 905-333-4544 x14
>
> Fax: 905-333-0455
>
> Email: markadams at cuestasys.com
>




More information about the MapServer-users mailing list