Opened 11 years ago

Closed 10 years ago

#225 closed defect (fixed)

WMS GetFeatureInfo Returns Data From Only One Layer

Reported by: jdcard Owned by: chrisclaydon
Priority: medium Milestone: 2.0
Component: WMS Interface Version: 1.2.0
Severity: major Keywords:
Cc: External ID:

Description

WMS GetFeatureInfo? should return data for all visible layers included in the request. It is only returning data for one layer.

Environment: MapGuide OS 1.2.0 RC2 on Windows 2000 Server; Sheboyban data set.

Open the Buildings layer in Studio and enable the URL, NAME, and ID columns in the "Properties displayed in Viewer" section.

Load the http://SERVER/mapguide/mapagent/getfeatureinfowmsform.html form and change the following fields:

  Map Layers (comma-separated)      : Samples/Sheboygan/Layers/Parcels,Samples/Sheboygan/Layers/Buildings
  Query Layers (comma-separated)    : Samples/Sheboygan/Layers/Parcels,Samples/Sheboygan/Layers/Buildings
  Query Point X (pixels from left)  : 300
  Query Point Y (pixels from top)   : 300
  Bounding Box (minx,miny,maxx,maxy): -87.727526,43.744432,-87.727157,43.744819
  Display Width (pixels)            : 600
  Display Height (pixels)           : 600

Submit the form. You will receive a text/xml document similar to this:

 <FeatureInfoCollection>
  <FeatureInfo>
  <Property name="URL" value=""></Property>
  <Property name="NAME" value=""></Property>
  <Property name="ID" value="8231"></Property>
  </FeatureInfo>
 </FeatureInfoCollection>

Next, reverse the order of the layers in the MapLayers? and QueryLayers? fields of the form. Submit the form and you receive something like this:

 <FeatureInfoCollection>
  <FeatureInfo>
  <Property name="Description1" value="ORIGINAL PLAT"></Property>
  <Property name="Zone" value="EXM"></Property>
  <Property name="Acreage" value="0.62"></Property>
  <Property name="Lot Dimensions" value="150X180"></Property>
  <Property name="Owner" value="IMMANUEL EVANGELICAL"></Property>
  <Property name="Description2" value="LOTS 7,8 &amp; 9 BLK 224"></Property>
  <Property name="Description3" value=""></Property>
  <Property name="Billing Address" value="1634 ILLINOIS AVE"></Property>
  <Property name="Lot Size (SqFt)" value="27000"></Property>
  <Property name="Description4" value=""></Property>
  </FeatureInfo>
 </FeatureInfoCollection>

Both queries should have returned data for both layers, something like this:

 <FeatureInfoCollection>
  <FeatureInfo Layer="Buildings">
   <Property name="URL" value=""></Property>
   <Property name="NAME" value=""></Property>
   <Property name="ID" value="8231"></Property>
  </FeatureInfo>
  <FeatureInfo Layer="Parcels">
   <Property name="Description1" value="ORIGINAL PLAT"></Property>
   <Property name="Zone" value="EXM"></Property>
   <Property name="Acreage" value="0.62"></Property>
   <Property name="Lot Dimensions" value="150X180"></Property>
   <Property name="Owner" value="IMMANUEL EVANGELICAL"></Property>
   <Property name="Description2" value="LOTS 7,8 &amp; 9 BLK 224"></Property>
   <Property name="Description3" value=""></Property>
   <Property name="Billing Address" value="1634 ILLINOIS AVE"></Property>
   <Property name="Lot Size (SqFt)" value="27000"></Property>
   <Property name="Description4" value=""></Property>
  </FeatureInfo>
 </FeatureInfoCollection>

Change History (7)

comment:1 Changed 11 years ago by tomfukushima

Owner: set to chrisclaydon

comment:2 Changed 11 years ago by chrisclaydon

By default, the WMS GetFeatureInfo request only returns information for a single feature. This is compliant with the OGC WMS 1.1.1 specification. The maximum number of features returned can be controlled by specifying the FEATURE_COUNT parameter.

