Changes between Initial Version and Version 1 of FDORfc49


Ignore:
Timestamp:
06/01/10 21:43:10 (15 years ago)
Author:
romicadascalescu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc49

    v1 v1  
     1= FDO RFC 46 - Schema Attributes Capability =
     2
     3This page contains a request for comments document (RFC) for the FDO Open Source project. 
     4More FDO RFCs can be found on the [wiki:FDORfcs RFCs] page.
     5
     6== Status ==
     7 
     8||RFC Template Version||(1.0)||
     9||Submission Date||(Jun. 02 2010)||
     10||Last Modified||(Romica Dascalescu) [[Timestamp]]||
     11||Author||(Romica Dascalescu)||
     12||RFC Status||(draft)||
     13||Implementation Status||(draft)||
     14||Proposed Milestone||(3.6.0.0)||
     15||Assigned PSC guide(s)||(when determined)||
     16||'''Voting History'''||(vote date)||
     17||+1||||
     18||+0||||
     19||-0||||
     20||-1||||
     21 
     22== Motivation ==
     23
     24Using a default hard-coded tolerance in spatial operation evaluation, user can get wrong results.
     25
     26== Overview ==
     27
     28Spatial queries are evaluated using a default hard-coded value (see below the used values). The issue is for certain spatial contexts we might miss features or find more features than we should. The tolerance should be set by the user when the data base is created (at create spatial context time) and use that value in spatial queries.
     29
     30{{{
     31        //those numbers are very small and provide
     32        //the tolerance needed for "exact" computations,
     33        //i.e. CAD style non-FDO geometry intersection.
     34        #define EPSILON 1e-10
     35        #define NEGEPSILON -EPSILON
     36        #define SQREPSILON 1e-20
     37}}}
     38
     39The idea is to add support in FDO API for passing the tolerance into the spatial utility.
     40FDO has already support for those tolerances, so user can provide them when a new spatial context is created. Also those values can later be obtained using a spatial context reader. Each class in FDO has a dedicated spatial context reader. The provider can get those tolerances (XY and Z) by getting the spatial context of the class before running the spatial evaluation. Since providers might want to have 0.0 tolerances we cannot pass default values as 0.0, so we can pass 1e-10 same as before this RFC, which is the default value used by FDO API. If the spatial condition is a 2D evaluation the Z tolerance will be ignored.
     41
     42== Proposed Solution ==
     43
     44Add two new parameters which by default will be 1e-10. In case this parameter is NaN it will use the default tolerance (1e-10). 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.
     45
     46{{{
     47        /// \brief
     48        /// Spatial utility class.
     49        class FdoSpatialUtility
     50        {
     51        public:
     52            /// \brief
     53            /// Evaluates if two FDO geometric objects spatially interact with each other based on a user supplied spatial operator.
     54            /// For example: Contains, Crosses, Disjoint, Equals, Intersects, Overlaps, Touches, Within, CoveredBy, Inside, EnvelopeIntersects.
     55            ///
     56            /// \param g1
     57            /// Input Left hand Geometry to Evaluate
     58            /// \param op
     59            /// Input The spatial operation to apply to the left and right hand geometries
     60                    /// \param g2
     61            /// Input Right hand Geometry to Evaluate
     62            ///
     63            /// \param toleranceXY
     64            /// Input XY tolerance to evaluate the spatial condition
     65            ///
     66            /// \param toleranceZ
     67            /// Input Z tolerance to evaluate the spatial condition
     68            /// in case we have 3D geometries
     69            ///
     70            /// \return
     71            /// Returns the evaluation of spatial operation.
     72            ///
     73            FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1, FdoSpatialOperations op, FdoIGeometry* g2, double toleranceXY = 1e-10, double toleranceZ = 1e-10); 
     74}}}
     75
     76
     77== Managed FDO API ==
     78
     79The FDO Managed Interfaces will be updated in a similar manner to reflect the proposed changes (adding a new function which takes an additional parameter named tolerance).
     80
     81== Provider Implementation ==
     82
     83Initially, we need this for SQLite provider. Other provider developers can use it and use it as needed. No change is required in other providers. SQLite provider must 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, and we have to add tolerances. The old versions of 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).
     84This 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.
     85FDO spatial API had no way to pass tolerances and it used an internal hard-coded one making impossible for providers like SQLite to evaluate spatial queries having a certain tolerance.
     86
     87== Test Plan ==
     88
     89Run existing FDO core unit tests and expand SQLite unit tests to test the proposed enhancements defined above.
     90
     91== Funding/Resources ==
     92
     93Autodesk to provide resources / funding.