WMS and getFeatureInfo problem

Stefan Schwarzer stefan.schwarzer at GRID.UNEP.CH
Tue Feb 20 22:28:26 PST 2007


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:

> Hi,
>
> first of all, querylayers should be query_layers.
>
> text/html is not supported by default, I believe you need to do some
> templating for that. Check the following document and search for  
> text/html:
>
> http://mapserver.gis.umn.edu/docs/howto/wms_server
>
> text/plain works using this request:
> http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/ 
> htdocs/mod_map/ 
> geo_wms.map&service=wms&version=1.1.1&request=getfeatureinfo&layers=gd 
> p_capita,int_boundary_lines,continent_outlines&query_layers=gdp_capita 
> &x=10&y=50&info_format=text/plain&bbox=-180,-90,180,90
>
> Hope this helps.
>
> 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: [UMN_MAPSERVER-USERS] WMS and getFeatureInfo problem
> Datum: 20/02/07 12:57
>
>> Hi there,gush, the last hours I spent with searching my way  
>> through pdfs,
> email archives and how-tos... But somehow in vain....Why does my
> getfeatureinfo not work? Probably just a tiny thing - as usual. But  
> it's
> getting somewhat frustrating.Thanks for any
> hints!StefGetFeatureInfo:http://gridca.grid.unep.ch/cgi-bin/mapserv? 
> map=/www/geodataportal/htdocs/mod_map/ 
> geo_wms.map&service=wms&version=1.1.1&request=getfeaturein 
> fo&layers=gdp_capita,int_boundary_lines,continent_outlines&que 
> rylayers=gdp_capita&x=10&y=50&info_format=text/ 
> html&bbox=-180,-90,180,90
> GetMap:http://gridca..grid.unep.ch/cgi-bin/mapserv?map=/www/ 
> geodataportal/htdocs/mod_map/ 
> geo_wms.map&service=wms&version=1.1.1&request=getmap&l 
> ayers=gdp_capita,int_boundary_lines,continent_outlinesGetCapabilities: 
> http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/ 
> htdocs/mod_map/ 
> geo_wms.map&service=wms&version=1.1.1&request=getcapabilit 
> ies	#
> Map definition ---------------------		NAME geo_wms.map	STATUS ON	 
> SIZE 600
> 300	EXTENT -180 -90 180 90	UNITS DD	IMAGECOLOR 255 255 255	 
> SHAPEPATH 'xxx'
> 	FONTSET 'xxx' 	SYMBOLSET 'xxx' 	# End Map definition
> ---------------------	# Projection definition
> ---------------------	PROJECTION	'init=epsg:4326'	END	# End Projection
> definition ---------------------			# Web definition
> ---------------------		WEB		IMAGEPATH 'xx'		IMAGEURL 'xx'		METADATA		
> 'wms_title'                          'GEO Data Portal WMS Server'		
> 'wms_onlineresource'      'http://geodata.grid.unep.ch'		    'wms_srs'
>         		 'EPSG:4326'	            "wms_getfeatureinfo"
> "http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/ 
> htdocs/mod_map/geo_wms.map&"
>        	    "wms_featureinfoformat" "text/plain"	        END	END		#  
> End Web
> definition ---------------------	          # Layers definition
> ---------------------    LAYER        NAME gdp_capita        STATUS  
> OFF
>   CONNECTIONTYPE postgis        CONNECTION 'user=xx password=xx  
> dbname=xx'
> 			        TYPE POLYGON        DATA 'xxx'         TEMPLATE 'dummy'
> DUMP TRUE        CLASSITEM 'y_2004'        CLASS            NAME ''
>   EXPRESSION ([y_2004]=-10001)            TEMPLATE 'empty  
> space'        END
> # CLASS         CLASS            NAME 'Units: Constant 2000 US$ per  
> Person'
>           EXPRESSION ([y_2004]=-110003)            TEMPLATE 'units  
> as title
> in legend'        END  # CLASS 				        CLASS            NAME  
> 'no data'
>          EXPRESSION ([y_2004]=-9999)            COLOR 230 230 230
> TEMPLATE 'dummy'        END  # CLASS        CLASS             NAME  
> '88 to
> 9634'            EXPRESSION ([y_2004]<=9634)            COLOR  
> 255 255 178
>            TEMPLATE 'dummy'            LABEL                FONT arial
>          TYPE truetype                ANTIALIAS  
> false                SIZE 8
>               COLOR 0 0 0                POSITION AUTO
> PARTIALS FALSE                FORCE true                OFFSET 0 5
>      #OUTLINECOLOR 0 0 0            END        END  # CLASS         
> CLASS
>         NAME '9634 to 19180'            EXPRESSION ([y_2004] 
> <=19180)
>       COLOR 254 204 92            TEMPLATE 'dummy'            LABEL
>       FONT arial                TYPE truetype                 
> ANTIALIAS false
>                SIZE 8                COLOR 0 0 0                 
> POSITION
> AUTO                PARTIALS FALSE                FORCE true
> OFFSET 0 5                #OUTLINECOLOR 0 0 0            END         
> END  #
> CLASS        CLASS             NAME '19180 to 28725'             
> EXPRESSION
> ([y_2004]<=28725)            COLOR 253 141 60             
> TEMPLATE 'dummy'
>            LABEL                FONT arial                TYPE  
> truetype
>           ANTIALIAS false                SIZE 8                 
> COLOR 0 0 0
>              POSITION AUTO                PARTIALS FALSE
> FORCE true                OFFSET 0 5                #OUTLINECOLOR 0  
> 0 0
>       END        END  # CLASS        CLASS             NAME '28725  
> to 38271'
>            EXPRESSION ([y_2004]<=38271)            COLOR 240 59 32
>     TEMPLATE 'dummy'            LABEL                FONT arial
>   TYPE truetype                ANTIALIAS false                SIZE 8
>        COLOR 0 0 0                POSITION AUTO                 
> PARTIALS
> FALSE                FORCE true                OFFSET 0 5
> #OUTLINECOLOR 0 0 0            END        END  # CLASS        CLASS
>    NAME '38271 to 47817'            EXPRESSION ([y_2004]>38271)
>  COLOR 189 0 38            TEMPLATE 'dummy'            LABEL
> FONT arial                TYPE truetype                ANTIALIAS false
>          SIZE 8                COLOR 0 0 0                POSITION  
> AUTO
>           PARTIALS FALSE                FORCE true                 
> OFFSET 0 5
>                #OUTLINECOLOR 0 0 0            END        END  # CLASS
> METADATA            'wms_title'   'Gross Domestic Product - per  
> Capita'
>   END # METADATA        PROJECTION            'init=epsg: 
> 4326'        END
> END  # LAYER ... other layers ....END # Map File	



More information about the MapServer-users mailing list