Changes between Version 17 and Version 18 of FDORfc49


Ignore:
Timestamp:
Jun 16, 2010, 2:09:40 PM (14 years ago)
Author:
romicadascalescu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc49

    v17 v18  
    4545== Proposed Solution ==
    4646
    47 Add two new parameters which by default will be 1e-10. The default tolerance used is 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.
     47We 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.
    4848
    4949{{{
     
    8181            /// Returns the evaluation of spatial operation.
    8282            ///
     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            ///
    8391            FDO_SPATIAL_API static bool Evaluate(FdoIGeometry* g1,
    8492                                                 FdoSpatialOperations op,
    8593                                                 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);
    90101            /// \brief
    91102            /// Tests whether a point is within a ring or not.
     
    105116            /// Returns TRUE if the point is within ring or on its boundary, FALSE otherwise.
    106117            ///
     118            /// Existing Function
     119            ///
    107120            FDO_SPATIAL_API static bool PointInRing(FdoILinearRing* ring,
    108121                                                    double x,
    109122                                                    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);
    112132
    113133            /// \brief
     
    128148            /// Returns TRUE if the point is within polygon or on its boundary, FALSE otherwise.
    129149            ///
     150            /// Existing Function
     151            ///
    130152            FDO_SPATIAL_API static bool PointInPolygon(FdoIPolygon* poly,
    131153                                                       double x,
    132154                                                       double y,
    133155                                                       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);
    136166}}}
    137167
     
    207237    /// Returns TRUE if the point is within ring or on its boundary, FALSE otherwise.
    208238    ///
    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);
    211241
    212242    ///
     
    237267    ///
    238268    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);
    241271}
    242272}}}
     
    244274== Provider Implementation ==
    245275
    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).
     276Initially, 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).
    247277
    248278This 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.