Can mapfiles be generated dynamically?

Tom Kazimiers 2voodoo at GMX.DE
Sun Jan 20 06:58:25 EST 2008


Tamas,

thanks for your reply.

Tamas Szekeres wrote:
> 2008/1/19, Tom Kazimiers <2voodoo at gmx.de>:
>   
>> Hi,
>>
>> I am relatively new to mapserver and am currently playing around to find
>> out what is possible and what is not.
>> Currently I develop an application which should be run on a mobile
>> device like a PDA. One aim is that there is something like a
>> "MapServer-Layer" which gives the opportunity to
>> 1. get information which shapefiles and rasterdata is available on the
>> server
>> 2. one should be able to choose one or more layers out of 1. which then
>> should be displayed according to position, zoom level, etc.
>>
>> So in my opinion this implies that the mapfiles which hold information
>> about what layers can be displayed, in which order and so on could be
>> generated dynamically (which must also be possible if I want to change
>> the order). Is there already a way in mapserver (or an application) to
>> accomplish this?
>>
>> If not the way to got would possibly be writing an application which
>> does the generation, right?
>>     
>
> You can easily set up a map object and save the state of this object
> as a mapfile using the mapscript API in various languages right now.
> However I don't think mapfile is the most appropriate format to
> exchange metadata between a server and the client application. Why
> don't you use something more conventional like utilizing the WMS
> GetCapabilities and GetMap services that mapserver can provide?
>   
Ok, GetCapabilities and GetMap seem to be something like I was looking for.
Still it would be nice if you could clarify something. Currently, as I 
understand, the steps I have to take are:

1. Set up a mapfile with all the shapefiles and rasterdata files I want 
to be offered to the client side (the PDA).
For this I do not need to build a "MapServer Application, do I?
2. I have to query the MapServer with GetCapabilities for the offered 
layers. Is the path to the mapfile in the URL relative to the MapServer 
binary?
3. On the client side I have to choose which layers I want to be shown 
and prepare a request with GetMap
4. In return I get an image I can display

Are those steps correct?
What if I want to change the order of the layers?

>> Maybe I have misunderstood something, but mapfiles are not available for
>> all the applications or the whole mapserver, but are available to the
>> belongig application? Therefore it is unlikely to find something like
>> this already in mapserver, but maybe in an available application.
>>
>>     
>
> Mapsever + mapscript fully support reading or writing mapfiles and
> provide API to do such things for various applications and platforms,
> but mobile devices and PDAs are not supported at the moment.
>   
Good to know - but if I would take the way with the creation of mapfiles 
I think I should create a MapServer application to which I make a 
request from the PDA and which serves me the resulting image.

Thanks in advance,
Tom



More information about the mapserver-users mailing list