Skip to content

Commit

Permalink
Add square nautical miles as a supported areal unit, add API
Browse files Browse the repository at this point in the history
method for converting a distance unit to corresponding area unit
  • Loading branch information
nyalldawson committed Feb 15, 2016
1 parent bd3bbc4 commit 35c2d18
Show file tree
Hide file tree
Showing 4 changed files with 344 additions and 78 deletions.
7 changes: 7 additions & 0 deletions python/core/qgsunittypes.sip
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class QgsUnitTypes
SquareMiles, /*!< square miles */
Hectares, /*!< hectares */
Acres, /*!< acres */
SquareNauticalMiles, /*!< square nautical miles */
SquareDegrees, /*!< square degrees, for planar geographic CRS area measurements */
UnknownAreaUnit, /*!< unknown areal unit */
};
Expand Down Expand Up @@ -113,5 +114,11 @@ class QgsUnitTypes
*/
static double fromUnitToUnitFactor( AreaUnit fromUnit, AreaUnit toUnit );

/** Converts a distance unit to its corresponding area unit, eg meters to square meters
* @param distanceUnit distance unit to convert
* @return matching areal unit
*/
static AreaUnit distanceToAreaUnit( QGis::UnitType distanceUnit );

};

Loading

0 comments on commit 35c2d18

Please sign in to comment.