GDAL
|
Geometry coordinate precision. More...
#include <ogr_geomcoordinateprecision.h>
Public Member Functions | |
void | SetFromMeter (const OGRSpatialReference *poSRS, double dfXYMeterResolution, double dfZMeterResolution, double dfMResolution) |
Set the resolution of the geometry coordinate components. | |
OGRGeomCoordinatePrecision | ConvertToOtherSRS (const OGRSpatialReference *poSRSSrc, const OGRSpatialReference *poSRSDst) const |
Return equivalent coordinate precision setting taking into account a change of SRS. | |
Static Public Member Functions | |
static int | ResolutionToPrecision (double dfResolution) |
Return the number of decimal digits after the decimal point to get the specified resolution. | |
Public Attributes | |
double | dfXYResolution = UNKNOWN |
Resolution for the coordinate precision of the X and Y coordinates. | |
double | dfZResolution = UNKNOWN |
Resolution for the coordinate precision of the Z coordinate. | |
double | dfMResolution = UNKNOWN |
Resolution for the coordinate precision of the M coordinate. | |
std::map< std::string, CPLStringList > | oFormatSpecificOptions {} |
Map from a format name to a list of format specific options. | |
Static Public Attributes | |
static constexpr double | UNKNOWN = 0 |
Constant for a UNKNOWN resolution. | |
Geometry coordinate precision.
This may affect how many decimal digits (for text-based output) or bits (for binary encodings) are used to encode geometries.
It is important to note that the coordinate precision has no direct relationship with the "physical" accuracy. It is generally advised that the resolution (precision) be at least 10 times smaller than the accuracy.
OGRGeomCoordinatePrecision OGRGeomCoordinatePrecision::ConvertToOtherSRS | ( | const OGRSpatialReference * | poSRSSrc, |
const OGRSpatialReference * | poSRSDst | ||
) | const |
Return equivalent coordinate precision setting taking into account a change of SRS.
poSRSSrc | Spatial reference system of the current instance (if null, meter unit is assumed) |
poSRSDst | Spatial reference system of the returned instance (if null, meter unit is assumed) |
|
static |
Return the number of decimal digits after the decimal point to get the specified resolution.
void OGRGeomCoordinatePrecision::SetFromMeter | ( | const OGRSpatialReference * | poSRS, |
double | dfXYMeterResolution, | ||
double | dfZMeterResolution, | ||
double | dfMResolutionIn | ||
) |
Set the resolution of the geometry coordinate components.
For the X, Y and Z coordinates, the precision should be expressed in meter, e.g 1e-3 for millimetric precision.
Resolution should be stricty positive, or set to OGRGeomCoordinatePrecision::UNKNOWN when unknown.
poSRS | Spatial reference system, used for metric to SRS unit conversion (must not be null) |
dfXYMeterResolution | Resolution for for X and Y coordinates, in meter. |
dfZMeterResolution | Resolution for for Z coordinates, in meter. |
dfMResolutionIn | Resolution for for M coordinates. |
double OGRGeomCoordinatePrecision::dfMResolution = UNKNOWN |
Resolution for the coordinate precision of the M coordinate.
Set to UNKNOWN if unknown.
double OGRGeomCoordinatePrecision::dfXYResolution = UNKNOWN |
Resolution for the coordinate precision of the X and Y coordinates.
Expressed in the units of the X and Y axis of the SRS. For example for a projected SRS with X,Y axis unit in meter, a value of 1e-3 corresponds to a 1 mm precision. For a geographic SRS (on Earth) with axis unit in degree, a value of 8.9e-9 (degree) also corresponds to a 1 mm precision. Set to UNKNOWN if unknown.
double OGRGeomCoordinatePrecision::dfZResolution = UNKNOWN |
Resolution for the coordinate precision of the Z coordinate.
Expressed in the units of the Z axis of the SRS. Set to UNKNOWN if unknown.
std::map<std::string, CPLStringList> OGRGeomCoordinatePrecision::oFormatSpecificOptions {} |
Map from a format name to a list of format specific options.
This can be for example used to store FileGeodatabase xytolerance, xorigin, yorigin, etc. coordinate precision grids options, which can be help to maximize preservation of coordinates in FileGDB -> FileGDB conversion processes.