[OpenLayers-Users] Best way to have different information shown on the same geometries

Phil Scadden p.scadden at gns.cri.nz
Mon Mar 25 13:43:46 PDT 2013


> So, correct me if I'm wrong. :)
> You are suggesting me to create a WMS server that gives to the client tiles
> of the vectorial layer of the map, and use slds in order to dinamically
> style the layer visualized on the map getting information from the server?
> Any link that exhaustively explain this?
This is the "normal" way to use openlayers. While OL supports all sorts 
of vector formats, it comes down to having to transfer ALL the vectors 
in ascii format from the server, and then use js to render them.  No 
problem for 50 vectors, but very slow over 500. Using a WMS server, you 
first store the vector data in some form of spatial database - (eg 
PostGIS, arcSDE, Oracle or even lowly shapefile with a spatial index 
enabled) this means you have fast way to only vector relevant to the map 
extent. Next the WMS server will use an SLD to render them to tiles and 
the WMS server renderer will be 1-2 orders of magnitude faster than js. 
OL just requests tiles and arranges them in the browser.

You can take full control of sld for a layer with the sld_body 
parameter, but for a lot of things you can just use the SLDSelect 
Control. See http://openlayers.org/dev/examples/SLDSelect.html for an 
example.

Setting up wms server means first choosing your server, (Geoserver, 
Mapserver or ArcGIS Server are the main options) and working through the 
setup instructions. You also need to select your spatial database. The 
simplest is shapefile but you cant filter by attribute easily at 
database end. (this might not be an issue for you). If you have arcGIS 
or Oracle, then you should probably use those, otherwise I'd use 
PostGIS. The OL examples are full of WMS usage.


Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.



More information about the Users mailing list