[Mapbender-users] Slightly OT: PostGIS Layer in UMN Mapserver

Arnulf Christl arnulf.christl at wheregroup.com
Fri May 11 12:18:54 EDT 2007


Jan Peters-Anders wrote:
> Hello list, I asked this question already on the UMN list but did not
> get any reply, so far (Friday afternoon? ;-)), but maybe someone here
> has a solution for my problem:
> 
> I have a webapplication that creates (via an SQL query) a view in my
> PostGres database. Then I display this view via mapserver. Mapfile
> code looks as follows:
> 
> -----8<----------------------- LAYER NAME firmen_psql TYPE POINT 
> STATUS ON CONNECTION "user=blabla password=bla dbname=foo
> host=localhost port=5432" CONNECTIONTYPE postgis DATA "the_geom from
> v_iis_over" -----8<-----------------------
> 
> That works perfectly. Now I want to have multiple users query the
> database, creating views according to e.g. a session id, e.g:
> 
> "v_iis_over_[sessionId]"
> 
> Now my problem is, that I would need different mapfiles containing
> the different table (view) names to accomplish a correct display of
> the query results for each user. Is it e.g. possible to hand over the
> new (view) id via an http request? Or do I have to create a new
> mapfile each time a new session is created?

Adding "&sessionId=***" as a paramater to your request should do the trick. 

But the whole setup is somewhat experimental, error prone and hard to debug. You should consider taking the customization of your request out of the database and into the client where it belongs. If you are using WMS this would be accomplished by adding OGC SLD or FE parameters. Then you do not need to modify your database but only the request.  

Regards, Arnulf 

> Also here on the mapbender list: Any suggestions will be greatly
> appreciated :-)
> 
> Greetings from Vienna
> 
> Jan



More information about the Mapbender_users mailing list