Tag Info

Hot answers tagged

16

Update The 'hack' given below is necessary only for Geoserver versions 2.2.x and below. With version 2.3.0 and upwards, Geoserver can return JSON for WMS GetFeatureInfo request natively. End of Update There is an open feature request for this on geoserver's bug tracker. Using custom GetFeatureInfo Templates, it is possible to generate a Json response ...


9

The WMSGetFeatureInfo doesn't work by requesting info on the feature being currently clicked as such. It works by formulating a WMS GetFeatureInfo request which passes a BBOX string to the WMS server. So, when you click on the map the location coordinates are captured and then sent to a WMS server as the request. You could see this in action by using ...


4

This is an interesting question, and I wanted to investigate the issue. Firstly, with some brief experimentation, I saw that Geoserver does not return any data from the non-rendered region when you use the GetFeatureInfo request on the WMS service. To see if this is expected behavior, I checked the documentation for the GetFeatureInfo request. You can ...


4

Doesn't look good (source): ... GetFeatureInfo [...] is a WMS request and WFS. [...] One difference in their behaviour is that Geoserver sends always all the attributes with GetFeatureInfo but with WFS the list of attributes can be given in the request. You could create a view that contains only the attributes your user wants to/should see and serve ...


4

As stated above, you add an extra ;-separated CQL query for each layer. 1st query aligns to the 1st layer, 2nd to 2nd, etc. So, even if you want the same query on each layer, it'd be something like: https://server.com/geoserver/site/wms?service=WMS&version=1.1.0&request=GetMap ...


3

In that example you'll see some code like: infoControls = { click: new OpenLayers.Control.WMSGetFeatureInfo({ url: 'http://demo.opengeo.org/geoserver/wms', title: 'Identify features by clicking', layers: [water], queryVisible: true }), hover: new ...


3

can you try adding proxyhost for getting information? i am not sure proxy host will solve this problem, but it is useful to try and dont forget adding defination of variables, sometimes they really being big problem... var info; and proxyhost: OpenLayers.ProxyHost = "proxy.cgi?url="; some information about proxyhost you can read this. i hope it helps ...


3

I got maps like yours working and the only difference that I could spot is that I use OpenLayers.Layer.WMS instead of OpenLayers.Layer.MapServer. Since GetFeatureInfo is a WMS protocol operation OL correctly should not apply it to Mapserver layers (even though Mapserver is fully capable of speaking WMS). Try to create the layer as follows: var wmsmap = new ...


2

The WMS spec does not provide any direction on how a server should implement the GetFeatureInfo response. In some systems the "pixel tolerance" is a function of the client (web browser or desktop client) - a clicked point can be buffered and the resulting polygon is sent as the query geometry. However, GetFeatureInfo only accepts a point input so that's ...


2

So mostly for future readers of this question - when you are doing getFeatureInfo requests to a different server (which includes a difference in the port number) you need a proxy - see http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost for more discussion.


2

You need to provide one filter for each layer (or a blank filter) each filter is separated by a ; - see ...


2

I am looking at this also. My problem is different since I am not sure how to address the correct layer. I found this: http://www.azavea.com/blogs/labs/2011/06/using-the-cql_filter-parameter-with-openlayers-wms-layers/ But I think I understand your problem. You would have to make a function that grabs the search term (or static search) and sends the call ...


2

Option #1: Use a click Handler (EXAMPLE). and Inside click trigger build the infoWindow like so: ... trigger: function(e) { var feature = geojson_layer.getFeatureById(e.target._featureId); //<--feature being clicked on. map.addPopup(new OpenLayers.Popup.FramedCloud( "chicken", map.getLonLatFromPixel(e.xy), null, ...


2

If I have understood your question, you have created the HEADER and the FOOTER files, but not the TEMPLATE one. The latter file is mandatory, and in your scenario it 'generates' the contents of HTML's body. Besides, inside the LAYER object of your mapfile there should also be a reference to the template file, given via TEMPLATE. For point based queries, it ...


2

If you are using apache as the web server, you can use a proxy file called proxy.cgi to get round the problem of cross-origin javascript security. The following is taken from OpenLayers FAQs about the ProxyHost setting Why do I need a ProxyHost? Due to security restrictions in Javascript, it is not possible to retrieve information from remote ...


