GDAL
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OGRGeomCoordinatePrecision Struct Reference

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, CPLStringListoFormatSpecificOptions {}
 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.
 

Detailed Description

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.

Since
GDAL 3.9

Member Function Documentation

◆ ConvertToOtherSRS()

OGRGeomCoordinatePrecision OGRGeomCoordinatePrecision::ConvertToOtherSRS ( const OGRSpatialReference poSRSSrc,
const OGRSpatialReference poSRSDst 
) const

Return equivalent coordinate precision setting taking into account a change of SRS.

Parameters
poSRSSrcSpatial reference system of the current instance (if null, meter unit is assumed)
poSRSDstSpatial reference system of the returned instance (if null, meter unit is assumed)
Returns
a new OGRGeomCoordinatePrecision instance, with a poSRSDst SRS.
Since
GDAL 3.9

◆ ResolutionToPrecision()

int OGRGeomCoordinatePrecision::ResolutionToPrecision ( double  dfResolution)
static

Return the number of decimal digits after the decimal point to get the specified resolution.

Since
GDAL 3.9

◆ SetFromMeter()

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.

Parameters
poSRSSpatial reference system, used for metric to SRS unit conversion (must not be null)
dfXYMeterResolutionResolution for for X and Y coordinates, in meter.
dfZMeterResolutionResolution for for Z coordinates, in meter.
dfMResolutionInResolution for for M coordinates.
Since
GDAL 3.9

Member Data Documentation

◆ dfMResolution

double OGRGeomCoordinatePrecision::dfMResolution = UNKNOWN

Resolution for the coordinate precision of the M coordinate.

Set to UNKNOWN if unknown.

◆ dfXYResolution

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.

◆ dfZResolution

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.

◆ oFormatSpecificOptions

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.


The documentation for this struct was generated from the following files: