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 219 of file SHPFileHelper.cc.

References _validateSHPFiles(), and errorString.

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 154 of file SHPFileHelper.cc.

References errorString.

Referenced by _loadShape().

◆ determineShapeType()

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

Definition at line 239 of file SHPFileHelper.cc.

References _loadShape(), and errorString.

◆ getEntityCount()

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

Get the number of entities in the shapefile.

Definition at line 276 of file SHPFileHelper.cc.

References _loadShape(), and errorString.

◆ loadPointsFromFile()

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

Load all point entities.

Definition at line 500 of file SHPFileHelper.cc.

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

◆ 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 294 of file SHPFileHelper.cc.

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

◆ 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 407 of file SHPFileHelper.cc.

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