Skip to content
Permalink
Browse files

Add square nautical miles as a supported areal unit, add API

method for converting a distance unit to corresponding area unit
  • Loading branch information
nyalldawson committed Feb 15, 2016
1 parent bd3bbc4 commit 35c2d185fb72bc247d3f6ac1fada04f8a7160752
Showing with 344 additions and 78 deletions.
  1. +7 −0 python/core/qgsunittypes.sip
  2. +306 −70 src/core/qgsunittypes.cpp
  3. +7 −0 src/core/qgsunittypes.h
  4. +24 −8 tests/src/python/test_qgsunittypes.py
@@ -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 */
};
@@ -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 );

};

0 comments on commit 35c2d18

Please sign in to comment.
You can’t perform that action at this time.