Skip to content
Permalink
Browse files

Remove deprecated units from QGis

- DecimalDegrees
- DegreesMinutesSeconds
- DegreesDecimalMinutes

all these were replaced long ago by QGis::Degrees
  • Loading branch information
nyalldawson committed Jul 16, 2016
1 parent 2b8b979 commit 59aed7b2318f2802bd96f4ae9fa5dcd5882a3e59
Showing with 4 additions and 20 deletions.
  1. +2 −0 doc/api_break.dox
  2. +0 −6 python/core/qgis.sip
  3. +2 −2 src/analysis/vector/qgstransectsample.cpp
  4. +0 −6 src/core/qgis.h
  5. +0 −6 src/core/qgsunittypes.cpp
@@ -50,6 +50,8 @@ This page tries to maintain a list with incompatible changes that happened in pr
<li>permissiveToDouble() and permissiveToInt() where moved out of the QGis class and renamed to qgsPermissiveToDouble() and
qgsPermissiveToInt()</li>
<li>The constants DEFAULT_IDENTIFY_RADIUS and MINIMUM_POINT_SIZE were removed</li>
<li>QGis::DecimalDegrees, DegreesMinutesSeconds and DegreesDecimalMinutes have been removed, and have all been replaced
with the general Degrees unit</li>
</ul>

\subsection qgis_api_break_3_0_QgsAuthConfigUriEdit QgsAuthConfigUriEdit
@@ -151,13 +151,7 @@ class Qgis
Kilometers, /*!< kilometers */
Yards, /*!< imperial yards */
Miles, /*!< terrestial miles */

UnknownUnit, /*!< unknown distance unit */

// for [1.4;1.8] api compatibility
DecimalDegrees, // was 2
DegreesMinutesSeconds, // was 4
DegreesDecimalMinutes, // was 5
};

//! Provides the canonical name of the type value
@@ -181,7 +181,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
double minDistanceLayerUnits = minDistance;
//if minDistance is in meters and the data in degrees, we need to apply a rough conversion for the buffer distance
double bufferDist = bufferDistance( minDistance );
if ( mMinDistanceUnits == Meters && mStrataLayer->crs().mapUnits() == Qgis::DecimalDegrees )
if ( mMinDistanceUnits == Meters && mStrataLayer->crs().mapUnits() == Qgis::Degrees )
{
minDistanceLayerUnits = minDistance / 111319.9;
}
@@ -710,7 +710,7 @@ double QgsTransectSample::bufferDistance( double minDistanceFromAttribute ) cons
bufferDist = mBaselineBufferDistance;
}

if ( mMinDistanceUnits == Meters && mStrataLayer->crs().mapUnits() == Qgis::DecimalDegrees )
if ( mMinDistanceUnits == Meters && mStrataLayer->crs().mapUnits() == Qgis::Degrees )
{
bufferDist /= 111319.9;
}
@@ -165,13 +165,7 @@ class CORE_EXPORT Qgis
Kilometers = 8, /*!< kilometers */
Yards = 9, /*!< imperial yards */
Miles = 10, /*!< terrestial miles */

UnknownUnit = 3, /*!< unknown distance unit */

// for [1.4;1.8] api compatibility
DecimalDegrees = 2, // was 2
DegreesMinutesSeconds = 2, // was 4
DegreesDecimalMinutes = 2, // was 5
};

//! Provides the canonical name of the type value
@@ -217,12 +217,6 @@ double QgsUnitTypes::fromUnitToUnitFactor( Qgis::UnitType fromUnit, Qgis::UnitTy
#define YARDS_TO_METER 0.9144
#define YARDS_TO_FEET 3.0
#define MILES_TO_METER 1609.344
// Unify degree units
// remove for QGIS 3.0, as extra degree types will be removed
if ( fromUnit == Qgis::DecimalDegrees || fromUnit == Qgis::DegreesMinutesSeconds || fromUnit == Qgis::DegreesDecimalMinutes )
fromUnit = Qgis::Degrees;
if ( toUnit == Qgis::DecimalDegrees || toUnit == Qgis::DegreesMinutesSeconds || toUnit == Qgis::DegreesDecimalMinutes )
toUnit = Qgis::Degrees;

// Calculate the conversion factor between the specified units
switch ( fromUnit )

0 comments on commit 59aed7b

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