Changes between Version 36 and Version 37 of rfc61_support_for_measured_geometries
- Timestamp:
- Feb 3, 2016, 6:31:37 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
rfc61_support_for_measured_geometries
v36 v37 90 90 The property int nCoordinateDimension in class OGRGeometry will be replaced by int flags. It may have the following flags: 91 91 {{{ 92 #define OGR_G_NOT_EMPTY 0x192 #define OGR_G_NOT_EMPTY_POINT 0x1 93 93 #define OGR_G_3D 0x2 94 94 #define OGR_G_MEASURED 0x4 95 95 #define OGR_G_IGNORE_MEASURED 0x8 96 96 }}} 97 The "ignore" flag is needed internally for backwards compatibility. 97 The "ignore" flag is needed internally for backwards compatibility. The flag OGR_G_NOT_EMPTY_POINT is used only to denote the emptiness of an OGRPoint object. 98 98 99 99 Currently a hack to set nCoordDimension negative is used to denote an empty point. … … 104 104 105 105 {{{ 106 IsEmpty = !(flags & OGR_G_NOT_EMPTY)107 106 Is3D = flags & OGR_G_3D 108 107 IsMeasured = flags & OGR_G_MEASURED … … 111 110 The setters and getters are implemented with |= and &=. 112 111 113 The !IsEmpty method is needed only in the base class but the emptiness needs to be managed in all classes. It needs to be decided but when any of these flags is set, the corresponding data becomes invalid and may be discarded. 114 115 Keep the following methods with original semantics, i.e., coordinate dimension is 2 or 3, but deprecate. There is some discrepancy in documentation. Their documentation says that they may return zero for empty points while in ogrpoint.cpp it says that negative nCoordDimension values are used for empty points and the getCoordinateDimension method of point returns absolute value of nCoordDimension - thus not zero. 112 When any of these flags is set or unset, the corresponding data becomes invalid and may be discarded. 113 114 Keep the following methods with original semantics, i.e., coordinate dimension is 2 or 3, but deprecate. There is some discrepancy in documentation. Their documentation says that they may return zero for empty points while in ogrpoint.cpp it says that negative nCoordDimension values are used for empty points and the getCoordinateDimension method of point returns absolute value of nCoordDimension - thus not zero. A fix to the doc is probably enough. 115 116 116 {{{ 117 117 int getCoordinateDimension(); … … 136 136 virtual void set3D(OGRBoolean bIs3D); 137 137 virtual void setMeasured(OGRBoolean bIsMeasured); 138 int getFlags() const;139 int setFlags( int newFlags ) const;138 virtual int getFlags() const; 139 virtual int setFlags( int newFlags ); 140 140 141 141 //Add now or later methods: … … 143 143 virtual OGRGeometry *LocateBetween(double mStart, double mEnd); 144 144 145 // Change the semantics of importPreambuleFromWkb: b3D is not used, the flags are managed within the method145 //Remove b3D from importPreambuleFromWkb: it is not used, the flags are managed within the method. 146 146 }}} 147 147 … … 236 236 Once the support for M coordinates is in place the driver will advertise the support. 237 237 238 Within the work of this RFC the support is built into shape and pg. Support for other drivers are left for further work.238 Within the work of this RFC the support is built into memory, shape and pg drivers. Support for other drivers are left for further work. 239 239 240 240 == Utilities == … … 273 273 ICreateLayer, which all drivers that have create layer capability implement, have geometry type as an argument. The method should call CPLError() with CPLE_NotSupported and return NULL if the driver does not support measures. Similarly for ICreateFeature and ISetFeature. 274 274 275 The re is a question whether the user-oriented API functions (!CreateLayer, !CreateFeature, and !SetFeature) should (silently) strip out the measures before continuing to the I* methods. This (side effect) may not be what is wanted in some usage scenarios but it would follow the pattern of what is already done with non linear geometries.275 The user-oriented API functions (!CreateLayer, !CreateFeature, and !SetFeature) should (silently) strip out the measures before continuing to the I* methods in drivers that do not support measures. This (side effect) may not be what is wanted in some usage scenarios but it would follow the pattern of what is already done with nonlinear geometries. This should be documented. 276 276 277 277 An alternative would be to store M value(s) (or WKT or WKB) as attribute (scalar or vector, depending on the geometry type). 278 278 279 279 Needs a decision. 280 281 Some incompatibilities will necessarily be introduced. For example when the current XYM-as-XYZ hack in shape will be replaced by proper XYM. 280 282 281 283 == Related tickets ==