QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SHPFileHelper Namespace Reference

Functions

bool _validateSHPFiles (const QString &shpFile, int *utmZone, bool *utmSouthernHemisphere, QString &errorString)
SHPHandle _loadShape (const QString &shpFile, int *utmZone, bool *utmSouthernHemisphere, QString &errorString)
ShapeFileHelper::ShapeType determineShapeType (const QString &file, QString &errorString)
int getEntityCount (const QString &shpFile, QString &errorString)
 Get the number of entities in the shapefile.
bool loadPolygonsFromFile (const QString &shpFile, QList< QList< QGeoCoordinate > > &polygons, QString &errorString, double filterMeters=ShapeFileHelper::kDefaultVertexFilterMeters)
bool loadPolylinesFromFile (const QString &shpFile, QList< QList< QGeoCoordinate > > &polylines, QString &errorString, double filterMeters=ShapeFileHelper::kDefaultVertexFilterMeters)
bool loadPointsFromFile (const QString &shpFile, QList< QGeoCoordinate > &points, QString &errorString)
 Load all point entities.

Function Documentation

◆ _loadShape()

SHPHandle SHPFileHelper::_loadShape ( const QString & shpFile,
int * utmZone,
bool * utmSouthernHemisphere,
QString & errorString )
Parameters
utmZone[out]Zone for UTM shape, 0 for lat/lon shape
utmSouthernHemisphere[out]true/false for UTM hemisphere

Definition at line 220 of file SHPFileHelper.cc.

References _validateSHPFiles().

Referenced by determineShapeType(), getEntityCount(), loadPointsFromFile(), loadPolygonsFromFile(), and loadPolylinesFromFile().

◆ _validateSHPFiles()

bool SHPFileHelper::_validateSHPFiles ( const QString & shpFile,
int * utmZone,
bool * utmSouthernHemisphere,
QString & errorString )

Validates the specified SHP file is truly a SHP file and is in the format we understand.

Parameters
utmZone[out]Zone for UTM shape, 0 for lat/lon shape
utmSouthernHemisphere[out]true/false for UTM hemisphere
Returns
true: Valid supported SHP file found, false: Invalid or unsupported file found

Definition at line 155 of file SHPFileHelper.cc.

Referenced by _loadShape().

◆ determineShapeType()

ShapeFileHelper::ShapeType SHPFileHelper::determineShapeType ( const QString & file,
QString & errorString )

Definition at line 240 of file SHPFileHelper.cc.

References _loadShape().

Referenced by ShapeFileHelper::determineShapeType().

◆ getEntityCount()

int SHPFileHelper::getEntityCount ( const QString & shpFile,
QString & errorString )

Get the number of entities in the shapefile.

Definition at line 277 of file SHPFileHelper.cc.

References _loadShape().

Referenced by ShapeFileHelper::getEntityCount().

◆ loadPointsFromFile()

bool SHPFileHelper::loadPointsFromFile ( const QString & shpFile,
QList< QGeoCoordinate > & points,
QString & errorString )

Load all point entities.

Definition at line 501 of file SHPFileHelper.cc.

References _loadShape(), and QGCGeo::convertUTMToGeo().

Referenced by ShapeFileHelper::loadPointsFromFile().

◆ loadPolygonsFromFile()

bool SHPFileHelper::loadPolygonsFromFile ( const QString & shpFile,
QList< QList< QGeoCoordinate > > & polygons,
QString & errorString,
double filterMeters = ShapeFileHelper::kDefaultVertexFilterMeters )

Load all polygon entities

Parameters
filterMetersFilter vertices closer than this distance (0 to disable)

Definition at line 295 of file SHPFileHelper.cc.

References _loadShape(), and QGCGeo::convertUTMToGeo().

Referenced by ShapeFileHelper::loadPolygonsFromFile().

◆ loadPolylinesFromFile()

bool SHPFileHelper::loadPolylinesFromFile ( const QString & shpFile,
QList< QList< QGeoCoordinate > > & polylines,
QString & errorString,
double filterMeters = ShapeFileHelper::kDefaultVertexFilterMeters )

Load all polyline entities

Parameters
filterMetersFilter vertices closer than this distance (0 to disable)

Definition at line 408 of file SHPFileHelper.cc.

References _loadShape(), and QGCGeo::convertUTMToGeo().

Referenced by ShapeFileHelper::loadPolylinesFromFile().