Changes between Version 9 and Version 10 of FDORfc57


Ignore:
Timestamp:
Apr 11, 2011, 12:02:04 AM (13 years ago)
Author:
sunch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc57

    v9 v10  
    289289
    290290{{{
    291 FdoPtr<FdoWmsIGetFeatureInfo> cmdGFI = static_cast<FdoWmsIGetFeatureInfo*> ( conn->CreateCommand(FdoWmsCommandType_!GetFeatureInfo) );
     291FdoPtr<FdoWmsIGetFeatureInfo> cmdGFI = static_cast<FdoWmsIGetFeatureInfo*> ( conn->CreateCommand(FdoWmsCommandType_GetFeatureInfo) );
    292292FdoPtr<FdoIdentifier> id = FdoIdentifier::Create(L"Borders_Poly");
    293293cmdGFI->SetFeatureClassName(id);
     
    300300}}}
    301301
    302 In 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 
    304 Note: If the select command isn't called before executing the !FdoWmsCommandType_!GetFeatureInfo command, an exception would be thrown.[[BR]]
     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 following extra code snippets would be involved to set the select command for execution.
     303{{{
     304// This is the specified bounding box and resolution values for a tile.
     305double minx, miny, maxx, maxy;
     306long xResolution, yResolution;
     307
     308// Set up the CLIP function.
     309FdoString* pRasterName = L"RasterPropertyName";
     310FdoPtr<FdoExpressionCollection> clipFuncParams = FdoExpressionCollection::Create();
     311FdoPtr<FdoIdentifier> rasterProp = FdoIdentifier::Create(pRasterName);
     312funcParams->Add(rasterProp);
     313FdoPtr<FdoDataValue> minX = FdoDataValue::Create(minx, FdoDataType_Double);
     314clipFuncParams->Add(minX);
     315FdoPtr<FdoDataValue> minY = FdoDataValue::Create(miny, FdoDataType_Double);
     316clipFuncParams->Add(minY);
     317FdoPtr<FdoDataValue> maxX = FdoDataValue::Create(maxx, FdoDataType_Double);
     318clipFuncParams->Add(maxX);
     319FdoPtr<FdoDataValue> maxY = FdoDataValue::Create(maxy, FdoDataType_Double);
     320clipFuncParams->Add(maxY);
     321FdoPtr<FdoFunction> clipFunc = FdoFunction::Create(L"CLIP", clipFuncParams);
     322FdoPtr<FdoComputedIdentifier> clipIdentifier = FdoComputedIdentifier::Create(L"ClippedRaster", clipFunc );
     323selProps->Add(clipIdentifier);
     324
     325// Set up the RESAMPLE function.
     326FdoPtr<FdoExpressionCollection> resampleFuncParams = FdoExpressionCollection::Create();
     327FdoPtr<FdoIdentifier> rasterProp = FdoIdentifier::Create(pRasterName);
     328resampleFuncParams->Add(rasterProp);
     329minX = FdoDataValue::Create(minx, FdoDataType_Double);
     330resampleFuncParams->Add(minX);
     331minY = FdoDataValue::Create(miny, FdoDataType_Double);
     332resampleFuncParams->Add(minY);
     333maxX = FdoDataValue::Create(maxx, FdoDataType_Double);
     334resampleFuncParams->Add(maxX);
     335maxY = FdoDataValue::Create(maxy, FdoDataType_Double);
     336resampleFuncParams->Add(maxY);
     337FdoPtr<FdoDataValue> height = FdoDataValue::Create((unsigned int)(yResolution), FdoDataType_Double);
     338resampleFuncParams->Add(height);
     339FdoPtr<FdoDataValue> width = FdoDataValue::Create((unsigned int)(xResolution), FdoDataType_Double);
     340resampleFuncParams->Add(width);
     341FdoPtr<FdoFunction> resampleFunc = FdoFunction::Create(L"RESAMPLE", resampleFuncParams);
     342FdoPtr<FdoComputedIdentifier> resampleIdentifier = FdoComputedIdentifier::Create(pRasterName, resampleFunc);
     343selProps->Add(resampleIdentifier);
     344
     345// Execute the command with "CLIP" and "RESAMPLE" functions.
     346featReader = cmd->Execute ();
     347}}}
     348
     349In this situation, the bounding box and resolution in the cached !GetMap parameters couldn't meet the request. If the requested tile for the feature information isn't the last requested one in the select phase, the cached !GetMap request should be updated with the relevant bounding box and height/width; the methods !SetBoundingBox, !SetHeight and !SetWidth need be called to set the expected values, and the command would automatically replace the cached parameters before execution. However, the application has the responsibilities to calculate which tile the specified interest point is in, and the new envelope points and resolution would be obtained. Accordingly, the !GetFeatureInfo command would be called with the extra settings as below.[[BR]]
     350{{{
     351...
     352FdoPtr<FdoIEnvelope> env = gf->CreateEnvelopeXY(
     353                                minx,
     354                                miny,
     355                                maxx,
     356                                maxy
     357                              );
     358// Update the cached bounding box.
     359cmdGFI->SetBoundingBox(env);
     360// Update the resolution.
     361cmdGFI->SetWidth(xResolution);
     362cmdGFI->SetHeight(yResolution);
     363
     364// Execute the command in consideration of new bounding box and resolution.
     365stream = cmdGFI->Execute ();
     366}}}
     367
     368Note: If the select command isn't called before executing the !FdoWmsCommandType_!GetFeatureInfo command, there is no cached !GetMap request and an exception would be thrown.[[BR]]
    305369
    306370