Discussion:
QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
(too old to reply)
Peter Len
1970-01-01 00:00:00 UTC
Permalink
I am using QGIS Server that is running in my OSGeo Apache web server (on Windows 7). Not sure what version the QGIS Server is but it was from the latest OSGeo4W installer. I was testing an OpenLayers client to view a QGIS Desktop project file over WMS from the QGIS Server. All seems good with that. For example, my OpenLayers code to get this looks like:

var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);

With the above, I can view my layers within OpenLayers. My next test was to see if I could get the feature info from items on my layers. I found an example of how to make this call in OpenLayers and it looks like:

var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();

When I tried this, I didn't get anything except a spinning cursor. I then tried another test to see if that was the correct way to ask for feature info so I changed the URL for the layers to get the layers from my GeoServer rather than from QGIS Server (the project file got these layers initially from GeoServer so we are talking about the same layer source). That worked just fine and I was able to get individual feature information. After switching back to point to my QGIS Server I started to look at the Apache web server logs and the GeoServer output screen. The Apache logs didn't list anything related but the GeoServer console listed the following:

20 Jan 13:06:57 INFO [geoserver.wms] -
Request: getServiceInfo
20 Jan 13:06:57 INFO [geoserver.wms] -
Request: getCapabilities
Namespace = Postgres
UpdateSequence = null
Request = GetCapabilities
Version = 1.3.0
RequestCharset = null
RawKvp = {SERVICE=WMS, REQUEST=GetCapabilities}
Get = false
BaseUrl = http://localhost:8080/geoserver/
20 Jan 13:06:57 WARN [wms.capabilities] - Map output format text/html does not i
nclude mime type in output format names. Will be excluded from capabilities docu
ment.
20 Jan 13:06:57 WARN [wms.capabilities] - Map output format application/xml does
not include mime type in output format names. Will be excluded from capabilitie
s document.

This occurred just after clicking on my OpenLayers map, which in turn triggered the WMSGetFeatureInfo request. I noticed that there was no reference to GetFeatureInfo. So... I am not sure what to make of this. Should my OpenLayers call be something different? Does QGIS Server not serve up features from layers within a project file? I had found some references concerning a problem with QGIS Server and GetFeatureInfo calls (Bug #8656) but the request URL listed seemed to be something different than my scenario via OpenLayers and to a project file layer.

Any thoughts?

Thanks - Peter
Alex Mandel
2014-01-20 20:34:51 UTC
Permalink
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.

infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),


Thanks,
Alex
Peter Len
1970-01-01 00:00:00 UTC
Permalink
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.


-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
Alex Mandel
2014-01-21 00:49:46 UTC
Permalink
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.

Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Peter Len
2014-01-21 13:41:46 UTC
Permalink
Alex - Good idea with the Firebug. This is what I found.... The first URL is the one being sent to the QGIS Server (returns no results) and the second one is the URL that gets sent to GeoServer (returns results):

http://localhost:8090/qgis/qgis_mapserv.fcgi.exe?LAYERS=location_view&QUERY_LAYERS=location_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106

http://localhost:8080/geoserver/Postgres/wms?LAYERS=Postgres%3Alocation_view&QUERY_LAYERS=Postgres%3Alocation_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106

You can see that both URLs contain the same parameters and values, except that the call to the GeoServer contains a workspace name with the layer name. Just as a test, I added the workspace name to the QGIS Server URL but that simply failed because it was an incorrect reference. The QGIS Server URL is going to a QGIS project file which contains a layer that comes from my GeoServer. So, in the end, we are talking about the same data set for both URLs, except one is going through QGIS Server as a pass-through to the GeoServer.

So, given that there does not seem to be an issue with the URL or its parameters per se, I would have to believe that there must be some something within the QGIS Server configuration. I understand that QGIS Server is supposed to handle GetFeatureInfo requests so I must be missing something in the QGIS Server configuration, some extra parameter in the URL, or ????

Any new thoughts from the QGIS Server gurus?

Thanks - Peter







-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Andreas Neumann
2014-01-21 13:49:24 UTC
Permalink
Peter,

I think you are just missing the map parameter. Should be:

map=/path/to/your/projectfile.qgs

This is essential, as otherwise QGIS server doesn't know which project
you are refering to.

