Changes between Version 2 and Version 3 of FDORfc64
- Timestamp:
- 09/24/12 08:48:24 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc64
v2 v3 40 40 The 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. 41 41 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 42 The 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. 44 43 45 44 … … 79 78 == How to use this API == 80 79 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_ByGeometriesBoundingBox96 si = FdoSpatialIndex::Create(FdoSpatialIndex_ByGeometriesBoundingBox);97 98 // Insert the geometry99 si->InsertObject(777, ba);100 101 // Query the SI102 FdoSpatialIndexIterator iter1(si, 1, 1, 2, 2);103 104 FdoInt32 iPart, iSubpart, iSegment;105 FdoInt64 marker = 0;106 107 // Get the results108 while (marker = iter1.GetNextObject())109 {110 FdoInt64 fid = marker; // not encoded111 // ... do stuff112 }113 114 // Mode #2: FdoSpatialIndex_BySegmentsMultipleFeatures115 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 stuff125 }126 127 // Mode #3: FdoSpatialIndex_BySegmentsSingleFeature128 si = FdoSpatialIndex::Create(FdoSpatialIndex_BySegmentsSingleFeature);129 si->InsertObject(0, ba); // FeatId = 0130 131 FdoSpatialIndexIterator iter3(si, 1, 1, 2, 2);132 133 while (marker = iter3.GetNextObject())134 {135 si->DecodeMarker(marker, iPart, iSubpart, iSegment);136 // ... do stuff137 }138 }}}139 80 140 81 == Managed FDO API == 141 82 142 The FDO Managed Interfaces will be updated if required in a similar manner to reflect the proposed changes.83 At this time there is plan to update the FDO Managed Interfaces. 143 84 144 85 145 86 == Test Plan == 146 87 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. 148 89 149 90 == !Funding/Resources ==