[mapserver-users] WMS layer - GetFeatureInfo request, multiple row (attributes) return

Ted Spradley tspradley at snoogems.com
Mon Jan 11 18:02:06 EST 2010


Ah, also when I add the file 'dummy.html' with the magic string, the return
is a blank page.

Thanks again, 
Ted S


Ted Spradley wrote:
> 
> Hi all,
> 
> I am querying a WMS layer (several, but the question is regarding layer
> 'building_comp_query') using
> OpenLayers with a GetFeatureInfo request.  The data returned from all
> layers but 'building_comp_query'
> is as expected.  The layers returning data as expected return a single row
> of attributes related to the
> user selected feature (a property parcel).  Layer 'building_comp_query' is
> a PostGIS layer of TYPE QUERY whose SQL SELECT returns multiple rows, but
> when queried by the GetFeatureInfo request below, a single
> row is returned.  I understand the default FEATURE_COUNT is 1, and when
> set higher, multiple rows of the
> same data is returned.
> 
> I am thinking the solution is to use the new style templating and an
> OUTPUTFORMAT for the layer, and
> TEMPLATE 'dummy' but if that is correct, where does the OUTPUTFORMAT get
> referenced in a GetFeatureInfo request?
> 
> When I try my proposed solution I get the following:
> 
> Content-type: application/vnd.ogc.se_xml msReturnPage(): Unable to access
> file. dummy.html 
> 
> Thanks in advance,
> Ted S.
> 
> /*  OpenLayers GetFeatureInfo request */
> 
>         var url =  tl_us_county_48201.getFullRequestString({
>           REQUEST: "GetFeatureInfo",
>           EXCEPTIONS: "application/vnd.ogc.se_xml",
>           BBOX: tl_us_county_48201.map.getExtent().toBBOX(),
>           X: e.xy.x,
>           Y: e.xy.y,
>           INFO_FORMAT: 'text/html',
>           QUERY_LAYERS:
> 'countries,usa_zcta5,parcels_query,tx_school_districts,schools,places,building_comp_query',
>           WIDTH: tl_us_county_48201.map.size.w,
>           HEIGHT: tl_us_county_48201.map.size.h
>         });
> 
> /* layer definition */
> 
>   LAYER
>     NAME 'building_comp_query'
>     TYPE  QUERY
>     STATUS          ON
>     #DEBUG			3
>     TEMPLATE  bldgCompGetFeatureInfo.html
>     HEADER    bldgCompGetFeatureInfo_header.html
>     FOOTER    bldgCompGetFeatureInfo_footer.html
>     PROCESSING "CLOSE_CONNECTION=DEFER" 
>     PROCESSING 'LABEL_NO_CLIP=1'
> 
>     DUMP TRUE
>     MAXSCALEDENOM 10000
>     CONNECTIONTYPE POSTGIS
>     CONNECTION "dbname=cad1 user=tedkspradley password=05gusher
> host=localhost port=5432"
> 
>     DATA  "the_geom from (select b.the_geom AS the_geom, b.gid AS gid,
> a.building_num AS building_num, a.building_component AS
> building_component, a.area AS area FROM parcels b,
> building_component_areas a WHERE a.hcad_acct=b.hcad_num) as foo using
> unique gid using srid=-1"
> 
>     PROJECTION
>       "init=epsg:102740"
>     END
>     METADATA
>       "wms_title" "Building Component Areas Query Layer"
>       "wfs_title" "Building Component Areas Query Layer"
>       "wms_srs"	"epsg:102740 epsg:4326"
>       "gml_include_items" "all"
>       "wms_include_items" "all"
>       "gml_featureid" "ogc_fid" 
>       "qstring_validation_pattern" '.'
>     END
>   END # End layer 'building_component_areas_query'
> 
> /* url GetFeatureInfo request */
> 
> http://maps.snoogems.com/cgi-bin/mapserv?
> map=/path/to/srch_cad.map
> &SERVICE=WMS&VERSION=1.1.1
> &REQUEST=GetFeatureInfo
> &SRS=EPSG%3A102740
> &WIDTH=800&HEIGHT=800
> &BBOX=3102785.400463,13832395.006499,3104115.230452,13833724.836488
> &LAYERS=building_comp_query
> &STYLES=
> &FORMAT=image%2Fpng&QUERY_LAYERS=building_comp_query&X=398&Y=390&INFO_FORMAT=text/html&FEATURE_COUNT=999
> 

-- 
View this message in context: http://n2.nabble.com/WMS-layer-GetFeatureInfo-request-multiple-row-attributes-return-tp4288650p4288728.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list