Changes between Version 2 and Version 3 of FDORfc64


Ignore:
Timestamp:
09/24/12 08:48:24 (12 years ago)
Author:
danstoica
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc64

    v2 v3  
    4040The solution is to create a Spatial Index for the filter polygon where each segment of the polygon has an entry. This way all the steps 1-3 will benefit by limiting the segments to check to those in the area of interest. For example, the point-in-polygon test will run a spatial query using the X-ray bounding box as search area. Therefore, instead of traversing all the segments, only a few will be processed for X-ray intersections.
    4141
    42 The proposal is to add a new Evaluate() method to which takes a Spatial Index parameter. The reason the spatial index is owned by the caller is for performance reasons: the same geometry filter is used for multiple times, for each candidate geometry, and creating the spatial index each time is not optimal.
    43 
     42The proposal is to add a new FdoSpatialUtility::Evaluate() method which takes a Spatial Index parameter. The reason the spatial index is owned by the caller is for performance reasons: the same geometry filter is used multiple times for each candidate geometry, and creating the spatial index each time is not optimal.
    4443
    4544
     
    7978== How to use this API ==
    8079
    81 The following code illustrates how to use the Spatial Index and the spatial index iterator.
    82 
    83 
    84 {{{
    85     FdoPtr<FdoSpatialIndex> si;
    86 
    87     FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
    88  
    89     /*************************** Test Polygon *************************/
    90     FdoStringP geomText = L"POLYGON ((0 0, 5 0, 5 5, 0 5, 0 0), (1 1, 2 2, 2 1, 1 1), (3 3, 4 4, 4 3, 3 3))";
    91  
    92     FdoPtr<FdoIGeometry> geom = gf->CreateGeometry(geomText);
    93     FdoPtr<FdoByteArray> ba = gf->GetFgf(geom);
    94 
    95     // Mode #1: FdoSpatialIndex_ByGeometriesBoundingBox
    96     si = FdoSpatialIndex::Create(FdoSpatialIndex_ByGeometriesBoundingBox);
    97 
    98     // Insert the geometry
    99     si->InsertObject(777, ba);
    100 
    101     // Query the SI
    102     FdoSpatialIndexIterator iter1(si, 1, 1, 2, 2);
    103 
    104     FdoInt32 iPart, iSubpart, iSegment;
    105     FdoInt64 marker = 0;
    106 
    107     // Get the results
    108     while (marker = iter1.GetNextObject())
    109     {
    110         FdoInt64 fid = marker; // not encoded
    111         // ... do stuff         
    112     }
    113        
    114     // Mode #2: FdoSpatialIndex_BySegmentsMultipleFeatures
    115     si = FdoSpatialIndex::Create(FdoSpatialIndex_BySegmentsMultipleFeatures);
    116     si->InsertObject(777, ba);
    117 
    118     FdoSpatialIndexIterator iter2(si, 1, 1, 2, 2);
    119 
    120     while (marker = iter2.GetNextObject())
    121     {
    122         FdoInt32 fid;
    123         si->DecodeMarker(marker, fid, iSegment);
    124         // ... do stuff
    125     }
    126        
    127     // Mode #3: FdoSpatialIndex_BySegmentsSingleFeature
    128     si = FdoSpatialIndex::Create(FdoSpatialIndex_BySegmentsSingleFeature);
    129     si->InsertObject(0, ba); // FeatId = 0
    130 
    131     FdoSpatialIndexIterator iter3(si, 1, 1, 2, 2);
    132 
    133     while (marker = iter3.GetNextObject())
    134     {
    135         si->DecodeMarker(marker, iPart, iSubpart, iSegment);
    136         // ... do stuff
    137     }
    138 }}}
    13980
    14081== Managed FDO API ==
    14182
    142 The FDO Managed Interfaces will be updated if required in a similar manner to reflect the proposed changes.
     83At this time there is plan to update the FDO Managed Interfaces.
    14384
    14485 
    14586== Test Plan ==
    14687
    147     * Add unit test to test the API in all modes and primary filtering with boundary conditions.
     88    * Add unit test to test the new API in all modes and primary filtering with boundary conditions.
    14889
    14990== !Funding/Resources ==