2

This capability now exists in GeoServer 2.2.4. Here's how to request JSON output: http://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo


2

You cannot get information for features within a bbox using a WMS getFeatureInfo. Please have a look at the WMS reference for getFeatureInfo. You will see that according to the standards, you can only pass in points, not a bbox. Instead, you could use a getFeature Operation on the WFS service. The BBOX parameter allows you to search for features ...


2

You can use request metod of WMSGetFeatureInfo control. Open this example and type in console: map.controls[4].request(new OpenLayers.Pixel(296,148)).


1

Assuming it's essential to use the same layer name; then one way that comes to mind is to use two geoservers, one which has a layer group (http://docs.geoserver.org/stable/en/user/webadmin/data/layergroups.html) combining the hillshaded DTM + heights that serves your WMS (e.g. http://example.com/geoserver/wms, with the 2nd Geoserver serving up a feature of ...


1

For those who are still interested in the answer. I've calculated the pixel coordinates with the following formula: int zoom = (int) mMap.getCameraPosition().zoom; double sinLatitude = Math.sin(ltln.latitude * Math.PI / 180); int pixelX = (int) (((ltln.longitude + 180) / 360) * 256 * (Math.pow(2,zoom))); int pixelY = (int) ((0.5 - Math.log((1 ...


1

You need to set the infoFormat property of OpenLayers.Control.WMSGetFeatureInfo to something that OpenLayers can parse in order to create features. When no infoFormat property is set a default mime type of text/html is used, this is why event.text contains the HTML markup of a table. Along with setting infoFormat you also need to set the format property ...


1

By extracting parameters while debugging your website, I found the following: The X and Y position is somewhat wrong. The screenshot shows the info box where I clicked, and the red dot shows the actual X and Y position that is submitted in GetFeatureInfo. So it apparently looks like I clicked in the 010B polygon, but the submitted X and Y is actually ...


1

There is a new functionality in QGIS Desktop > 1.8 (you need to download the master). You can add a HTML map tip or just choose one of the field to display. I also installed the nightly build of QGIS Server on my ubuntu server and I set "useGetProjectSettings" to true in GlobalOption.js in QGIS Web Client. I now can see the value of a chosen field in QGIS ...


1

This works: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <meta name="apple-mobile-web-app-capable" content="yes"> ...


1

According to the documentation: GetFeatureInfo cascading for servers that do support the application/vnd.ogc.gml feature info format. Works in both standard and reprojected case. It seems that your server does provide that format but I haven't actually tested that it does. You may need to make sure that your request is also in that format? So the ...


1

The default format of the WMSGetFeatureInfo plugin is html, which leverages server side templates for the output. If you want the grid format, you have to configure the plugin with the 'format' option set to 'grid': { ptype: 'gxp_wmsgetfeatureinfo', format: 'grid' } See ...


1

It seems that you forgot to add eventListeners propperty to your WMSGetFeatureInfo control. Working code should looks like: control: new OpenLayers.Control.WMSGetFeatureInfo({ url: "http://128.196.142.12:8080/geoserver/opengeo/wms", eventListeners: { 'getfeatureinfo': function(evt) { var lonLat = evt.xy; ...


1

The easiest way would be to use a WFS - try something like http://ian01.geog.psu.edu/geoserver/www/wfs/wfs-sld2.html and then instead of updating the div make a query. Also you can create a WFS query that takes your box or polygon and carries out one query to return all the features that are contained or that intersect with the object. One way to get a ...


1

I think your problem is due you not set a proxy in OpenLayers. The request to get feature info is made using AJAX (OpenLayers.Request.GET). If your server is not configured to accept cross domain request then you need to use an script (the proxy) to make the request. Using a proxy script the flow is as follows: You load your web page from your server. ...


1

Using the Openlayers API you can use GetFeatureInfo from a WMS service But Google Maps API (v3) you cannot add a WMS service - only KML is supported Example http://www.gisdoctor.com/v3/openlayers_wms.html



Only top voted, non community-wiki answers of a minimum length are eligible