As Alex said, this is a vendor-specific parameter. Alternatively to the
map parameter you can use a technique in Apache called URL-rewriting,
decribed in the README of QGIS web client. This rewrites the URL so that
the map parameter gets added.

Andreas
Post by Peter Len
http://localhost:8090/qgis/qgis_mapserv.fcgi.exe?LAYERS=location_view&QUERY_LAYERS=location_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106
http://localhost:8080/geoserver/Postgres/wms?LAYERS=Postgres%3Alocation_view&QUERY_LAYERS=Postgres%3Alocation_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106
You can see that both URLs contain the same parameters and values, except that the call to the GeoServer contains a workspace name with the layer name. Just as a test, I added the workspace name to the QGIS Server URL but that simply failed because it was an incorrect reference. The QGIS Server URL is going to a QGIS project file which contains a layer that comes from my GeoServer. So, in the end, we are talking about the same data set for both URLs, except one is going through QGIS Server as a pass-through to the GeoServer.
So, given that there does not seem to be an issue with the URL or its parameters per se, I would have to believe that there must be some something within the QGIS Server configuration. I understand that QGIS Server is supposed to handle GetFeatureInfo requests so I must be missing something in the QGIS Server configuration, some extra parameter in the URL, or ????
Any new thoughts from the QGIS Server gurus?
Thanks - Peter
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Peter Len
2014-01-21 13:59:13 UTC
Permalink
Andreas - I had previously used the map parameter per an earlier response, but it didn't help. I have two test versions of this. One that does tell QGIS Server to use a project file at the path listed in the map parameter and one that does not list a map parameter, in which case QGIS Server uses the first project file it finds in its bin directory. I have been doing my main testing using the project in the bin directory to eliminate any problems that may be due to adding the map parameter. When not adding the map parameter, QGIS Server serves up the correct layer info for display in my OpenLayers, it just seems to be a problem when asking for the GetFeatureInfo.

- Peter


-----Original Message-----
From: Andreas Neumann <a.neumann at carto.net>
Sent: Jan 21, 2014 8:49 AM
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Peter,
map=/path/to/your/projectfile.qgs
This is essential, as otherwise QGIS server doesn't know which project
you are refering to.
As Alex said, this is a vendor-specific parameter. Alternatively to the
map parameter you can use a technique in Apache called URL-rewriting,
decribed in the README of QGIS web client. This rewrites the URL so that
the map parameter gets added.
Andreas
Post by Peter Len
http://localhost:8090/qgis/qgis_mapserv.fcgi.exe?LAYERS=location_view&QUERY_LAYERS=location_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106
http://localhost:8080/geoserver/Postgres/wms?LAYERS=Postgres%3Alocation_view&QUERY_LAYERS=Postgres%3Alocation_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106
You can see that both URLs contain the same parameters and values, except that the call to the GeoServer contains a workspace name with the layer name. Just as a test, I added the workspace name to the QGIS Server URL but that simply failed because it was an incorrect reference. The QGIS Server URL is going to a QGIS project file which contains a layer that comes from my GeoServer. So, in the end, we are talking about the same data set for both URLs, except one is going through QGIS Server as a pass-through to the GeoServer.
So, given that there does not seem to be an issue with the URL or its parameters per se, I would have to believe that there must be some something within the QGIS Server configuration. I understand that QGIS Server is supposed to handle GetFeatureInfo requests so I must be missing something in the QGIS Server configuration, some extra parameter in the URL, or ????
Any new thoughts from the QGIS Server gurus?
Thanks - Peter
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Peter Len
1970-01-01 00:00:00 UTC
Permalink
Forgot to mention one thing..... Even though QGIS Server is not sending back any results from the request, it does send back an HTML response that just contains an empty table, but it does reference that this is a GetFeatureInfo result and has the HTML table lined up to add results if it had any. The response is listed as:


<HEAD>
<TITLE> GetFeatureInfo results </TITLE>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</HEAD>
<BODY>
<TABLE border=1 width=100%>
<TR><TH width=25%>Layer</TH><TD>location_view</TD></TR>
</BR></TABLE>
<BR></BR>
</BODY>

So, it does seem that QGIS Server understands that it got a request for feature info and it created a valid response. For whatever reason, though, it could not find the feature(s) for the BBOX.

