WMS and getFeatureInfo problem

Bart van den Eijnden (OSGIS) bartvde at OSGIS.NL
Wed Feb 21 03:04:45 EST 2007


Hi Stefan,

the OGC spec defines that GetFeatureInfo copies a lot of the parameters from
the GetMap request (so also LAYERS).

Mainly so that it can determine which point is clicked on. For that it
mainly needs BBOX and WIDTH and HEIGHT, next to the for GetFeatureInfo
specific parameters like X and Y, the point clicked at in pixels, and also
QUERY_LAYERS ofcourse.

LAYERS isn't really that much useful to GetFeatureInfo processing, but I
think OGC decided it was easier to just copy all of the GetMap parameters
then explicitly name the ones which should be copied.

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Stefan Schwarzer <stefan.schwarzer at GRID.UNEP.CH>
Naar: MAPSERVER-USERS at LISTS.UMN.EDU <MAPSERVER-USERS at LISTS.UMN.EDU>
Onderwerp: Re: [UMN_MAPSERVER-USERS] WMS and getFeatureInfo problem
Datum: 21/02/07 04:30

> Thanks guys... query_layers instead of querylayers... I knew it would  
> be something stupid...
> 
> And then text/plain... ok. Thanks for that.
> 
> Just a question for clarification: At the beginning I thought the  
> getfeatureinfo would only show the results of its search. Then I saw  
> that one had to specify as well the layers. So I thought, cool, the  
> getfeatureinfo draws then first the map and then shows the results.  
> Not bad! But now I see that it indeed really only displays a couple  
> of lines. What sense does it make to indicate the layers command?
> 
> Stef
> 
> On Feb 20, 2007, at 4:00 PM, Bart van den Eijnden (OSGIS) wrote:
> 
> &gt; Hi,
> &gt;
> &gt; first of all, querylayers should be query_layers.
> &gt;
> &gt; text/html is not supported by default, I believe you need to do some
> &gt; templating for that. Check the following document and search for  
> &gt; text/html:
> &gt;
> &gt; http://mapserver.gis.umn.edu/docs/howto/wms_server
> &gt;
> &gt; text/plain works using this request:
> &gt; http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/ 
> &gt; htdocs/mod_map/ 
> &gt;
geo_wms.map&amp;service=wms&amp;version=1.1.1&amp;request=getfeatureinfo&amp;layers=gd

> &gt;
p_capita,int_boundary_lines,continent_outlines&amp;query_layers=gdp_capita 
> &gt;
&amp;x=10&amp;y=50&amp;info_format=text/plain&amp;bbox=-180,-90,180,90
> &gt;
> &gt; Hope this helps.
> &gt;
> &gt; Best regards,
> &gt; Bart
> &gt;
> &gt; --
> &gt; Bart van den Eijnden
> &gt; OSGIS, Open Source GIS
> &gt; http://www.osgis.nl
> &gt;
> &gt;
> &gt; --------- Oorspronkelijk bericht --------
> &gt; Van: Stefan Schwarzer &lt;stefan.schwarzer at GRID.UNEP.CH&gt;
> &gt; Naar: MAPSERVER-USERS at LISTS.UMN.EDU
&lt;MAPSERVER-USERS at LISTS.UMN.EDU&gt;
> &gt; Onderwerp: [UMN_MAPSERVER-USERS] WMS and getFeatureInfo problem
> &gt; Datum: 20/02/07 12:57
> &gt;
> &gt;&gt; Hi there,gush, the last hours I spent with searching my way  
> &gt;&gt; through pdfs,
> &gt; email archives and how-tos... But somehow in vain....Why does my
> &gt; getfeatureinfo not work? Probably just a tiny thing - as usual. But  
> &gt; it's
> &gt; getting somewhat frustrating.Thanks for any
> &gt; hints!StefGetFeatureInfo:http://gridca.grid.unep.ch/cgi-bin/mapserv? 
> &gt; map=/www/geodataportal/htdocs/mod_map/ 
> &gt;
geo_wms.map&amp;amp;service=wms&amp;amp;version=1.1.1&amp;amp;request=getfeaturein

> &gt;
fo&amp;amp;layers=gdp_capita,int_boundary_lines,continent_outlines&amp;amp;que

> &gt;
rylayers=gdp_capita&amp;amp;x=10&amp;amp;y=50&amp;amp;info_format=text/ 
> &gt; html&amp;amp;bbox=-180,-90,180,90
> &gt; GetMap:http://gridca..grid.unep.ch/cgi-bin/mapserv?map=/www/ 
> &gt; geodataportal/htdocs/mod_map/ 
> &gt;
geo_wms.map&amp;amp;service=wms&amp;amp;version=1.1.1&amp;amp;request=getmap&amp;amp;l

> &gt;
ayers=gdp_capita,int_boundary_lines,continent_outlinesGetCapabilities: 
> &gt; http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/ 
> &gt; htdocs/mod_map/ 
> &gt;
geo_wms.map&amp;amp;service=wms&amp;amp;version=1.1.1&amp;amp;request=getcapabilit

> &gt; ies	#
> &gt; Map definition ---------------------		NAME geo_wms.map	STATUS ON	 
> &gt; SIZE 600
> &gt; 300	EXTENT -180 -90 180 90	UNITS DD	IMAGECOLOR 255 255 255	 
> &gt; SHAPEPATH 'xxx'
> &gt; 	FONTSET 'xxx' 	SYMBOLSET 'xxx' 	# End Map definition
> &gt; ---------------------	# Projection definition
> &gt; ---------------------	PROJECTION	'init=epsg:4326'	END	# End
Projection
> &gt; definition ---------------------			# Web definition
> &gt; ---------------------		WEB		IMAGEPATH 'xx'		IMAGEURL 'xx'		METADATA		
> &gt; 'wms_title'                          'GEO Data Portal WMS Server'		
> &gt; 'wms_onlineresource'      'http://geodata.grid.unep.ch'		   
'wms_srs'
> &gt;         		 'EPSG:4326'	            &quot;wms_getfeatureinfo&quot;
> &gt;
&quot;http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/ 
> &gt; htdocs/mod_map/geo_wms.map&amp;amp;&quot;
> &gt;        	    &quot;wms_featureinfoformat&quot; &quot;text/plain&quot;	
       END	END		#  
> &gt; End Web
> &gt; definition ---------------------	          # Layers definition
> &gt; ---------------------    LAYER        NAME gdp_capita        STATUS  
> &gt; OFF
> &gt;   CONNECTIONTYPE postgis        CONNECTION 'user=xx password=xx  
> &gt; dbname=xx'
> &gt; 			        TYPE POLYGON        DATA 'xxx'         TEMPLATE 'dummy'
> &gt; DUMP TRUE        CLASSITEM 'y_2004'        CLASS            NAME ''
> &gt;   EXPRESSION ([y_2004]=-10001)            TEMPLATE 'empty  
> &gt; space'        END
> &gt; # CLASS         CLASS            NAME 'Units: Constant 2000 US$ per  
> &gt; Person'
> &gt;           EXPRESSION ([y_2004]=-110003)            TEMPLATE 'units  
> &gt; as title
> &gt; in legend'        END  # CLASS 				        CLASS            NAME  
> &gt; 'no data'
> &gt;          EXPRESSION ([y_2004]=-9999)            COLOR 230 230 230
> &gt; TEMPLATE 'dummy'        END  # CLASS        CLASS             NAME  
> &gt; '88 to
> &gt; 9634'            EXPRESSION ([y_2004]&amp;lt;=9634)            COLOR 

> &gt; 255 255 178
> &gt;            TEMPLATE 'dummy'            LABEL                FONT
arial
> &gt;          TYPE truetype                ANTIALIAS  
> &gt; false                SIZE 8
> &gt;               COLOR 0 0 0                POSITION AUTO
> &gt; PARTIALS FALSE                FORCE true                OFFSET 0 5
> &gt;      #OUTLINECOLOR 0 0 0            END        END  # CLASS         
> &gt; CLASS
> &gt;         NAME '9634 to 19180'            EXPRESSION ([y_2004] 
> &gt; &amp;lt;=19180)
> &gt;       COLOR 254 204 92            TEMPLATE 'dummy'            LABEL
> &gt;       FONT arial                TYPE truetype                 
> &gt; ANTIALIAS false
> &gt;                SIZE 8                COLOR 0 0 0                 
> &gt; POSITION
> &gt; AUTO                PARTIALS FALSE                FORCE true
> &gt; OFFSET 0 5                #OUTLINECOLOR 0 0 0            END         
> &gt; END  #
> &gt; CLASS        CLASS             NAME '19180 to 28725'             
> &gt; EXPRESSION
> &gt; ([y_2004]&amp;lt;=28725)            COLOR 253 141 60             
> &gt; TEMPLATE 'dummy'
> &gt;            LABEL                FONT arial                TYPE  
> &gt; truetype
> &gt;           ANTIALIAS false                SIZE 8                 
> &gt; COLOR 0 0 0
> &gt;              POSITION AUTO                PARTIALS FALSE
> &gt; FORCE true                OFFSET 0 5                #OUTLINECOLOR 0  
> &gt; 0 0
> &gt;       END        END  # CLASS        CLASS             NAME '28725  
> &gt; to 38271'
> &gt;            EXPRESSION ([y_2004]&amp;lt;=38271)            COLOR 240
59 32
> &gt;     TEMPLATE 'dummy'            LABEL                FONT arial
> &gt;   TYPE truetype                ANTIALIAS false                SIZE 8
> &gt;        COLOR 0 0 0                POSITION AUTO                 
> &gt; PARTIALS
> &gt; FALSE                FORCE true                OFFSET 0 5
> &gt; #OUTLINECOLOR 0 0 0            END        END  # CLASS        CLASS
> &gt;    NAME '38271 to 47817'            EXPRESSION
([y_2004]&amp;gt;38271)
> &gt;  COLOR 189 0 38            TEMPLATE 'dummy'            LABEL
> &gt; FONT arial                TYPE truetype                ANTIALIAS
false
> &gt;          SIZE 8                COLOR 0 0 0                POSITION  
> &gt; AUTO
> &gt;           PARTIALS FALSE                FORCE true                 
> &gt; OFFSET 0 5
> &gt;                #OUTLINECOLOR 0 0 0            END        END  # CLASS
> &gt; METADATA            'wms_title'   'Gross Domestic Product - per  
> &gt; Capita'
> &gt;   END # METADATA        PROJECTION            'init=epsg: 
> &gt; 4326'        END
> &gt; END  # LAYER ... other layers ....END # Map File	
> 
> 



More information about the mapserver-users mailing list