Changes between Version 7 and Version 8 of FDORfc57


Ignore:
Timestamp:
Mar 31, 2011, 11:45:18 PM (13 years ago)
Author:
sunch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc57

    v7 v8  
    66== Status ==
    77 
    8 ||RFC Template Version||(1.1)|| 
     8||RFC Template Version||1.1|| 
    99||Submission Date||March 23, 2011||
    1010||Last Modified||Cheney Sun, March 23, 2011||
     
    4848== Proposed Solution ==
    4949
    50 The shortest WMS !GetFeatureInfo implementation path would involve implementing !GetFeatureInfo request within the current FDO WMS provider. The design solution would provide a custom command to users to retrieve the feature information: !FdoWmsCommandType_GetFeatureInfo.[[BR]]
     50The shortest WMS !GetFeatureInfo implementation path would involve implementing !GetFeatureInfo request within the current FDO WMS provider. The design solution would provide a custom command, !FdoWmsCommandType_GetFeatureInfo, for users to retrieve the feature information.[[BR]]
    5151
    5252'''•    Input of the !GetFeatureInfo request'''[[BR]]
    5353
    54 From the required parameters table above, we can see !GetFeatureInfo requires almost all the parameters required by !GetMap request and plus more, the custom command would also require the same input for Select command and extra parameters (i, j coordinate in pixels of feature in Map CS). [[BR]]
     54From the required parameters table above, we can see !GetFeatureInfo requires a copy of parameters required by !GetMap request and plus its own parameter. So the custom command would also require the same input for Select command and extra parameters ( QUERY_LAYERS, INFO_FORMAT, FEATURE_COUNT, I and J ). To simplify the implementation and usage of the command, the relevant !GetMap request will be cached in the connection class and this command would pick up it as the part of the !GetMap parameters. This presumes that the command shoud be invoked after the relevant select command. If no cached !GetMap request available, execution of the command would throw an exception.[[BR]]
     55
     56Although, it's possible that the command would employ a different bounding box and resolution with those used in the cached !GetMap request, The command also exposes another entries to let user specify the expected bounding box, height and width.[[BR]]
    5557
    5658'''•    Output of the !GetFeatureInfo request'''[[BR]]
    5759
    58 The format of responded message from the !GetFeatureInfo request is defined by the WMS server. For example:[[BR]]
     60The format of responded message from the !GetFeatureInfo request is defined by the WMS server. According to the WMS standard, the retrieved feature information is a MIME type. For example, it could be the following format.[[BR]]
    5961
    6062  <Format>text/plain</Format> [[BR]]
    61   <Format>text/html</Format>[[BR]]
    62 
    63 Currently, the WMS implementation specification doesn’t define a standard format for it. So, the solution is to return a !FdoString* type pointer by this command. If user set the FEATURE_COUNT greater than 1, the information for multiple candidate features will be returned. However, we don’t parse the returned information since no standard regarding the format and client should take the responsibility to parse it.  For example the following text is returned from one server to response the !GetFeatureInfo request.[[BR]]
    64 
     63  <Format>text/html</Format> [[BR]]
     64  <Format>text/xml</Format> [[BR]]
     65  <Format>image/png</Format> [[BR]]
     66  <Format>video/mpeg</Format> [[BR]]
     67  .......[[BR]]
     68
     69Currently, the WMS specification doesn’t define a standard format for each of the subtype. So, the solution is to return a !FdoIoStream* type pointer by this command. Users take the responsibilities to parse the returned data stream. If user set the FEATURE_COUNT greater than 1, the information for multiple candidate features will be returned. [[BR]] For example, if the "text/plain" is specified as the output format and set the FEATURE_COUNT as 2, the string stream below would be obtained.[[BR]]
    6570     Layer 'IBA'[[BR]]
    6671     Feature 6:[[BR]]
     
    7479     LINK = 'http://www.bsc-eoc.org/iba/site.jsp?siteID=NU089' [[BR]]
    7580
    76 However, the following XML formatted message will return if issue the command to a !MapGuide server. [[BR]]
     81However, the following XML formatted message stream will return if issue the command to a !MapGuide server and specifying the output format as "text/xml". [[BR]]
    7782
    7883{{{
     
    8893}}}
    8994
    90 Note: we can parse the response value and return a class if WMS spec defines a standard format in the future.
     95Similarly, if specifying the output format as "image/png", an image stream would be returned; specifying it as "video/mpeg" would get a video stream. Users have the freedom to choose a way of comsuming those data.[[BR]]
    9196
    9297'''•    !GetFeatureInfo custom command interface'''[[BR]]
     
    96101/// The FdoWmsIGetFeatureInfo interface defines the
    97102/// FdoWmsIGetFeatureInfo command, which retrieves more information
    98 /// about features in the maps. The Execute operation
    99 /// returns a FdoString* type pointer pointing to the feature information.
     103/// about features in the maps. The Execute operation returns a
     104/// FdoIoStream* type pointer pointing to the feature information
     105/// data stream.
    100106class FdoWmsIGetFeatureInfo : public FdoICommand
    101107{
     
    104110    /// \brief
    105111    /// Execute the FdoWmsIGetFeatureInfo command and returns a
    106     /// FdoString* pointer, which points to the feature information returned
    107     /// by the WMS server.
    108     ///
    109     /// \return
    110     /// Returns string contains feature information from the WMS server
    111     ///
    112     FDO_API virtual FdoString * Execute() = 0;
     112    /// FdoIoStream* pointer. It could be a text, image, video and any
     113    /// binary data stream, ect. The result depends on the specified output
     114    /// format.
     115    ///
     116    /// \return
     117    /// Return a FdoIoStream representing the feature information.
     118    ///
     119    FDO_API virtual FdoIoStream* Execute() = 0;
    113120
    114121    /// \brief
     
    134141    ///
    135142    FDO_API virtural FdoIdentifier * GetFeatureClassName() = 0;
     143
     144    /// \brief
     145    /// Set the format of output feature information. The supported values are MIME type
     146    /// strings and should be listed in one or more <Format> elements inside the
     147    /// <Request><FeatureInfo> element of the Capabilities XML.
     148    /// An exception would be thrown if the value isn't in the supported list when
     149    /// executing the command. The default value is the first one specified in the
     150    /// Capabilities document.
     151    ///
     152    /// \para value
     153    /// Input the output feature information format.
     154    ///
     155    FDO_API virtual void SetOutputFormat(FdoString* value) = 0;
     156
     157    /// \brief
     158    /// Get the specified format for the returning feature information.
     159    ///
     160    /// \return
     161    /// Return the output feature information format.
     162    ///
     163    FDO_API virtual FdoString* GetOutputFormat() = 0;
     164
     165    /// \brief
     166    /// Set the bounding box that would be used to replace the one in
     167    /// cached GetMap request. If it's not set or the bounding box is
     168    /// empty, directly use the one in cached GetMap request.
     169    ///
     170    /// \param value
     171    /// Input the interest bounding box.
     172    ///
     173    FDO_API virtual void SetBoundingBox(FdoIEnvelope* value) = 0;
     174
     175    /// \brief
     176    /// Get the bounding box that's specified to replace the one in
     177    /// cached GetMap request.
     178    ///
     179    /// \return
     180    /// Return the specified bounding box for GetMap request.
     181    ///
     182    FDO_API virtual FdoIEnvelope* GetBoundingBox() = 0;
     183
     184    /// \brief
     185    /// Set the height to replace the one used in the cached GetMap
     186    /// request. Its default value is zero, if the specified value is
     187    /// greater than zero, the replacement would happen. Otherwise,
     188    /// directly use the one in the cached GetMap request.
     189    ///
     190    /// \param value
     191    /// Input the specified image height.
     192    ///
     193    FDO_API virtual void SetHeight(FdoSize value) = 0;
     194
     195    /// \brief
     196    /// Get the height that's specified to replace the one in cached
     197    /// GetMap request. Its default value is zero.
     198    ///
     199    /// \return
     200    /// Return specified image height.
     201    ///
     202    FDO_API virtual FdoSize GetHeight() = 0;
     203
     204    /// \brief
     205    /// Set the width to replace the one used in the cached GetMap
     206    /// request. Its default value is zero, if the specified value is
     207    /// greater than zero, the replacement would happen. Otherwise,
     208    /// directly use the one in the cached GetMap request.
     209    ///
     210    /// \param value
     211    /// Input the specified image width.
     212    ///
     213    FDO_API virtual void SetWidth(FdoSize value) = 0;
     214
     215    /// \brief
     216    /// Get the width that's specified to replace the one in cached
     217    /// GetMap request. Its default value is zero.
     218    ///
     219    /// \return
     220    /// Return specified image width.
     221    ///
     222    FDO_API virtual FdoSize GetWidth() = 0;
    136223
    137224    /// \brief
     
    185272'''•    Example''' [[BR]]
    186273
    187 The !GetFeatureInfo custom command will be used like below:
    188 
     274Generally, the !FdoWmsSelectCommand will be called before the !GetFeatureInfo custom command. The following select command can be called to bring map to the application.[[BR]]
    189275{{{
    190 FdoPtr<FdoWmsIGetFeatureInfo> cmdGFI = static_cast<FdoWmsIGetFeatureInfo*> (connection->CreateCommand(FdoWmsCommandType_!GetFeatureInfo));
    191 FdoPtr<FdoIdentifier> id = FdoIdentifier::Create(L”Park”);
    192 cmdGFI->SetFeatureClassName(id);
     276FdoPtr<FdoIConnection> conn = CreateConnection ();
     277conn->SetConnectionString (L"FeatureServer=http://www.WMSSERVER.net/wms_service");
     278FdoConnectionState_Open == conn->Open (); // Open the connection.
     279FdoPtr<FdoISelect> cmd = static_cast<FdoISelect *> (conn->CreateCommand (FdoCommandType_Select));
     280cmd->SetFeatureClassName (L"Borders_Poly");
     281FdoPtr<FdoIdentifierCollection> selProps = cmd->GetPropertyNames ();
     282FdoPtr<FdoIdentifier> prop = FdoIdentifier::Create (L"FeatId");
     283selProps->Add (prop);
     284FdoPtr<FdoIFeatureReader> featReader = cmd->Execute ();
     285......
     286}}}
     287
     288After viewing the generated WMS map, users could wonder the information at some point of the map. The custom !GetFeatureInfo command could be called as below.[[BR]]
     289
     290{{{
     291FdoPtr<FdoWmsIGetFeatureInfo> cmdGFI = static_cast<FdoWmsIGetFeatureInfo*> ( conn->CreateCommand(FdoWmsCommandType_!GetFeatureInfo) );
     292FdoPtr<FdoIdentifier> id = FdoIdentifier::Create(L"Borders_Poly");
     293cmdGFI->SetFeatureClassName(id);
    193294FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
    194295FdoPtr<FdoIDirectPosition> pt = gf->CreatePositionXY(-1000, 1000);
    195296cmdGFI->SetPosition(pt);
    196 FdoStringP featureInfo = cmdGFI->Execute ();
     297cmdGFI->SetOutputFormat(L"text/xml");
     298FdoPtr<FdoIoStream> stream = cmdGFI->Execute ();
     299......
    197300}}}
    198301
    199 Since there are lots of same parameters required as !GetMap request, the Execute function of this custom command will be similar with the select command. The difference is to pass the extra i, j values and fire the !GetFeatureInfo request to WMS server. What’s more, share the same codes between select command and !GetFeatureInfo custom command should be considered seriously.[[BR]]
    200 
    201 Similar to the !GetMap request, the parameters regarding the !GetMap parts should be obtained from the override configuration. If it’s not customized, the default parameters will be gotten from capabilities documents (returned from !GetCapabilities).  One note is that the command should generally be called after the !GetMap request; otherwise, the returned result is probably unexpected if the parameters are wrongly specified.
     302In the upper case, the cached bounding box and resolution are not changed. However, if the application employs the tile approach to improve the map loading performance, the bounding box and resolution in the cached !GetMap parameters couldn't meet the request. The methods !SetBoundingBox, !SetHeight and !SetWidth need be called to specify the expected ones, and the command would automatically replace the cached parameters before execution.[[BR]]
     303
     304Note: If the select command isn't called before executing the !FdoWmsCommandType_!GetFeatureInfo command, an exception would be thrown.[[BR]]
     305
    202306
    203307== Implications ==