Skip to content

Commit

Permalink
Use Cartesian instead of cartesian
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and m-kuhn committed Jul 13, 2017
1 parent cfbed91 commit 99ea2e8
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions python/core/expression/qgsexpression.sip
Expand Up @@ -270,9 +270,9 @@ expression() instead.
Sets the geometry calculator used for distance and area calculations in expressions.
(used by $length, $area and $perimeter functions only). By default, no geometry
calculator is set and all distance and area calculations are performed using simple
cartesian methods (ie no ellipsoidal calculations).
Cartesian methods (ie no ellipsoidal calculations).
\param calc geometry calculator. Ownership is not transferred. Set to a None to force
cartesian calculations.
Cartesian calculations.
.. seealso:: geomCalculator()
%End

Expand Down
6 changes: 3 additions & 3 deletions python/core/geometry/qgsgeometry.sip
Expand Up @@ -336,7 +336,7 @@ Returns true if WKB of the geometry is of WKBMulti* type

double sqrDistToVertexAt( QgsPointXY &point /In/, int atVertex ) const;
%Docstring
Returns the squared cartesian distance between the given point
Returns the squared Cartesian distance between the given point
to the given vertex index (vertex at the given position number,
ring and item (first number is index 0))
:rtype: float
Expand All @@ -363,7 +363,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
Searches for the closest vertex in this geometry to the given point.
\param point Specifiest the point for search
\param atVertex Receives index of the closest vertex
:return: The squared cartesian distance is also returned in sqrDist, negative number on error
:return: The squared Cartesian distance is also returned in sqrDist, negative number on error
:rtype: float
%End

Expand All @@ -376,7 +376,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
before the closest segment is always afterVertex - 1
\param leftOf Out: Returns if the point lies on the left of right side of the segment ( < 0 means left, > 0 means right )
\param epsilon epsilon for segment snapping
:return: The squared cartesian distance is also returned in sqrDist, negative number on error
:return: The squared Cartesian distance is also returned in sqrDist, negative number on error
:rtype: float
%End

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsdistancearea.sip
Expand Up @@ -19,7 +19,7 @@ class QgsDistanceArea

