MapLink Pro 11.1.2.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches
TSLGPkgFeatureTable Class Reference
Inheritance diagram for TSLGPkgFeatureTable:

Detailed Description

This class encapsulates the functionality associated with a geopackage feature table.

It provides the ability to query vector data from the table, information about the table structure, and allows an application to access raw data from the table via the TSLGPkgFeatureIterator class.

Geometry queries can be filtered based on a supplied extent, or by directly providing an SQL statement to execute.

Public Member Functions

const char * getAttributeColumnNameAt (int index) const
 
TSLGPkgFeatureIteratorgetFeatureIterator (double tmcPerMU, TSLDataHandler *dataHandler=NULL) const
 
TSLEntitySetgetGeometryBySQL (const char *sqlStatement, double tmcPerMU, TSLGPkgFeatureCallback *featureCallback=NULL, TSLDataHandler *dataHandler=NULL, TSLMUExtent *extent=NULL) const
 
TSLEntitySetgetGeometryByExtent (const TSLMUExtent &extent, double tmcPerMU, TSLGPkgFeatureCallback *featureCallback=NULL, TSLDataHandler *dataHandler=NULL) const
 
int numberOfItems () const
 
int numberOfAttributeColumns () const
 
- Public Member Functions inherited from TSLGPkgContentTable
const char * name () const
 
const char * description () const
 
const TSLMUExtentgetMUExtent () const
 
const char * lastChange () const
 
const char * identifier () const
 
const TSLGPkgMetadataContainerqueryMetadata () const
 
const TSLCoordinateSystemquerySpatialReferenceSystem () const
 
TSLGPkgContentTableTypeEnum type () const
 

Member Function Documentation

◆ getAttributeColumnNameAt()

const char * TSLGPkgFeatureTable::getAttributeColumnNameAt ( int index) const

Query the name of an attribute column.

The mandatory ID and Geometry columns are not excluded from this query.

Parameters
indexThe index of the column to query.
Returns
the name of the column at the index provided, or NULL if the requested column does not exist.

◆ getFeatureIterator()

TSLGPkgFeatureIterator * TSLGPkgFeatureTable::getFeatureIterator ( double tmcPerMU,
TSLDataHandler * dataHandler = NULL ) const

Returns an iterator that allows the application to iterate through the contents of the feature table.

The iterator is owned by the application and should be deleted when no longer required.

Parameters
tmcPerMUThe TMC->Map Unit scaling factor to use when converting the geometry to a TSLEntity.
dataHandlerAn optional data handler. If provided, the iterator will populate the TSLDataSet of each geometry item returned from the iterator with any attribute columns present in the feature table. If the data handler provided does not contain definitions for any of the attribute columns present in the feature table they will be automatically added to the data handler.

◆ getGeometryByExtent()

TSLEntitySet * TSLGPkgFeatureTable::getGeometryByExtent ( const TSLMUExtent & extent,
double tmcPerMU,
TSLGPkgFeatureCallback * featureCallback = NULL,
TSLDataHandler * dataHandler = NULL ) const

Returns all geometry in the feature table that intersects the given extent. If no geometry is within the extent, this method returns NULL.

The application owns the returned entity set.

Parameters
extentThe extent to return geometry for.
tmcPerMUThe scaling factor to use to use when converting geometry from the GeoPackage native format to MapLink entity geometry types. For data in lat/lon a value of approximately 5,000,000 is reasonable, while for data in a world-scale meter-based coordinate system a value of 50 is reasonable.
featureCallbackAn optional callback that will be invoked for each geometry item read from the database. This can be used to alter the geometry as it is loaded from the GeoPackage.
dataHandlerAn optional data handler. If provided, the iterator will populate the TSLDataSet of each geometry item returned from the iterator with any attribute columns present in the feature table. If the data handler provided does not contain definitions for any of the attribute columns present in the feature table they will be automatically added to the data handler.

◆ getGeometryBySQL()

TSLEntitySet * TSLGPkgFeatureTable::getGeometryBySQL ( const char * sqlStatement,
double tmcPerMU,
TSLGPkgFeatureCallback * featureCallback = NULL,
TSLDataHandler * dataHandler = NULL,
TSLMUExtent * extent = NULL ) const

Executes the SQL statement contained in the parameter string and returns the matching geometry from this feature table as a TSLEntitySet. If the query returns with no results, NULL is returned.

The application owns the returned entity set.

Parameters
sqlStatementThe SQL statement to execute on the GeoPackage.
tmcPerMUThe scaling factor to use to use when converting geometry from the GeoPackage native format to MapLink entity geometry types. For data in lat/lon a value of approximately 5,000,000 is reasonable, while for data in a world-scale meter-based coordinate system a value of 50 is reasonable.
featureCallbackAn optional callback that will be invoked for each geometry item read from the database. This can be used to alter the geometry as it is loaded from the GeoPackage.
dataHandlerAn optional data handler. If provided, the iterator will populate the TSLDataSet of each geometry item returned from the iterator with any attribute columns present in the feature table. If the data handler provided does not contain definitions for any of the attribute columns present in the feature table they will be automatically added to the data handler.
extentAn optional query extent. If provided, only geometry that intersects the given extent will be returned.

◆ numberOfAttributeColumns()

int TSLGPkgFeatureTable::numberOfAttributeColumns ( ) const

Returns the number of columns in the feature table.

Each table has an mandatory ID column and a Geometry column. Additional column entries represent Attribute data describing the feature.

The contents of these columns may be queried via the feature iterator.

◆ numberOfItems()

int TSLGPkgFeatureTable::numberOfItems ( ) const

Returns the number of Items in the feature table.