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 ...


7

Just don't include the fields you don't want in your freemarker template. See http://docs.geoserver.org/trunk/en/user/tutorials/GetFeatureInfo/index.html#custom-templates


5

This example should show you exactly what you need. http://openlayers.org/dev/examples/select-feature-multilayer.html


5

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 ...


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

You can only use a x,y (i,j) coordinate search for GetFeatureInfo requests http://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo However, you may test for interactions with polygons (and many other geometries) using a Web Feature Service (WFS) request. E.g. ...


3

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 ...


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

GetFeatureInfo by default (per WMS standard) just returns one result, if you want more add FEATURE_COUNT to your request, e.g.: FEATURE_COUNT: 50


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 ...


3

You can do this using the GeoServer propertyName WMS request parameter: http://docs.geoserver.org/stable/en/user/services/wms/vendor.html#propertyname


3

You can use GetFeatureInfo without proxy, when both your OpenLayers application and GeoServer live in same domain and same port. If they are in different location, you need proxy. Simple as that.


3

It sounds like your workflow would function better with a seamless grid of polygons instead of points. That way there would be no empty space when a user clicked on the map. Maybe try creating a vector grid and joining you point attributes to it?


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

did you pass the CQL filter to the WMS GetFeatureInfo request too? If not then any record in the whole dataset at that location will be returned.


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 can use request metod of WMSGetFeatureInfo control. Open this example and type in console: map.controls[4].request(new OpenLayers.Pixel(296,148)).


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 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

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

It is up to the WMS server admin which formats the server is configured to support for GetFeatureInfo. Check from the GetCapabilities of the WMS server the list of supported INFO_FORMATs. Geoservers by default support geojson and GML info formats and those include also geometries with GetFeatureInfo results. You can try with the following links: ...


2

Well, you can try CQL-filters for attribute-based queries on WMS. Look this thread for how to filter features of a wms. Afterwards you may select features from your WFS obtained from this WMS. BTW.: the GetFeature-control is designed for selecting features by mouse rather then by any query. To select a feature you may use the SelectFeature-control. Loop the ...


1

fixed it already! I added this to my code (the stuff in bold): ...event) {deletePopup(); if (event.text.indexOf("") != -1) { popup = new OpenLayers... (And an extra } after map.addPopup(popup); obviously.


1

In your entire code is used map.getLocalXY instead of map.getLonLatFromPixel, this would cause an error and would not show the popup. (Note: you adds two OpenLayers.Control.LayerSwitcher to the map)



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