If a valid ellipsoid() has been set for the QgsDistanceArea, all calculations will be
performed using ellipsoidal algorithms (e.g. using Vincenty's formulas). If no
ellipsoid has been set, all calculations will be performed using cartesian
ellipsoid has been set, all calculations will be performed using Cartesian
formulas only. The behavior can be determined by calling willUseEllipsoid().

In order to perform accurate calculations, the source coordinate reference system
Expand Down
@@ -1,5 +1,5 @@
m.cogo
A simple utility for converting bearing and distance measurements to coordinates and vice versa. It assumes a cartesian coordinate system
A simple utility for converting bearing and distance measurements to coordinates and vice versa. It assumes a Cartesian coordinate system
Miscellaneous (m.*)
ParameterFile|input|Name of input file|False
OutputFile|output|Output text file
Expand Down
1 change: 1 addition & 0 deletions scripts/spell_check/spelling.dat
Expand Up @@ -1123,6 +1123,7 @@ carrers:careers
Carribbean:Caribbean
Carribean:Caribbean
cartdridge:cartridge
cartesian:Cartesian
carthographer:cartographer
cartilege:cartilage
cartilidge:cartilage
Expand Down
10 changes: 5 additions & 5 deletions src/app/qgsmeasuredialog.cpp
Expand Up @@ -306,7 +306,7 @@ void QgsMeasureDialog::updateUi()
if ( !mTool->canvas()->mapSettings().destinationCrs().isValid() )
{
// no CRS => no units, newb!
toolTip += "<br> * " + tr( "No map projection set, so area is calculated using cartesian calculations." );
toolTip += "<br> * " + tr( "No map projection set, so area is calculated using Cartesian calculations." );
toolTip += "<br> * " + tr( "Units are unknown." );
forceCartesian = true;
convertToDisplayUnits = false;
Expand All @@ -315,7 +315,7 @@ void QgsMeasureDialog::updateUi()
&& ( mAreaUnits == QgsUnitTypes::AreaSquareDegrees || mAreaUnits == QgsUnitTypes::AreaUnknownUnit ) )
{
//both source and destination units are degrees
toolTip += "<br> * " + tr( "Both project CRS (%1) and measured area are in degrees, so area is calculated using cartesian calculations in square degrees." ).arg(
toolTip += "<br> * " + tr( "Both project CRS (%1) and measured area are in degrees, so area is calculated using Cartesian calculations in square degrees." ).arg(
mTool->canvas()->mapSettings().destinationCrs().description() );
forceCartesian = true;
convertToDisplayUnits = false; //not required since we will be measuring in degrees
Expand Down Expand Up @@ -376,7 +376,7 @@ void QgsMeasureDialog::updateUi()
if ( !mTool->canvas()->mapSettings().destinationCrs().isValid() )
{
// no CRS => no units, newb!
toolTip += "<br> * " + tr( "No map projection set, so distance is calculated using cartesian calculations." );
toolTip += "<br> * " + tr( "No map projection set, so distance is calculated using Cartesian calculations." );
toolTip += "<br> * " + tr( "Units are unknown." );
forceCartesian = true;
convertToDisplayUnits = false;
Expand All @@ -385,7 +385,7 @@ void QgsMeasureDialog::updateUi()
&& mDistanceUnits == QgsUnitTypes::DistanceDegrees )
{
//both source and destination units are degrees
toolTip += "<br> * " + tr( "Both project CRS (%1) and measured length are in degrees, so distance is calculated using cartesian calculations in degrees." ).arg(
toolTip += "<br> * " + tr( "Both project CRS (%1) and measured length are in degrees, so distance is calculated using Cartesian calculations in degrees." ).arg(
mTool->canvas()->mapSettings().destinationCrs().description() );
forceCartesian = true;
convertToDisplayUnits = false; //not required since we will be measuring in degrees
Expand Down Expand Up @@ -488,7 +488,7 @@ void QgsMeasureDialog::updateUi()
double d = -1;
if ( forceCartesian )
{
//cartesian calculation forced
//Cartesian calculation forced
d = sqrt( p2.sqrDist( p1 ) );
mTotal += d;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpression.h
Expand Up @@ -270,9 +270,9 @@ class CORE_EXPORT QgsExpression
/** Sets the geometry calculator used for distance and area calculations in expressions.
* (used by $length, $area and $perimeter functions only). By default, no geometry
* calculator is set and all distance and area calculations are performed using simple
* cartesian methods (ie no ellipsoidal calculations).
* Cartesian methods (ie no ellipsoidal calculations).
* \param calc geometry calculator. Ownership is not transferred. Set to a nullptr to force
* cartesian calculations.
* Cartesian calculations.
* \see geomCalculator()
*/
void setGeomCalculator( const QgsDistanceArea *calc );
Expand Down
6 changes: 3 additions & 3 deletions src/core/geometry/qgsgeometry.h
Expand Up @@ -348,7 +348,7 @@ class CORE_EXPORT QgsGeometry
QgsPointXY vertexAt( int atVertex ) const;

/**
* Returns the squared cartesian distance between the given point
* Returns the squared Cartesian distance between the given point
* to the given vertex index (vertex at the given position number,
* ring and item (first number is index 0))
*/
Expand All @@ -370,7 +370,7 @@ class CORE_EXPORT QgsGeometry
* Searches for the closest vertex in this geometry to the given point.
* \param point Specifiest the point for search
* \param atVertex Receives index of the closest vertex
* \returns The squared cartesian distance is also returned in sqrDist, negative number on error
* \returns The squared Cartesian distance is also returned in sqrDist, negative number on error
*/
double closestVertexWithContext( const QgsPointXY &point, int &atVertex SIP_OUT ) const;

Expand All @@ -382,7 +382,7 @@ class CORE_EXPORT QgsGeometry
* before the closest segment is always afterVertex - 1
* \param leftOf Out: Returns if the point lies on the left of right side of the segment ( < 0 means left, > 0 means right )
* \param epsilon epsilon for segment snapping
* \returns The squared cartesian distance is also returned in sqrDist, negative number on error
* \returns The squared Cartesian distance is also returned in sqrDist, negative number on error
*/
#ifndef SIP_RUN
double closestSegmentWithContext( const QgsPointXY &point, QgsPointXY &minDistPoint, int &afterVertex, double *leftOf = nullptr, double epsilon = DEFAULT_SEGMENT_EPSILON ) const;
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -455,7 +455,7 @@ void QgsGeometryUtils::circleCenterRadius( const QgsPoint &pt1, const QgsPoint &
return;
}

// Using cartesian circumcenter eguations from page https://en.wikipedia.org/wiki/Circumscribed_circle
// Using Cartesian circumcenter eguations from page https://en.wikipedia.org/wiki/Circumscribed_circle
dx21 = pt2.x() - pt1.x();
dy21 = pt2.y() - pt1.y();
dx31 = pt3.x() - pt1.x();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdistancearea.cpp
Expand Up @@ -356,7 +356,7 @@ double QgsDistanceArea::measureLineProjected( const QgsPointXY &p1, double dista
p2 = computeSpheroidProject( p1, distance, azimuth );
result = p1.distance( p2 );
}
else // cartesian coordinates
else // Cartesian coordinates
{
result = distance; // Avoid rounding errors when using meters [return as sent]
if ( sourceCrs().mapUnits() != QgsUnitTypes::DistanceMeters )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdistancearea.h
Expand Up @@ -36,7 +36,7 @@ class QgsCurve;
*
* If a valid ellipsoid() has been set for the QgsDistanceArea, all calculations will be
* performed using ellipsoidal algorithms (e.g. using Vincenty's formulas). If no
* ellipsoid has been set, all calculations will be performed using cartesian
* ellipsoid has been set, all calculations will be performed using Cartesian
* formulas only. The behavior can be determined by calling willUseEllipsoid().
*
* In order to perform accurate calculations, the source coordinate reference system
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsvectorfieldsymbollayer.h
Expand Up @@ -129,7 +129,7 @@ class CORE_EXPORT QgsVectorFieldSymbolLayer: public QgsMarkerSymbolLayer
int mXIndex;
int mYIndex;

//Converts length/angle to cartesian x/y
//Converts length/angle to Cartesian x/y
void convertPolarToCartesian( double length, double angle, double &x, double &y ) const;
};

Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsprojectionselectorbase.ui
Expand Up @@ -279,7 +279,7 @@
<item row="0" column="0">
<widget class="QCheckBox" name="mCheckBoxNoProjection">
<property name="toolTip">
<string>Use this option to treat all coordinates as cartesian coordinates in an unknown reference system.</string>
<string>Use this option to treat all coordinates as Cartesian coordinates in an unknown reference system.</string>
</property>
<property name="text">
<string>No projection (or unknown/non-Earth projection)</string>
Expand Down

0 comments on commit 99ea2e8

Please sign in to comment.