Changes between Version 3 and Version 4 of FDORfc64
- Timestamp:
- 09/24/12 10:20:35 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc64
v3 v4 52 52 /// \param g1 53 53 /// Input Left hand Geometry to Evaluate 54 /// \param si155 /// Input The spatial index associated with g1. A valid spatial index is not NULL56 /// and of type BySegmentsSingleFeature or BySegmentsMultipleFeatures (just one57 /// feature). If an invalid spatial index is provided, then this method will silently58 /// delegate to Evaluate(g1, op, g2, tolXY).59 54 /// \param op 60 55 /// Input The spatial operation to apply to the left and right hand geometries 61 56 /// \param g2 62 57 /// 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). 63 63 /// \param toleranceXY 64 64 /// Input XY tolerance to evaluate the spatial condition … … 68 68 /// \return 69 69 /// Returns the evaluation of spatial operation. 70 FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, FdoSpatial Index* si1, FdoSpatialOperations op, FdoIGeometry* g2, double toleranceXY);70 FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, FdoSpatialOperations op, FdoIGeometry* g2, FdoSpatialIndex* si2, double toleranceXY); 71 71 72 72 }}} … … 74 74 75 75 == 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. 77 79 78 80 == How to use this API == 79 81 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 80 114 81 115 == Managed FDO API == 82 116 83 At this time there is plan to update the FDO Managed Interfaces.117 At this time there is no plan to update the FDO Managed Interfaces since the managed spatial index is not implemented yet. 84 118 85 119 86 120 == Test Plan == 87 121 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 89 125 90 126 == !Funding/Resources ==