![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class is used for loading GML instance data into a MapLink TSLStandard DataLayer.
There are 3 main ways of loading a GML instance data document:
Furthermore, the instance data can be provided in one of the following 3 ways:
Through the other methods of this class, certain other aspects of the loading may be altered. These include:
Public Member Functions | |
TSLGMLInstanceDataLoader () | |
void | destroy () |
bool | getTransverseMercatorJHSFormula () const |
bool | load (const char *location, const TSLGMLApplicationSchema *schema, TSLStandardDataLayer *destination, TSLCoordinateSystem *&coordinateSystem) |
bool | load (const char *location, TSLStandardDataLayer *destination, TSLCoordinateSystem *&coordinateSystem, TSLGMLApplicationSchemaLoader *schemaLoader, TSLGMLApplicationSchema **schema=0) |
bool | load (const char *location, TSLStandardDataLayer *destination, TSLCoordinateSystem *&coordinateSystem) |
bool | loadFromBuffer (const unsigned char *buffer, unsigned int bufferLen, const TSLGMLApplicationSchema *schema, TSLStandardDataLayer *destination, TSLCoordinateSystem *&coordinateSystem) |
bool | loadFromBuffer (const unsigned char *buffer, unsigned int bufferLen, TSLStandardDataLayer *destination, TSLCoordinateSystem *&coordinateSystem, const char *location, TSLGMLApplicationSchemaLoader *schemaLoader, TSLGMLApplicationSchema **schema=0) |
bool | loadFromBuffer (const unsigned char *buffer, unsigned int bufferLen, TSLStandardDataLayer *destination, TSLCoordinateSystem *&coordinateSystem) |
void | mapUnitShiftX (double value) |
double | mapUnitShiftX () const |
void | mapUnitShiftY (double value) |
double | mapUnitShiftY () const |
const TSLGMLPropertyMapping * | propertyMapping () const |
void | propertyMapping (const TSLGMLPropertyMapping *newMapping) |
const TSLGMLPropertyMappingSet * | propertyMappingSet () const |
void | propertyMappingSet (const TSLGMLPropertyMappingSet *newMappingSet) |
void | setTransverseMercatorJHSFormula (bool jhs) |
bool | swapXandY () const |
void | swapXandY (bool value) |
void | tmcPerMU (double value) |
double | tmcPerMU () const |
void | unhandledFeatureCallback (TSLGMLUnhandledFeatureCallback *callback) |
const TSLGMLUnhandledFeatureCallback * | unhandledFeatureCallback () const |
void | useDynamicArcForWGS84 (bool useDynamicArc) |
void * | operator new (size_t size) |
void * | operator new (size_t size, char *filename, int line) |
TSLGMLInstanceDataLoader::TSLGMLInstanceDataLoader | ( | ) |
void TSLGMLInstanceDataLoader::destroy | ( | ) |
Destroy this object.
This method must be used instead of delete.
bool TSLGMLInstanceDataLoader::getTransverseMercatorJHSFormula | ( | ) | const |
Queries if the Transverse Mercator JHS formula is to be used when data is in a Transverse Mercator projection.
The setting will be used to create a local Coordinate System to place the retrieved data. If the setting is changed after the layer has been configured or during layer configuration you may either end up using the USGS Snyder or JHS formula, which you end up with is undefined in these cases.
The default setting is to use the USGS Snyder formula.
Returns true if the layer is set to use the JHS formula for Transverse Mercator.
bool TSLGMLInstanceDataLoader::load | ( | const char * | location, |
const TSLGMLApplicationSchema * | schema, | ||
TSLStandardDataLayer * | destination, | ||
TSLCoordinateSystem *& | coordinateSystem ) |
Loads the instance data from the path specified in the location parameter. The TSLStandardDataLayer passed in the destination parameter will be populated with the data imported from the instance data. The pre-parsed schema definition passed in the schema parameter will be used when loading the data - regardless of whether the instance data contains a schema reference.
The schema definition will be added to the standard data layer's data handler and feature class list if this has not already occurred.
location | The location to load the schema from. This may be a file system path or a url. |
schema | The pre-parsed schema that the instance data conforms to. |
destination | This standard data layer will be populated with the feature instance data and feature definitions. |
coordinateSystem | This parameter will be populated with the common coordinate system used in the instance data. The user assumes ownership of the coordinate system and should call its destroy method when it is no longer required. |
bool TSLGMLInstanceDataLoader::load | ( | const char * | location, |
TSLStandardDataLayer * | destination, | ||
TSLCoordinateSystem *& | coordinateSystem ) |
Loads the instance data from the path specified in the location parameter. The TSLStandardDataLayer passed in the destination parameter will be populated with the data imported from the instance data.
Regardless of whether the instance data contain a reference to a schema, no schema shall be used when loading the instance data.
location | The location to load the schema from. This may be a file system path or a url. |
destination | This standard data layer will be populated with the feature instance data and feature definitions. |
coordinateSystem | This parameter will be populated with the common coordinate system used in the instance data. The user assumes ownership of the coordinate system and should call its destroy method when it is no longer required. |
bool TSLGMLInstanceDataLoader::load | ( | const char * | location, |
TSLStandardDataLayer * | destination, | ||
TSLCoordinateSystem *& | coordinateSystem, | ||
TSLGMLApplicationSchemaLoader * | schemaLoader, | ||
TSLGMLApplicationSchema ** | schema = 0 ) |
Loads the instance data from the path specified in the location parameter. The TSLStandardDataLayer passed in the destination parameter will be populated with the data imported from the instance data.
Should the instance data contain a reference to a schema, then it will be loaded using the passed schema loader and returned to the user in the schema parameter.
location | The location to load the schema from. This may be a file system path or a url. |
destination | This standard data layer will be populated with the feature instance data and feature definition. |
coordinateSystem | This parameter will be populated with the common coordinate system used in the instance data. The user assumes ownership of the coordinate system and should call its destroy method when it is no longer required. |
schemaLoader | This schema loader will be used when loading the schema should the instance data reference one. If the user does not provide a schema loader, a stock loader shall be used. |
schema | Should the user wish to retain the schema definition for the loading of additional instance data, then they should pass a pointer to be populated with the definition loaded. The user assumes ownership of the schema definition and should delete it when it is no longer needed. If the instance data does not contain a reference to a schema, then the passed pointer will be pointed at NULL. |
bool TSLGMLInstanceDataLoader::loadFromBuffer | ( | const unsigned char * | buffer, |
unsigned int | bufferLen, | ||
const TSLGMLApplicationSchema * | schema, | ||
TSLStandardDataLayer * | destination, | ||
TSLCoordinateSystem *& | coordinateSystem ) |
Loads the instance data from the passed buffer. The TSLStandardDataLayer passed in the destination parameter will be populated with the data imported from the instance data. The pre-parsed schema definition passed in the schema parameter will be used when loading the data - regardless of whether the instance data contains a schema reference.
The schema definition will be added to the standard data layer's data handler and feature class list if this has not already occurred.
buffer | The buffer containing the instance data. |
bufferLen | The length of the buffer passed. |
schema | The pre-parsed schema that the instance data conforms to. |
destination | This standard data layer will be populated with the feature instance data and feature definitions. |
coordinateSystem | This parameter will be populated with the common coordinate system used in the instance data. The user assumes ownership of the coordinate system and should call its destroy method when it is no longer required. |
bool TSLGMLInstanceDataLoader::loadFromBuffer | ( | const unsigned char * | buffer, |
unsigned int | bufferLen, | ||
TSLStandardDataLayer * | destination, | ||
TSLCoordinateSystem *& | coordinateSystem ) |
Loads the instance data from the passed buffer. The TSLStandardDataLayer passed in the destination parameter will be populated with the data imported from the instance data.
Regardless of whether the instance data contain a reference to a schema, no schema shall be used when loading the instance data.
buffer | The buffer containing the instance data. |
bufferLen | The length of the buffer passed. |
destination | This standard data layer will be populated with the feature instance data and feature definitions. |
coordinateSystem | This parameter will be populated with the common coordinate system used in the instance data. The user assumes ownership of the coordinate system and should call its destroy method when it is no longer required. |
bool TSLGMLInstanceDataLoader::loadFromBuffer | ( | const unsigned char * | buffer, |
unsigned int | bufferLen, | ||
TSLStandardDataLayer * | destination, | ||
TSLCoordinateSystem *& | coordinateSystem, | ||
const char * | location, | ||
TSLGMLApplicationSchemaLoader * | schemaLoader, | ||
TSLGMLApplicationSchema ** | schema = 0 ) |
Loads the instance data from the passed buffer. The TSLStandardDataLayer passed in the destination parameter will be populated with the data imported from the instance data.
Should the instance data contain a reference to a schema, then it will be loaded using the passed schema loader and returned to the user in the schema parameter.
buffer | The buffer containing the instance data. |
bufferLen | The length of the buffer passed. |
destination | This standard data layer will be populated with the feature instance data and feature definition. |
coordinateSystem | This parameter will be populated with the common coordinate system used in the instance data. The user assumes ownership of the coordinate system and should call its destroy method when it is no longer required. |
location | If the instance data contains a relative path to the schema location, this location will be used to location it. Its value should be the original location that the instance data was retrieved from. Null may be passed for this argument, but should the instance data used a relative path then the call will fail. |
schemaLoader | This schema loader will be used when loading the schema should the instance data reference one. If the user does not provide a schema loader, a stock loader shall be used. |
schema | Should the user wish to retain the schema definition for the loading of additional instance data, then they should pass a pointer to be populated with the definition loaded. The user assumes ownership of the schema definition and should delete it when it is no longer needed. If the instance data does not contain a reference to a schema, then the passed pointer will be pointed at NULL. |
double TSLGMLInstanceDataLoader::mapUnitShiftX | ( | ) | const |
Get the number of number of Map Units to offset the x-origin of TMC space, when importing instance data.
By default, this value will be 0.
void TSLGMLInstanceDataLoader::mapUnitShiftX | ( | double | value | ) |
Set the number of number of Map Units to offset the x-origin of TMC space, when importing instance data.
By default, this value will be 0.
value | The new value to use. |
double TSLGMLInstanceDataLoader::mapUnitShiftY | ( | ) | const |
Get the number of number of Map Units to offset the y-origin of TMC space, when importing instance data.
By default, this value will be 0.
void TSLGMLInstanceDataLoader::mapUnitShiftY | ( | double | value | ) |
Set the number of number of Map Units to offset the y-origin of TMC space, when importing instance data.
By default, this value will be 0.
value | The new value to use. |
void * TSLGMLInstanceDataLoader::operator new | ( | size_t | size | ) |
void * TSLGMLInstanceDataLoader::operator new | ( | size_t | size, |
char * | filename, | ||
int | line ) |
When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.
const TSLGMLPropertyMapping * TSLGMLInstanceDataLoader::propertyMapping | ( | ) | const |
Queries the current property mapping object set on the loader. The current property mapping can be set via the other propertyMapping method.
Rather than adding the properties of each GML feature instance as attributes to the corresponding MapLink entity's data sets, a mapping can be provide so that they are instead used to populated rendering attributes or property of the entity, such as its name or entity id.
There are 3 possible ways of using a mapping or mapping set:
void TSLGMLInstanceDataLoader::propertyMapping | ( | const TSLGMLPropertyMapping * | newMapping | ) |
Sets the current property mapping object set on the loader. The current property mapping can be queried via the other propertyMapping method.
By setting a property mapping, and previously set property mapping or property mapping set will be cleared.
Rather than adding the properties of each GML feature instance as attributes to the corresponding MapLink entity's data sets, a mapping can be provide so that they are instead used to populated rendering attributes or property of the entity, such as its name or entity id.
There are 3 possible ways of using a mapping or mapping set:
newMapping | The new mapping to set. A copy of the object passed will be taken if the object is valid. Null may be passed to clear the current property mapping. |
const TSLGMLPropertyMappingSet * TSLGMLInstanceDataLoader::propertyMappingSet | ( | ) | const |
Queries the current property mapping set object held on the loader. The current property mapping set can be set via the other propertyMappingSet method.
Rather than adding the properties of each GML feature instance as attributes to the corresponding MapLink entity's data sets, a mapping can be provide so that they are instead used to populated rendering attributes or property of the entity, such as its name or entity id.
There are 3 possible ways of using a mapping or mapping set:
void TSLGMLInstanceDataLoader::propertyMappingSet | ( | const TSLGMLPropertyMappingSet * | newMappingSet | ) |
Sets the current property mapping set object held on the loader. The current property mapping set can be queried via the other propertyMappingSet method.
By setting a property mapping set, any previously set property mapping or property mapping set will be cleared.
Rather than adding the properties of each GML feature instance as attributes to the corresponding MapLink entity's data sets, a mapping can be provide so that they are instead used to populated rendering attributes or property of the entity, such as its name or entity id.
There are 3 possible ways of using a mapping or mapping set:
newMappingSet | The new mapping set to set. A copy of the object passed will be taken if the object is valid. Null may be passed to clear the current property mapping set. |
void TSLGMLInstanceDataLoader::setTransverseMercatorJHSFormula | ( | bool | jhs | ) |
If passed true then the Transverse Mercator JHS formula will be used when using processing data in a Transverse Mercator projection.
The setting will be used to create the Coordinate System returned as part of the load method.
The default setting is to use the USGS Snyder formula.
jhs | pass true to use the JHS formula, pass false to use the USGS Snyder formula. |
bool TSLGMLInstanceDataLoader::swapXandY | ( | ) | const |
if the swapXandY flag is true, then GML geometry will be loaded with the X and Y positions swapped around. By default this flag's value is false.
This method queries the value of the flag.
void TSLGMLInstanceDataLoader::swapXandY | ( | bool | value | ) |
if the swapXandY flag is true, then GML geometry will be loaded with the X and Y positions swapped around. By default this flag's value is false.
This method sets the value of the flag.
double TSLGMLInstanceDataLoader::tmcPerMU | ( | ) | const |
Get the number of TMCs per Map Unit that will be used when importing instance data.
By default, this value will be 50.
void TSLGMLInstanceDataLoader::tmcPerMU | ( | double | value | ) |
Set the number of TMCs per Map Unit that will be used when importing instance data.
By default, this value will be 50.
value | The new value to use. |
If new value provided is 0.0 or negative, then the call will be ignored.
const TSLGMLUnhandledFeatureCallback * TSLGMLInstanceDataLoader::unhandledFeatureCallback | ( | ) | const |
Get the unhandled feature callback used by the instance data loader.
The callback instance's method will be called whenever the loader encounters a feature that it cannot process. This may occur in the following scenarios:
When one of these scenarios occurs, a subset of the original instance data containing the feature instance in question is passed to the user. The XML instance data will be fully formatted.
void TSLGMLInstanceDataLoader::unhandledFeatureCallback | ( | TSLGMLUnhandledFeatureCallback * | callback | ) |
Set the unhandled feature callback used by the instance data loader.
The callback instance's method will be called whenever the loader encounters a feature that it cannot process. This may occur in the following scenarios:
When one of these scenarios occurs, a subset of the original instance data containing the feature instance in question is passed to the user. The XML instance data will be fully formatted.
NOTE: The user retains ownership of the callback instance.
callback | The new callback to set. Pass null to clear the existing callback. |
void TSLGMLInstanceDataLoader::useDynamicArcForWGS84 | ( | bool | useDynamicArc | ) |
Controls whether the instance loader should treat EPSG:4326 and CRS:84 coordinate systems as Dynamic Arc.
If true, when loading data in either the EPSG:4326 or CRS:84 coordinate systems the instance loader will use a Dynamic Arc coordinate system when converting the GML to MapLink entities and the returned coordinate system from the coordinateSystem argument of the load() methods will be a Dynamic Arc coordinate system. If false, the instance loader will create and return a WGS84 coordinate system instead.
The default is to use a Dynamic Arc coordinate system to represent EPSG:4326 and CRS:84.