-----Original Message-----
From: Andreas Neumann <a.neumann at carto.net>
Sent: Jan 21, 2014 8:49 AM
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Peter,
map=/path/to/your/projectfile.qgs
This is essential, as otherwise QGIS server doesn't know which project
you are refering to.
As Alex said, this is a vendor-specific parameter. Alternatively to the
map parameter you can use a technique in Apache called URL-rewriting,
decribed in the README of QGIS web client. This rewrites the URL so that
the map parameter gets added.
Andreas
Post by Peter Len
http://localhost:8090/qgis/qgis_mapserv.fcgi.exe?LAYERS=location_view&QUERY_LAYERS=location_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106
http://localhost:8080/geoserver/Postgres/wms?LAYERS=Postgres%3Alocation_view&QUERY_LAYERS=Postgres%3Alocation_view&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-215.683594%2C-59.238281%2C215.683594%2C59.238281&FEATURE_COUNT=10&HEIGHT=337&WIDTH=1227&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=650&Y=106
You can see that both URLs contain the same parameters and values, except that the call to the GeoServer contains a workspace name with the layer name. Just as a test, I added the workspace name to the QGIS Server URL but that simply failed because it was an incorrect reference. The QGIS Server URL is going to a QGIS project file which contains a layer that comes from my GeoServer. So, in the end, we are talking about the same data set for both URLs, except one is going through QGIS Server as a pass-through to the GeoServer.
So, given that there does not seem to be an issue with the URL or its parameters per se, I would have to believe that there must be some something within the QGIS Server configuration. I understand that QGIS Server is supposed to handle GetFeatureInfo requests so I must be missing something in the QGIS Server configuration, some extra parameter in the URL, or ????
Any new thoughts from the QGIS Server gurus?
Thanks - Peter
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Peter Len
1970-01-01 00:00:00 UTC
Permalink
An interesting update to this...... So the scenario that has not been working looks something like this:

OpenLayers --> QGIS Server --> QGIS Project File --> GeoServer --> PostGIS

I decided to run a test and create a new project file with the same layer (location_view) but this time create a PostGIS layer rather than a WMS layer going to GeoServer. In this case, the scenario looks like:

OpenLayers --> QGIS Server --> QGIS Project File --> PostGIS

So, given that, it appears that something else might be going on. QGIS Server does seem to be serving up feature information, but not in all scenarios. Not sure what the hiccup is between QGIS Server and GeoServer but I know that URLs from OpenLayers directly to GeoServer for feature info works fine.


-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Alex Mandel
2014-01-21 18:10:32 UTC
Permalink
I didn't realize originally that you are doing a cascaded WMS layer. I
have no idea if QGIS supports cascading 100%, so you may have found a
missing feature.

But if the layer is in your Geoserver, you can send the getfeatureinfo
request directly to Geoserver.

Thanks,
Alex
Post by Peter Len
OpenLayers --> QGIS Server --> QGIS Project File --> GeoServer --> PostGIS
OpenLayers --> QGIS Server --> QGIS Project File --> PostGIS
So, given that, it appears that something else might be going on. QGIS Server does seem to be serving up feature information, but not in all scenarios. Not sure what the hiccup is between QGIS Server and GeoServer but I know that URLs from OpenLayers directly to GeoServer for feature info works fine.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel <tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len <peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Bernhard Ströbl
2014-01-23 08:18:02 UTC
Permalink
Hi Peter,

AFAIK QGIS server does not cascade GetFeaureInfo requests for cascaded
WMS layers - does geoserver do this?
So if you need GetFeatureInfo you have to load the layers directly from
source (PostGIS) into your QGIS project (makes more sense anyway)

Bernhard
OpenLayers --> QGIS Server --> QGIS Project File --> GeoServer --> PostGIS
OpenLayers --> QGIS Server --> QGIS Project File --> PostGIS
So, given that, it appears that something else might be going on. QGIS Server does seem to be serving up feature information, but not in all scenarios. Not sure what the hiccup is between QGIS Server and GeoServer but I know that URLs from OpenLayers directly to GeoServer for feature info works fine.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
__________ Information from ESET Mail Security, version of virus signature database 9317 (20140121) __________
The message was checked by ESET Mail Security.
http://www.eset.com
--
Bernhard Str?bl
Anwendungsbetreuer GIS

Kommunale Immobilien Jena
Am Anger 26
07743 Jena

