Changes between Version 3 and Version 4 of FDORfc64


Ignore:
Timestamp:
09/24/12 10:20:35 (12 years ago)
Author:
danstoica
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc64

    v3 v4  
    5252    /// \param g1
    5353    /// Input Left hand Geometry to Evaluate
    54     /// \param si1
    55     /// Input The spatial index associated with g1. A valid spatial index is not NULL
    56     /// and of type BySegmentsSingleFeature or BySegmentsMultipleFeatures (just one
    57     /// feature). If an invalid spatial index is provided, then this method will silently
    58     /// delegate to Evaluate(g1, op, g2, tolXY).
    5954    /// \param op
    6055    /// Input The spatial operation to apply to the left and right hand geometries
    6156    /// \param g2
    6257    /// Input Right hand Geometry to Evaluate
     58    /// \param si2
     59    /// Input The spatial index associated with g2. A valid spatial index is not NULL
     60    /// and of type BySegmentsSingleFeature or BySegmentsMultipleFeatures (just one
     61    /// feature). If an invalid spatial index is provided, then this method will silently
     62    /// delegate to Evaluate(g1, op, g2, tolXY).
    6363    /// \param toleranceXY
    6464    /// Input XY tolerance to evaluate the spatial condition
     
    6868    /// \return
    6969    /// Returns the evaluation of spatial operation.
    70     FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, FdoSpatialIndex* si1, FdoSpatialOperations op, FdoIGeometry* g2, double toleranceXY);
     70    FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, FdoSpatialOperations op, FdoIGeometry* g2, FdoSpatialIndex* si2, double toleranceXY);
    7171
    7272}}}
     
    7474
    7575== Remarks ==
    76 
     76 
     77   * the implementation of this new API will focus on FDO Polygons, MultiPolygons, CurvePolygons and MultiCurvePolygons as filter geometries.
     78   * FdoExpressionEngineImp::ProcessSpatialCondition() will be changed to take advantage of this new API.
    7779
    7880== How to use this API ==
    7981
     82       // The filter geometry
     83       FdoPtr<FdoIGeometry> geomRight = ...
     84
     85       FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
     86       FdoPtr<FdoByteArray> fgf = gf->GetFgf(geomRight);
     87
     88       // Check the geometry type. Create a spatial index in case the type is Polygon or MultiPolygon
     89       // and it has a non-trivial number of segments (say over 400).
     90       FdoPtr<FdoSpatialIndex> si = NULL;
     91       try
     92       {
     93           si = FdoSpatialIndex::Create(FdoSpatialIndex_BySegmentsSingleFeature);
     94           si->InsertObject(0, fgf);
     95       }
     96       catch (FdoException* ex)
     97       {
     98           ex->Release();
     99
     100           // Creation failed due to excessive number of parts or subparts
     101           // Try BySegmentsMultipleFeatures mode. It should succeed.
     102           si = FdoSpatialIndex::Create(FdoSpatialIndex_BySegmentsMultipleFeatures);
     103           si->InsertObject(0, fgf);
     104       }
     105
     106       // Assume the spatial operation is FdoSpatialOperations_Intersects
     107       // For every candidate geometry evaluate against the filter geometry...
     108
     109       FdoPtr<FdoIGeometry> geomLeft = ... // The candidate geometry
     110
     111       bool eval = FdoSpatialUtility::Evaluate(geomLeft, FdoSpatialOperations_Intersects, geomRight, si, 0.001);
     112
     113       // Do something with the result
    80114
    81115== Managed FDO API ==
    82116
    83 At this time there is plan to update the FDO Managed Interfaces.
     117At this time there is no plan to update the FDO Managed Interfaces since the managed spatial index is not implemented yet.
    84118
    85119 
    86120== Test Plan ==
    87121
    88     * Add unit test to test the new API in all modes and primary filtering with boundary conditions.
     122    Add unit tests to test the new API for polygons and multipolygons with the spatial index mode #2 and #3 (i.e. BySegmentsSingleFeature and BySegmentsMultipleFeatures):
     123    * Fidelity tests for Contains, Crosses, Disjoint, Equals, Intersects, Overlaps, Touches, Within, CoveredBy, and Inside spatial operators.
     124    * Performance test to compare Evaluate() with and without spatial index
    89125
    90126== !Funding/Resources ==