Changes between Version 17 and Version 18 of FDORfc49
- Timestamp:
- 06/16/10 14:09:40 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc49
v17 v18 45 45 == Proposed Solution == 46 46 47 Add two new parameters which by default will be 1e-10. The default tolerance used is1e-10 and valid range is > 0. If an invalid value is provided, the default then will be used. We can modify SQLite and possible SDF providers only, rest of the providers will remain unchanged and if needed will be changed later. All internal functions from spatial FDO module will be updated to add extra parameters for tolerance.47 We need to add a few new functions to allow user to pass tolerances. In case caller uses the default functions (without tolerances) the default tolerance will be used 1e-10 and valid range is > 0. If an invalid value is provided, the default then will be used. We can modify SQLite and possible SDF providers only, rest of the providers will remain unchanged and if needed will be changed later. All internal functions from spatial FDO module will be updated to add extra parameters for tolerance. 48 48 49 49 {{{ … … 81 81 /// Returns the evaluation of spatial operation. 82 82 /// 83 /// Existing Function 84 /// 85 FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, 86 FdoSpatialOperations op, 87 FdoIGeometry* g2); 88 /// 89 /// New Additional Functions 90 /// 83 91 FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, 84 92 FdoSpatialOperations op, 85 93 FdoIGeometry* g2, 86 double toleranceXY = 1e-10, 87 double toleranceZ = 1e-10); 88 89 94 double toleranceXY); 95 96 FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, 97 FdoSpatialOperations op, 98 FdoIGeometry* g2, 99 double toleranceXY, 100 double toleranceZ); 90 101 /// \brief 91 102 /// Tests whether a point is within a ring or not. … … 105 116 /// Returns TRUE if the point is within ring or on its boundary, FALSE otherwise. 106 117 /// 118 /// Existing Function 119 /// 107 120 FDO_SPATIAL_API static bool PointInRing(FdoILinearRing* ring, 108 121 double x, 109 122 double y, 110 bool* isOnBoundary = NULL, 111 double toleranceXY = 1e-10); 123 bool* isOnBoundary = NULL); 124 /// 125 /// New Additional Function 126 /// 127 FDO_SPATIAL_API static bool PointInRing(FdoILinearRing* ring, 128 double x, 129 double y, 130 double toleranceXY, 131 bool* isOnBoundary = NULL); 112 132 113 133 /// \brief … … 128 148 /// Returns TRUE if the point is within polygon or on its boundary, FALSE otherwise. 129 149 /// 150 /// Existing Function 151 /// 130 152 FDO_SPATIAL_API static bool PointInPolygon(FdoIPolygon* poly, 131 153 double x, 132 154 double y, 133 155 bool* isOnIntBoundary = NULL, 134 bool* isOnExtBoundary = NULL, 135 double toleranceXY = 1e-10); 156 bool* isOnExtBoundary = NULL); 157 /// 158 /// New Additional Function 159 /// 160 FDO_SPATIAL_API static bool PointInPolygon(FdoIPolygon* poly, 161 double x, 162 double y, 163 double toleranceXY, 164 bool* isOnIntBoundary = NULL, 165 bool* isOnExtBoundary = NULL); 136 166 }}} 137 167 … … 207 237 /// Returns TRUE if the point is within ring or on its boundary, FALSE otherwise. 208 238 /// 209 static System::Boolean PointInRing( NAMESPACE_OSGEO_GEOMETRY::ILinearRing^ ring, System::Double coordinateX, System::Double coordinateY, double toleranceXY);210 static System::Boolean PointInRing( NAMESPACE_OSGEO_GEOMETRY::ILinearRing^ ring, System::Double coordinateX, System::Double coordinateY, System::Boolean% isOnBoundary, double toleranceXY);239 static System::Boolean PointInRing( NAMESPACE_OSGEO_GEOMETRY::ILinearRing^ ring, System::Double coordinateX, double toleranceXY, System::Double coordinateY); 240 static System::Boolean PointInRing( NAMESPACE_OSGEO_GEOMETRY::ILinearRing^ ring, System::Double coordinateX, double toleranceXY, System::Double coordinateY, System::Boolean% isOnBoundary); 211 241 212 242 /// … … 237 267 /// 238 268 static System::Boolean PointInPolygon(NAMESPACE_OSGEO_GEOMETRY::IPolygon^ polygon, System::Double coordinateX, System::Double coordinateY, double toleranceXY); 239 static System::Boolean PointInPolygon(NAMESPACE_OSGEO_GEOMETRY::IPolygon^ polygon, System::Double coordinateX, System::Double coordinateY, System::Boolean% isOnExtBoundary, double toleranceXY);240 static System::Boolean PointInPolygon(NAMESPACE_OSGEO_GEOMETRY::IPolygon^ polygon, System::Double coordinateX, System::Double coordinateY, System::Boolean% isOnExtBoundary, System::Boolean% isOnInBoundary, double toleranceXY);269 static System::Boolean PointInPolygon(NAMESPACE_OSGEO_GEOMETRY::IPolygon^ polygon, System::Double coordinateX, System::Double coordinateY, double toleranceXY, System::Boolean% isOnExtBoundary); 270 static System::Boolean PointInPolygon(NAMESPACE_OSGEO_GEOMETRY::IPolygon^ polygon, System::Double coordinateX, System::Double coordinateY, double toleranceXY, System::Boolean% isOnExtBoundary, System::Boolean% isOnInBoundary); 241 271 } 242 272 }}} … … 244 274 == Provider Implementation == 245 275 246 Initially, the changes identified by this RFC are needed for the SQLite Provider. Other provider developers can provide support for these values on an as-needed basis. However, no change is required in other providers. The SQLite Provider will be changed in order to be able to store those tolerances. Right now the provider keeps just a few values for spatial context like srid, name, WKT, auth_Text, auth_srid. Tolerances will be added to that list. Older versions of the SQLite provider will ignore those new columns, and the new provider in case will not find these tolerances, will use the default values. All other providers don’t have to be changed and 1e-10 will be passed.Each provider will handle tolerances as they want. This RFC will not force providers to use the tolerance from spatial context (even that should be the right thing to do).276 Initially, the changes identified by this RFC are needed for the SQLite Provider. Other provider developers can provide support for these values on an as-needed basis. However, no change is required in other providers. The SQLite Provider will be changed in order to be able to store those tolerances. Right now the provider keeps just a few values for spatial context like srid, name, WKT, auth_Text, auth_srid. Tolerances will be added to that list. Older versions of the SQLite provider will ignore those new columns, and the new provider in case will not find these tolerances, will use the default values. Each provider will handle tolerances as they want. This RFC will not force providers to use the tolerance from spatial context (even that should be the right thing to do). 247 277 248 278 This RFC will just add to the spatial FDO functions two new parameters, having as default values the values used till now (hard-coded values) in order to make possible that some providers which cares about tolerance to be able to use it.