[OpenLayers-Users] Multiple points at same location

Mario Andino mario_andino at yahoo.es
Wed Sep 14 13:29:10 EDT 2011


I want to do the opposite, I am using GetFeatureInfo request on GeoServer an my params are:

capas= [1layer,2layers] 
 params = {
                        REQUEST: "GetFeatureInfo",
                        EXCEPTIONS: "application/vnd.ogc.se_xml",
                        BBOX: bbox,
                        X: e.xy.x,
                        Y: e.xy.y,
                        INFO_FORMAT: 'text/html',
                        QUERY_LAYERS: capas,
                        FEATURE_COUNT: 1,
                        Layers:capas,
                        Styles: '',
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h,
                        queryVisible: true,
                     
                        format: 'image/png'};
.....

then the user add or remove one of the 2 layers

map.removeLayer(1Layer);
map.addLayer(2Layer); 

but when I click the feature (both are points features) the response are two even if I 
removeLayer(2layer)


________________________________
De: Andrea Aime <andrea.aime at geo-solutions.it>
Para: "Tito, Joseph" <Joseph.Tito at cobham.com>
CC: openlayers-users at lists.osgeo.org; geoserver-users at lists.sourceforge.net
Enviado: Miércoles, septiembre 14, 2011 11:10 A.M.
Asunto: Re: [OpenLayers-Users] Multiple points at same location


On Wed, Sep 14, 2011 at 6:47 PM, Tito, Joseph <Joseph.Tito at cobham.com> wrote:

I’m running into an issue with GeoServer when I have multiple points that are at the same location. 
> 
>I plotted 2 points at the exact same Lon/Lat. When a user clicks on a feature, I do a getFeatureInfo request, but GeoServer is only returning information on 1 of the 2 features at that location.
> 
>Is there any way to tell GeoServer to get information on multiple points that are at the same location?

By WMS spec, if not otherwise specified, you get back only the first result.
You can get more result if you ask for more than one adding &FEATURE_COUNT=nn, for example:

http://demo1.geo-solutions.it/playground/GeoSolutions/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-32.60931%2C22.486191%2C69.31031%2C74.309727&SERVICE=WMS&VERSION=1.1.1&X=375&Y=174&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=GeoSolutions%3Acities&Layers=GeoSolutions%3Acities&WIDTH=649&HEIGHT=330&format=image%2Fpng&styles=&srs=EPSG%3A4326&FEATURE_COUNT=50

Cheers
Andrea
-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110914/fa4c9407/attachment-0001.html


More information about the Users mailing list