MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLGDALInterop Class Reference

Detailed Description

This utility class provides interoperability between MapLink and GDAL/OGR

This includes functionality to convert between OGR geometry/Coordinate systems and MapLink geometry/coordinate systems, without needing to convert through wkt/wkb.

Static Public Member Functions

static TSLEntityogrGeometryToTSLEntity (const OGRGeometry *ogrGeometry, double TMCPerMU, double mapOffsetX=0.0, double mapOffsetY=0.0, bool multiAsEntitySet=false, double maxCurveAngle=0.0)
 
static TSLMUGeometryogrGeometryToTSLMUGeometry (const OGRGeometry *ogrGeometry, double maxCurveAngle=0.0)
 
static TSLMUGeometryogrFeatureToTSLMUGeometry (OGRFeature *ogrFeature, OGRFeatureDefn *ogrFeatureDefinition, double maxCurveAngle=0.0)
 
static TSLCoordinateSystemogrSpatialReferenceToTSLCoordinateSystem (OGRSpatialReference *spatialReference, unsigned int id=0)
 
static bool transferAttributes (OGRFeature *ogrFeature, OGRFeatureDefn *ogrFeatureDefinition, TSLDataSet *result)
 

Member Function Documentation

◆ ogrFeatureToTSLMUGeometry()

static TSLMUGeometry * TSLGDALInterop::ogrFeatureToTSLMUGeometry ( OGRFeature * ogrFeature,
OGRFeatureDefn * ogrFeatureDefinition,
double maxCurveAngle = 0.0 )
static

Convert an OGR feature to a TSLMUGeometry hierarchy

The geometry of this feature will be converted using ogrGeometryToTSLMUGeometry

In addition the fields and their values will be transferred from the feature, and will be present in the attributes of the created TSLMUGeometry

Parameters
ogrFeatureThe OGR feature to convert. The application is responsible for construction/deletion of this object.
ogrFeatureDefinitionThe feature definition, which defines the fields available on the feature.
maxCurveAngleThe largest step in degrees along an arc when converting curved geometry.
Returns
The converted geometry, or NULL if no geometry could be converted. The application is responsible for deletion of this object.

◆ ogrGeometryToTSLEntity()

static TSLEntity * TSLGDALInterop::ogrGeometryToTSLEntity ( const OGRGeometry * ogrGeometry,
double TMCPerMU,
double mapOffsetX = 0.0,
double mapOffsetY = 0.0,
bool multiAsEntitySet = false,
double maxCurveAngle = 0.0 )
static

Convert OGR geometry to a TSLEntity hierarchy

The following WKB types will be converted:

The coordinate system of the data will not be modified, but the coordinates of each geometry will be scaled according to the TMCPerMU value.

Any invalid geometry will be ignored, and will not be present in the output entity.

Parameters
ogrGeometryThe OGR geometry hierarchy to convert. The application is responsible for construction/deletion of this object.
TMCPerMUThe TMC per Map Unit conversion value to use when converting the geometry.
mapOffsetXThe x coordinate of the MapLink TMC coordinate space for the projected coordinate system, in map units. This can be queried from the TSLCoordinateSystem::getMapOffsets method when creating geometry compatible with a MapLink coordinate system.
mapOffsetYThe y coordinate of the MapLink TMC coordinate space for the projected coordinate system, in map units. This can be queried from the TSLCoordinateSystem::getMapOffsets method when creating geometry compatible with a MapLink coordinate system.
multiAsEntitySetIf true, all multi geometry types will be converted to entity sets. If false the TSLMultiXXX types will be used.
maxCurveAngleThe largest step in degrees along an arc when drawing curved geometry
Returns
The converted geometry, or NULL if the geometry could not be converted. The application is responsible for deletion of this object.

◆ ogrGeometryToTSLMUGeometry()

static TSLMUGeometry * TSLGDALInterop::ogrGeometryToTSLMUGeometry ( const OGRGeometry * ogrGeometry,
double maxCurveAngle = 0.0 )
static

Convert OGR geometry to a TSLMUGeometry hierarchy

The following WKB types will be converted:

The coordinate system of the data will not be modified.

Any invalid geometry will be ignored, and will not be present in the output geometry set. Unsupported geometry types will add an error to the MapLink error stack.

Parameters
ogrGeometryThe OGR geometry hierarchy to convert. The application is responsible for construction/deletion of this object.
maxCurveAngleThe largest step in degrees along an arc when converting curved geometry.
Returns
The converted geometry, or NULL if no geometry could be converted. The application is responsible for deletion of this object.

◆ ogrSpatialReferenceToTSLCoordinateSystem()

static TSLCoordinateSystem * TSLGDALInterop::ogrSpatialReferenceToTSLCoordinateSystem ( OGRSpatialReference * spatialReference,
unsigned int id = 0 )
static

Convert an OGRSpatialReference to an equivalent TSLCoordinateSystem

This method will create a new coordinate system with the specified id. This coordinate system will not automatically be added to the global list,

See also
TSLCorodinateSystem::clone.
Parameters
spatialReferenceThe OGRSpatialReference to convert
idThe ID for the created coordinate system
Returns
The created coordinate system, or NULL if the spatial reference could not be converted. The application is responsible for destruction of the returned TSLCoordinateSystem.

◆ transferAttributes()

static bool TSLGDALInterop::transferAttributes ( OGRFeature * ogrFeature,
OGRFeatureDefn * ogrFeatureDefinition,
TSLDataSet * result )
static

This method copies the attributes from the OGRFeature into the Dataset provided

Parameters
ogrFeatureThe OGR feature to copy attributes from. The application is responsible for construction/deletion of this object.
ogrFeatureDefinitionThe feature definition, which defines the fields available on the feature.
resultThe dataset to copy the attributes to.
Returns
true if all attributes found are added successfully to the dataset.