Tel.: 03641 49- 5190
E-Mail: bernhard.stroebl at jena.de
Internet: www.kij.de


Kommunale Immobilien Jena
Eigenbetrieb der Stadt Jena
Werkleiter: Dr. G?tz Blankenburg


__________ Information from ESET Mail Security, version of virus signature database 9326 (20140122) __________

The message was checked by ESET Mail Security.
http://www.eset.com
Peter Len
1970-01-01 00:00:00 UTC
Permalink
Bernhard - Thanks for the info. I am not sure if GeoServer can handle cascading GetFeatureInfo requests but the typical scenario would not warrant that, meaning the path would be Client(OpenLayers) --> GeoServer --> PostGIS whereas using QGIS Server to display QGIS project files would add that extra layer. So, you are right in that it would seemingly work if the QGIS Desktop layers were layers based on a direct DB connection, but the point of using something like GeoServer is to abstract and consolidate GIS layers into a single location for users to access. Depending on your type of user, they may not know (or have a need for) database connection information. They may not know where shape files or GeoTiffs are located. GeoServer is like ArcCatalog where all types of GIS data (database, files like Shape and GeoTiff, WMS, WFS, etc) can be managed as layers and then clients (like QGIS Desktop or OpenLayers) need only come to GeoServer to get what they need. Unfortunately for us, we can't remove GeoServer from the architecture, so if you are correct about QGIS Server not being able to cascade these requests, we will need to think of some other solution. I will create another mailing list question specifically for this question. Thanks for you insight - Peter


-----Original Message-----
From: Bernhard Str?bl <bernhard.stroebl at jena.de>
Sent: Jan 23, 2014 3:18 AM
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Hi Peter,
AFAIK QGIS server does not cascade GetFeaureInfo requests for cascaded
WMS layers - does geoserver do this?
So if you need GetFeatureInfo you have to load the layers directly from
source (PostGIS) into your QGIS project (makes more sense anyway)
Bernhard
OpenLayers --> QGIS Server --> QGIS Project File --> GeoServer --> PostGIS
OpenLayers --> QGIS Server --> QGIS Project File --> PostGIS
So, given that, it appears that something else might be going on. QGIS Server does seem to be serving up feature information, but not in all scenarios. Not sure what the hiccup is between QGIS Server and GeoServer but I know that URLs from OpenLayers directly to GeoServer for feature info works fine.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
__________ Information from ESET Mail Security, version of virus signature database 9317 (20140121) __________
The message was checked by ESET Mail Security.
http://www.eset.com
--
Bernhard Str?bl
Anwendungsbetreuer GIS
Kommunale Immobilien Jena
Am Anger 26
07743 Jena
Tel.: 03641 49- 5190
E-Mail: bernhard.stroebl at jena.de
Internet: www.kij.de
Kommunale Immobilien Jena
Eigenbetrieb der Stadt Jena
Werkleiter: Dr. G?tz Blankenburg
__________ Information from ESET Mail Security, version of virus signature database 9326 (20140122) __________
The message was checked by ESET Mail Security.
http://www.eset.com
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
Bernhard Ströbl
2014-01-23 13:51:43 UTC
Permalink
Peter,

IMHO it still does not make sense to deliver a cascaded geoserver layer
to a client through QGIS server if both servers are inhouse. It is of
course the right way to use _one_ WMS server; in your case this is
geoserver. You can point any WMS (or WFS?) client to this server, like
QGIS desktop or OpenLayers. IMHO there is no need for QGIS server in
this setting.
Would be a different story though, if geoserver was located outside and
you are using QGIS server to cascade certain of its layers inhouse (thus
QGIS would be your _one_ WMS server).

Bernhard
Bernhard - Thanks for the info. I am not sure if GeoServer can handle cascading GetFeatureInfo requests but the typical scenario would not warrant that, meaning the path would be Client(OpenLayers) --> GeoServer --> PostGIS whereas using QGIS Server to display QGIS project files would add that extra layer. So, you are right in that it would seemingly work if the QGIS Desktop layers were layers based on a direct DB connection, but the point of using something like GeoServer is to abstract and consolidate GIS layers into a single location for users to access. Depending on your type of user, they may not know (or have a need for) database connection information. They may not know where shape files or GeoTiffs are located. GeoServer is like ArcCatalog where all types of GIS data (database, files like Shape and GeoTiff, WMS, WFS, etc) can be managed as layers and then clients (like QGIS Desktop or OpenLayers) need only come to GeoServer to get what they need. Unfortunate
ly for
us, we can't remove GeoServer from the architecture, so if you are correct about QGIS Server not being able to cascade these requests, we will need to think of some other solution. I will create another mailing list question specifically for this question. Thanks for you insight - Peter
-----Original Message-----
From: Bernhard Str?bl<bernhard.stroebl at jena.de>
Sent: Jan 23, 2014 3:18 AM
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Hi Peter,
AFAIK QGIS server does not cascade GetFeaureInfo requests for cascaded
WMS layers - does geoserver do this?
So if you need GetFeatureInfo you have to load the layers directly from
source (PostGIS) into your QGIS project (makes more sense anyway)
Bernhard
OpenLayers --> QGIS Server --> QGIS Project File --> GeoServer --> PostGIS
OpenLayers --> QGIS Server --> QGIS Project File --> PostGIS
So, given that, it appears that something else might be going on. QGIS Server does seem to be serving up feature information, but not in all scenarios. Not sure what the hiccup is between QGIS Server and GeoServer but I know that URLs from OpenLayers directly to GeoServer for feature info works fine.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
__________ Information from ESET Mail Security, version of virus signature database 9317 (20140121) __________
The message was checked by ESET Mail Security.
http://www.eset.com
--
Bernhard Str?bl
Anwendungsbetreuer GIS
Kommunale Immobilien Jena
Am Anger 26
07743 Jena
Tel.: 03641 49- 5190
E-Mail: bernhard.stroebl at jena.de
Internet: www.kij.de
Kommunale Immobilien Jena
Eigenbetrieb der Stadt Jena
Werkleiter: Dr. G?tz Blankenburg
__________ Information from ESET Mail Security, version of virus signature database 9326 (20140122) __________
The message was checked by ESET Mail Security.
http://www.eset.com
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
__________ Information from ESET Mail Security, version of virus signature database 9328 (20140123) __________
The message was checked by ESET Mail Security.
http://www.eset.com
-


__________ Information from ESET Mail Security, version of virus signature database 9328 (20140123) __________

The message was checked by ESET Mail Security.
http://www.eset.com
Peter Len
2014-01-23 14:26:21 UTC
Permalink
Bernhard - Yes, excellent point. There really is no point of having both a GeoServer and QGIS Server as in-house WMS servers. For our QGIS Desktop client, GeoServer is the server we are using, so QGIS Server does not even enter the picture. The reason why QGIS Server is now entering our view scope is that we needed a way to serve up our QGIS Desktop project files (.qgs files) over WMS and QGIS Server apparently does that. We need to do that because we have a .Net application where we need a control that can view the QGIS project files since QGIS does not have a .Net API to essentially create a QGIS .Net control. So, if QGIS Server can serve up the project files using WMS, we can possibly create a .Net control (like a browser control using OpenLayers or DotSpatial) to consume the WMS. Our situation may not be typical but it is what it is for now.

