[Qgis-user] QGIS Server project files served to OpenLayers question

Andreas Neumann a.neumann at carto.net
Sat Jan 18 02:31:08 PST 2014


Hi Peter,

QGIS server is a regular WMS/WFS and soon also WCS server (like all the
other WMS servers (UMN Mapserver, Geoserver, etc.)) - but with some
extra extensions documented at
http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial

WMS serves raster (theoretically it could also server vectors as SVG),
WFS servers vector data.

As such I recommend that you read about the behaviour of a general WMS
and WFS server - as QGIS sticks to these standards.

OpenLayers can also consume and display raster and vector data.

There are already web clients built on top of OpenLayers:

https://github.com/qgis/qgis-web-client
and
http://www.3liz.com/en/lizmap.html

These clients usually display the information as raster, but can overlay
vector geometries - e.g. for search and feature highlighting when
querying features. One can use WKT, GeoJSON, WFS or KML to transport the
vector information. QGIS server optionally includes WKT geometry at
GetFeatureInfo responses. Or you could do filtered WFS queries.

Hope this helps to understand how QGIS server and some clients works.

Andreas

Am 17.01.2014 19:07, schrieb Peter Len:
> I have been playing with the QGIS Server and looking at how it serves up QGIS Desktop project files using WMS.  My initial tests were to create a new WMS layer in QGIS Desktop which used a URL to serve up a project file.  When I did this, QGIS Desktop listed all of the layers within the project file to choose from.  I could pick and choose which ones to add to the new project file.  I also found that when I selected a feature layer (feature points from our database), the Identify Features tool showed the selected feature metadata which meant that although the layer was served up over WMS, it still understood it to be a feature layer.  The next step was to try to load the project file in OpenLayers (using an OpenLayers.Layer.WMS object).  When trying this, I found the following:
> 
> 1) I needed to list the WMS layer as an image
> 2) I could give the file path to the project file using the "map" option
> 3) I had to list the name of the layer.  When I used a GetCapabilities URL in the browser for a given project file, I see that there is always a Layer with the name of the project file and SOMETIMES there is another layer name for one of the actual layers within the project.  I have yet to see a GetCapabilities for a project file that listed all the layer names.  In any case, if I used the project file name as the layer name option, it would indeed display everything on the OpenLayers map.
> 
> I guess as expected, because the layer was displayed as an image and as a single layer, there was no access to the feature metadata (like there is with the Feature Identify tool in QGIS Desktop).  The layer was simply a WMS image.  Based on this, my conclusion is that there is no way to select and view individual features from my QGIS project file when the client is a browser-based mapping API like OpenLayers.  Does this sound about right, or am I missing some other way to have OpenLayers understand that there are actual features, like points, lines, and polygons?
> 
> Thanks for any thoughts - Peter  
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
> 




More information about the Qgis-user mailing list