QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgscoordinatereferencesystemutils.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgscoordinatereferencesystemutils.h
3  -------------------
4  begin : April 2022
5  copyright : (C) 202 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
19 
21 {
22  const QList< Qgis::CrsAxisDirection > axisList = crs.axisOrdering();
23  if ( axisList.size() < 2 )
25 
26  for ( Qgis::CrsAxisDirection axis : axisList )
27  {
28  // we're trying to map all the different possible values to just XY or YX, so excuse the coarseness!
29  switch ( axis )
30  {
41 
56 
75  break;
76  }
77  }
78 
80 }
81 
83 {
84  switch ( axis )
85  {
87  return QObject::tr( "N", "axis" );
89  return QObject::tr( "NNE", "axis" );
91  return QObject::tr( "SSE", "axis" );
93  return QObject::tr( "S", "axis" );
95  return QObject::tr( "SSW", "axis" );
97  return QObject::tr( "NNW", "axis" );
99  return QObject::tr( "Y", "axis" );
101  return QObject::tr( "Up", "axis" );
103  return QObject::tr( "Down", "axis" );
105  return QObject::tr( "NE", "axis" );
107  return QObject::tr( "ENE", "axis" );
109  return QObject::tr( "E", "axis" );
111  return QObject::tr( "ESE", "axis" );
113  return QObject::tr( "SE", "axis" );
115  return QObject::tr( "SW", "axis" );
117  return QObject::tr( "WSW", "axis" );
119  return QObject::tr( "W", "axis" );
121  return QObject::tr( "WNW", "axis" );
123  return QObject::tr( "NW", "axis" );
125  return QObject::tr( "X", "axis" );
127  return QObject::tr( "Disp. R", "axis" );
129  return QObject::tr( "Disp. L", "axis" );
131  return QObject::tr( "Z", "axis" );
133  return QObject::tr( "U", "axis" );
135  return QObject::tr( "D", "axis" );
137  return QObject::tr( "F", "axis" );
139  return QObject::tr( "A", "axis" );
141  return QObject::tr( "P", "axis" );
143  return QObject::tr( "STBD", "axis" );
145  return QObject::tr( "CW", "axis" );
147  return QObject::tr( "CCW", "axis" );
149  return QObject::tr( "C+", "axis" );
151  return QObject::tr( "C-", "axis" );
153  return QObject::tr( "R+", "axis" );
155  return QObject::tr( "R-", "axis" );
157  return QObject::tr( "F", "axis" );
159  return QObject::tr( "P", "axis" );
161  return QObject::tr( "T", "axis" );
163  return QObject::tr( "AF", "axis" );
165  break;
166  }
167 
168  return QString();
169 }
Qgis::CrsAxisDirection::Towards
@ Towards
Towards.
Qgis::CrsAxisDirection::WestNorthWest
@ WestNorthWest
West North West.
Qgis::CrsAxisDirection::SouthWest
@ SouthWest
South West.
Qgis::CrsAxisDirection::Unspecified
@ Unspecified
Unspecified.
Qgis::CrsAxisDirection::DisplayDown
@ DisplayDown
Display down.
Qgis::CrsAxisDirection::West
@ West
West.
Qgis::CrsAxisDirection::Future
@ Future
Future.
Qgis::CrsAxisDirection::DisplayUp
@ DisplayUp
Display up.
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
Qgis::CrsAxisDirection::SouthSouthEast
@ SouthSouthEast
South South East.
Qgis::CrsAxisDirection::RowNegative
@ RowNegative
Row negative.
Qgis::CrsAxisDirection::NorthNorthWest
@ NorthNorthWest
North North West.
QgsCoordinateReferenceSystem::axisOrdering
QList< Qgis::CrsAxisDirection > axisOrdering() const
Returns an ordered list of the axis directions reflecting the native axis order for the CRS.
Definition: qgscoordinatereferencesystem.cpp:804
Qgis::CrsAxisDirection::GeocentricY
@ GeocentricY
Geocentric (Y)
QgsCoordinateReferenceSystemUtils::defaultCoordinateOrderForCrs
static Qgis::CoordinateOrder defaultCoordinateOrderForCrs(const QgsCoordinateReferenceSystem &crs)
Returns the default coordinate order to use for the specified crs.
Definition: qgscoordinatereferencesystemutils.cpp:20
Qgis::CrsAxisDirection::GeocentricZ
@ GeocentricZ
Geocentric (Z)
Qgis::CrsAxisDirection::East
@ East
East.
Qgis::CrsAxisDirection::Past
@ Past
Past.
Qgis::CrsAxisDirection::CounterClockwise
@ CounterClockwise
Counter clockwise.
Qgis::CrsAxisDirection::SouthSouthWest
@ SouthSouthWest
South South West.
Qgis::CrsAxisDirection::DisplayLeft
@ DisplayLeft
Display left.
Qgis::CrsAxisDirection::South
@ South
South.
Qgis::CrsAxisDirection::AwayFrom
@ AwayFrom
Away from.
Qgis::CrsAxisDirection::DisplayRight
@ DisplayRight
Display right.
Qgis::CrsAxisDirection::EastSouthEast
@ EastSouthEast
East South East.
Qgis::CoordinateOrder::XY
@ XY
Easting/Northing (or Longitude/Latitude for geographic CRS)
Qgis::CrsAxisDirection::RowPositive
@ RowPositive
Row positive.
Qgis::CrsAxisDirection::NorthWest
@ NorthWest
North West.
qgscoordinatereferencesystemutils.h
Qgis::CrsAxisDirection::Aft
@ Aft
Aft.
Qgis::CrsAxisDirection::GeocentricX
@ GeocentricX
Geocentric (X)
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
Qgis::CrsAxisDirection::NorthNorthEast
@ NorthNorthEast
North North East.
Qgis::CoordinateOrder::YX
@ YX
Northing/Easting (or Latitude/Longitude for geographic CRS)
Qgis::CrsAxisDirection::ColumnNegative
@ ColumnNegative
Column negative.
QgsCoordinateReferenceSystemUtils::axisDirectionToAbbreviatedString
static QString axisDirectionToAbbreviatedString(Qgis::CrsAxisDirection axis)
Returns a translated abbreviation representing an axis direction.
Definition: qgscoordinatereferencesystemutils.cpp:82
Qgis::CrsAxisDirection
CrsAxisDirection
Data provider flags.
Definition: qgis.h:1051
Qgis::CrsAxisDirection::Up
@ Up
Up.
Qgis::CrsAxisDirection::WestSouthWest
@ WestSouthWest
West South West.
Qgis::CrsAxisDirection::EastNorthEast
@ EastNorthEast
East North East.
Qgis::CrsAxisDirection::ColumnPositive
@ ColumnPositive
Column positive.
Qgis::CrsAxisDirection::Port
@ Port
Port.
Qgis::CoordinateOrder
CoordinateOrder
Order of coordinates.
Definition: qgis.h:1101
qgscoordinatereferencesystem.h
Qgis::CrsAxisDirection::Forward
@ Forward
Forward.
Qgis::CrsAxisDirection::Down
@ Down
Down.
Qgis::CrsAxisDirection::North
@ North
North.
Qgis::CrsAxisDirection::Clockwise
@ Clockwise
Clockwise.
Qgis::CrsAxisDirection::NorthEast
@ NorthEast
North East.
Qgis::CrsAxisDirection::SouthEast
@ SouthEast
South East.
Qgis::CrsAxisDirection::Starboard
@ Starboard
Starboard.