-----Original Message-----
From: Bernhard Str?bl <bernhard.stroebl at jena.de>
Sent: Jan 23, 2014 8:51 AM
To: Peter Len <peteralen at earthlink.net>
Cc: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Peter,
IMHO it still does not make sense to deliver a cascaded geoserver layer
to a client through QGIS server if both servers are inhouse. It is of
course the right way to use _one_ WMS server; in your case this is
geoserver. You can point any WMS (or WFS?) client to this server, like
QGIS desktop or OpenLayers. IMHO there is no need for QGIS server in
this setting.
Would be a different story though, if geoserver was located outside and
you are using QGIS server to cascade certain of its layers inhouse (thus
QGIS would be your _one_ WMS server).
Bernhard
Bernhard - Thanks for the info. I am not sure if GeoServer can handle cascading GetFeatureInfo requests but the typical scenario would not warrant that, meaning the path would be Client(OpenLayers) --> GeoServer --> PostGIS whereas using QGIS Server to display QGIS project files would add that extra layer. So, you are right in that it would seemingly work if the QGIS Desktop layers were layers based on a direct DB connection, but the point of using something like GeoServer is to abstract and consolidate GIS layers into a single location for users to access. Depending on your type of user, they may not know (or have a need for) database connection information. They may not know where shape files or GeoTiffs are located. GeoServer is like ArcCatalog where all types of GIS data (database, files like Shape and GeoTiff, WMS, WFS, etc) can be managed as layers and then clients (like QGIS Desktop or OpenLayers) need only come to GeoServer to get what they need. Unfortunate
ly for
us, we can't remove GeoServer from the architecture, so if you are correct about QGIS Server not being able to cascade these requests, we will need to think of some other solution. I will create another mailing list question specifically for this question. Thanks for you insight - Peter
-----Original Message-----
From: Bernhard Str?bl<bernhard.stroebl at jena.de>
Sent: Jan 23, 2014 3:18 AM
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Hi Peter,
AFAIK QGIS server does not cascade GetFeaureInfo requests for cascaded
WMS layers - does geoserver do this?
So if you need GetFeatureInfo you have to load the layers directly from
source (PostGIS) into your QGIS project (makes more sense anyway)
Bernhard
OpenLayers --> QGIS Server --> QGIS Project File --> GeoServer --> PostGIS
OpenLayers --> QGIS Server --> QGIS Project File --> PostGIS
So, given that, it appears that something else might be going on. QGIS Server does seem to be serving up feature information, but not in all scenarios. Not sure what the hiccup is between QGIS Server and GeoServer but I know that URLs from OpenLayers directly to GeoServer for feature info works fine.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 7:49 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
The method I use to troubleshoot these kinds of things involves using
the Firebug extension in Firefox. Where you can see what the WMS request
being sent looks like (NET tab), copy and paste it, manipulate it by
hand until it works and then figure out how to make Openlayers send it
that way.
Thanks,
Alex
Post by Peter Len
Alex - Thanks for the reply. Initially, I was trying to run this test using a project file where I used the "map" parameter in the layer definition. This got the layers to display within OpenLayers but the GetFeatureInfo request was not working. I then went back to having the project file in the QGIS Server's bin directory so that no file name has to be listed. That is the setup I was using in the examples I provided. I went back and ran another test when using a file at some path and used your "vendorParams" example, but the outcome is the same.
-----Original Message-----
From: Alex Mandel<tech_dev at wildintellect.com>
Sent: Jan 20, 2014 3:34 PM
To: Peter Len<peteralen at earthlink.net>, qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server a GetFeatureInfo request problems. Not sure what I am missing.
Post by Peter Len
var url = "http://localhost:8090/qgis/qgis_mapserv.fcgi.exe";
var layer = new OpenLayers.Layer.WMS( "Main Layer", url, {
layers: 'table_poly,location_view',
format: 'image/png',
},
{
buffer: 1,
isBaseLayer: true,
graphicZIndex: 0,
}
);
map.addLayers([layer]);
var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: url,
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
alert("Got feature info");
}
}
});
map.addControl(info);
info.activate();
WMS GetFeatureInfo in OpenLayers does in fact work with QGIS Server with
one trick, vendorParams you need to specify the qgs file to reference.
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://yoursite.com/cgi-bin/qgis_mapserv.fcgi",
title: 'Identify features by clicking',
layers: [yourlayer],
queryVisible: true,
vendorParams:{map:"/path/to/map/project.qgs"}
}),
Thanks,
Alex
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
__________ Information from ESET Mail Security, version of virus signature database 9317 (20140121) __________
The message was checked by ESET Mail Security.
http://www.eset.com
--
Bernhard Str?bl
Anwendungsbetreuer GIS
Kommunale Immobilien Jena
Am Anger 26
07743 Jena
Tel.: 03641 49- 5190
E-Mail: bernhard.stroebl at jena.de
Internet: www.kij.de
Kommunale Immobilien Jena
Eigenbetrieb der Stadt Jena
Werkleiter: Dr. G?tz Blankenburg
__________ Information from ESET Mail Security, version of virus signature database 9326 (20140122) __________
The message was checked by ESET Mail Security.
http://www.eset.com
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
__________ Information from ESET Mail Security, version of virus signature database 9328 (20140123) __________
The message was checked by ESET Mail Security.
http://www.eset.com
-
__________ Information from ESET Mail Security, version of virus signature database 9328 (20140123) __________
The message was checked by ESET Mail Security.
http://www.eset.com
Continue reading on narkive:
Loading...