The following request against the Sheboygan sample data (modified to ensure that the layers are set to be queryable) returns information for two features:

http://localhost:8700/mapguide2008/mapagent/mapagent.fcgi?REQUEST=GETFEATUREINFO&SERVICE=WMS&VERSION=1.1.1&FORMAT=image/png&INFO_FORMAT=text/xml&LAYERS=Samples/Sheboygan/Layers/Buildings,Samples/Sheboygan/Layers/Parcels&X=300&Y=300&BBOX=-87.727526,43.744432,-87.727157,43.744819&SRS=EPSG:4326&WIDTH=600&HEIGHT=600&FEATURE_COUNT=100

The response was as follows:

 <FeatureInfoCollection>  
  <FeatureInfo>  
  <Property name="Description1" value="ORIGINAL PLAT"></Property>
  <Property name="Zone" value="EXM"></Property>
  <Property name="Acreage" value="0.62"></Property>
  <Property name="Lot Dimensions" value="150X180"></Property>
  <Property name="Owner" value="IMMANUEL EVANGELICAL"></Property>
  <Property name="Description2" value="LOTS 7,8 &amp; 9 BLK 224"></Property> 
  <Property name="Description3" value=""></Property>
  <Property name="Billing Address" value="1634 ILLINOIS AVE"></Property>
  <Property name="Lot Size (SqFt)" value="27000"></Property>
  <Property name="Description4" value=""></Property>
  </FeatureInfo> 
  <FeatureInfo>   
  <Property name="Autogenerated_SDF_ID" value="22106"></Property> 
  <Property name="URL" value=""></Property> 
  <Property name="NAME" value=""></Property> 
  <Property name="ID" value="8231"></Property> 
  </FeatureInfo> 
 </FeatureInfoCollection>

comment:3 Changed 11 years ago by jdcard

We're halfway there; the returned data does not identify which layer(s) the data was returned from.

comment:4 Changed 11 years ago by jdcard

Here is sample GetFeatureInfo? output from MapGuide LiteView? taken from the XSL files from that application, where I had included sample output in comments in to assist with writing the parsing code.

<FeatureCollection typeName="FeatureInfo">
  <boundedBy>
    <Box srsName="">
      <coordinates>6462176.0170255,2003006.1136764 6462200.6713072,2003030.7948155</coordinates>
    </Box>
  </boundedBy>
  <featureMember typeName="FeatureInfoMember">
    <Feature identifier="13727026" typeName="STANCOREGIONAL.MWF/LeaseProperties">
      <name>430 Crane Ave.</name>
      <property type="string" typeName="hyperlink">http://listing.loopnet.com/13727026</property>
    </Feature>
  </featureMember>
  <featureMember typeName="FeatureInfoMember">
    <Feature identifier="1" typeName="STANCOREGIONAL.MWF/Cities">
      <name>COUNTY</name>
      <property type="string" typeName="hyperlink"/>
    </Feature>
  </featureMember>
  <featureMember typeName="FeatureInfoMember">
    <Feature identifier="1870" typeName="STANCOREGIONAL.MWF/MajorRoads">
      <name>E LAS PALMAS AVE</name>
      <property type="string" typeName="hyperlink">2900-3199</property>
    </Feature>
  </featureMember>
  <featureMember typeName="FeatureInfoMember">
    <Feature identifier="10" typeName="STANCOREGIONAL.MWF/Rivers">
      <name>SAN JOAQUIN RIVER</name>
      <property type="string" typeName="hyperlink"/>
    </Feature>
  </featureMember>
</FeatureCollection>

comment:5 Changed 10 years ago by tomfukushima

Milestone: 1.21.3

comment:6 Changed 10 years ago by jbirch

I believe that this was dealt with by RFC 39.

It appears that a new ticket #384 was created to address this, and that Changeset 2690 addressed the problem.

Can this ticket be closed?

comment:7 Changed 10 years ago by jbirch

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.