[OpenLayers-Users] PostgreSQL dynamic layer

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Thu Nov 2 07:45:04 EST 2006


The only way to do this through the WMS protocol is using an SLD. You should
read up on Styled Layer Descriptors if you want to go this way. You should
be able to pass the SLD_BODY parameter to the OpenLayers Layer, so that
OpenLayers will pass it onto Mapserver WMS. See:

http://mapserver.gis.umn.edu/docs/howto/sldhowto

Alternatively, you could use a Mapserver Layer in OpenLayers (see
http://www.openlayers.org/dev/examples/mapserver.html), I believe doing a
selection is then done using QSTRING. See:

http://mapserver.gis.umn.edu/docs/reference/cgi/referencemanual-all-pages

Hope this helps.

PS for further questions, it's probably best to determine beforehand which
questions are appropriate for the OpenLayers list and which ones for the
Mapserver user list.

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Moser Adrian <Adrian.Moser at bs.ch>
Naar: users at openlayers.org <users at openlayers.org>
Onderwerp: [OpenLayers-Users] PostgreSQL dynamic layer
Datum: 02/11/06 10:34

> Hi list,
> 
> I already posted this question once but couldn't solve the problem.
> I'm implementing a routing application based on PostgreSQL/PostGIS. The
routes are stored temporarily in a Postgres table together with the current
session-ID. I then included this table in a Mapserver Layer which I want to
show with OpenLayers. The problem is that could be different routes in the
table and I just want to display the one belonging to the current session.
> There is a parameter expression that can be set in the .map file but I
need to do this dynamically.
> 
> Mapserver Layer:
> 
> LAYER
>       NAME path
>       CONNECTIONTYPE POSTGIS
>       CONNECTION &quot;user=xxx password=xxx dbname=xxx host=localhost
port=5432&quot;
>       DATA &quot;the_geom from routingrouten&quot;
>       
>       PROJECTION
>         &quot;init=epsg:4326&quot;
>       END
>       STATUS ON
>       TYPE LINE
> 
>       CLASS
>         NAME 'path'
> 	      STYLE
>           COLOR 0 255 0
>           WIDTH 3
>         END
>       END
>       METADATA
>         &quot;wms_title&quot; &quot;path&quot;
>       END
> END
> 
> JavaScript function:
> 
> function showRoute(sessId) {
>   //Berechente Route anzeigen
>   wms_path = new OpenLayers.Layer.WMS(&quot;path&quot;,
>    
'http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/nafmomNeu/map/nafmom.map',
>     {LAYERS: 'path', format: 'png', transparent: 'true'},{'buffer':1});
>   map.addLayer(wms_path);
> }
> 
> Is there a possibility to do this?
> 
> I noticed that if I display a route (currently all routes are displayed)
and the recalculate the route with slightly other start and end point an
display it OpenLayers still shows the old route. It display to show a cached
tile. How can I solve this problem?
> 
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 






More information about the Users mailing list