QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
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}
170
172{
173 switch ( type )
174 {
176 return QObject::tr( "Unknown" );
178 return QObject::tr( "Other" );
180 return QObject::tr( "Geodetic" );
182 return QObject::tr( "Geocentric" );
184 return QObject::tr( "Geographic (2D)" );
186 return QObject::tr( "Geographic (3D)" );
188 return QObject::tr( "Vertical" );
190 return QObject::tr( "Projected" );
192 return QObject::tr( "Compound" );
194 return QObject::tr( "Temporal" );
196 return QObject::tr( "Engineering" );
198 return QObject::tr( "Bound" );
200 return QObject::tr( "Derived projected" );
201 }
202 return QString();
203}
204
206{
207 if ( projection == QLatin1String( "adams_ws2" ) )
208 return QObject::tr( "Adams World in a Square II" );
209 if ( projection == QLatin1String( "aea" ) )
210 return QObject::tr( "Albers Equal Area" );
211 if ( projection == QLatin1String( "aeqd" ) )
212 return QObject::tr( "Azimuthal Equidistant" );
213 if ( projection == QLatin1String( "airy" ) )
214 return QObject::tr( "Airy" );
215 if ( projection == QLatin1String( "aitoff" ) )
216 return QObject::tr( "Aitoff" );
217 if ( projection == QLatin1String( "alsk" ) )
218 return QObject::tr( "Modified Stererographics of Alaska" );
219 if ( projection == QLatin1String( "apian" ) )
220 return QObject::tr( "Apian Globular I" );
221 if ( projection == QLatin1String( "august" ) )
222 return QObject::tr( "August Epicycloidal" );
223 if ( projection == QLatin1String( "bacon" ) )
224 return QObject::tr( "Bacon Globular" );
225 if ( projection == QLatin1String( "bipc" ) )
226 return QObject::tr( "Bipolar Conic of Western Hemisphere" );
227 if ( projection == QLatin1String( "boggs" ) )
228 return QObject::tr( "Boggs Eumorphic" );
229 if ( projection == QLatin1String( "bonne" ) )
230 return QObject::tr( "Bonne (Werner lat_1=90)" );
231 if ( projection == QLatin1String( "cass" ) )
232 return QObject::tr( "Cassini" );
233 if ( projection == QLatin1String( "cc" ) )
234 return QObject::tr( "Central Cylindrical" );
235 if ( projection == QLatin1String( "cea" ) )
236 return QObject::tr( "Equal Area Cylindrical" );
237 if ( projection == QLatin1String( "chamb" ) )
238 return QObject::tr( "Chamberlin Trimetric" );
239 if ( projection == QLatin1String( "col_urban" ) )
240 return QObject::tr( "Colombia Urban" );
241 if ( projection == QLatin1String( "collg" ) )
242 return QObject::tr( "Collignon" );
243 if ( projection == QLatin1String( "comill" ) )
244 return QObject::tr( "Compact Miller" );
245 if ( projection == QLatin1String( "crast" ) )
246 return QObject::tr( "Craster Parabolic (Putnins P4)" );
247 if ( projection == QLatin1String( "denoy" ) )
248 return QObject::tr( "Denoyer Semi-Elliptical" );
249 if ( projection == QLatin1String( "eck1" ) )
250 return QObject::tr( "Eckert I" );
251 if ( projection == QLatin1String( "eck2" ) )
252 return QObject::tr( "Eckert II" );
253 if ( projection == QLatin1String( "eck3" ) )
254 return QObject::tr( "Eckert III" );
255 if ( projection == QLatin1String( "eck4" ) )
256 return QObject::tr( "Eckert IV" );
257 if ( projection == QLatin1String( "eck5" ) )
258 return QObject::tr( "Eckert V" );
259 if ( projection == QLatin1String( "eck6" ) )
260 return QObject::tr( "Eckert VI" );
261 if ( projection == QLatin1String( "eqc" ) )
262 return QObject::tr( "Equidistant Cylindrical (Plate Carrée)" );
263 if ( projection == QLatin1String( "eqdc" ) )
264 return QObject::tr( "Equidistant Conic" );
265 if ( projection == QLatin1String( "eqearth" ) )
266 return QObject::tr( "Equal Earth" );
267 if ( projection == QLatin1String( "euler" ) )
268 return QObject::tr( "Euler" );
269 if ( projection == QLatin1String( "fahey" ) )
270 return QObject::tr( "Fahey" );
271 if ( projection == QLatin1String( "fouc" ) )
272 return QObject::tr( "Foucaut" );
273 if ( projection == QLatin1String( "fouc_s" ) )
274 return QObject::tr( "Foucaut Sinusoidal" );
275 if ( projection == QLatin1String( "gall" ) )
276 return QObject::tr( "Gall (Gall Stereographic)" );
277 if ( projection == QLatin1String( "geocent" ) )
278 return QObject::tr( "Geocentric" );
279 if ( projection == QLatin1String( "geos" ) )
280 return QObject::tr( "Geostationary Satellite View" );
281 if ( projection == QLatin1String( "gins8" ) )
282 return QObject::tr( "Ginsburg VIII (TsNIIGAiK)" );
283 if ( projection == QLatin1String( "gn_sinu" ) )
284 return QObject::tr( "General Sinusoidal Series" );
285 if ( projection == QLatin1String( "gnom" ) )
286 return QObject::tr( "Gnomonic" );
287 if ( projection == QLatin1String( "goode" ) )
288 return QObject::tr( "Goode Homolosine" );
289 if ( projection == QLatin1String( "gs48" ) )
290 return QObject::tr( "Modified Stererographics of 48 U.S." );
291 if ( projection == QLatin1String( "gs50" ) )
292 return QObject::tr( "Modified Stererographics of 50 U.S." );
293 if ( projection == QLatin1String( "hammer" ) )
294 return QObject::tr( "Hammer & Eckert-Greifendorff" );
295 if ( projection == QLatin1String( "hatano" ) )
296 return QObject::tr( "Hatano Asymmetrical Equal Area" );
297 if ( projection == QLatin1String( "igh" ) )
298 return QObject::tr( "Interrupted Goode Homolosine" );
299 if ( projection == QLatin1String( "igh_o" ) )
300 return QObject::tr( "Interrupted Goode Homolosine (Oceanic View)" );
301 if ( projection == QLatin1String( "imw_p" ) )
302 return QObject::tr( "International Map of the World Polyconic" );
303 if ( projection == QLatin1String( "kav5" ) )
304 return QObject::tr( "Kavraisky V" );
305 if ( projection == QLatin1String( "kav7" ) )
306 return QObject::tr( "Kavraisky VII" );
307 if ( projection == QLatin1String( "krovak" ) )
308 return QObject::tr( "Krovak" );
309 if ( projection == QLatin1String( "labrd" ) )
310 return QObject::tr( "Laborde" );
311 if ( projection == QLatin1String( "laea" ) )
312 return QObject::tr( "Lambert Azimuthal Equal Area" );
313 if ( projection == QLatin1String( "lagrng" ) )
314 return QObject::tr( "Lagrange" );
315 if ( projection == QLatin1String( "larr" ) )
316 return QObject::tr( "Larrivee" );
317 if ( projection == QLatin1String( "lask" ) )
318 return QObject::tr( "Laskowski" );
319 if ( projection == QLatin1String( "longlat" ) )
320 return QObject::tr( "Long/lat (Geodetic Alias)" );
321 if ( projection == QLatin1String( "latlong" ) )
322 return QObject::tr( "Lat/long (Geodetic Alias)" );
323 if ( projection == QLatin1String( "lcc" ) )
324 return QObject::tr( "Lambert Conformal Conic" );
325 if ( projection == QLatin1String( "lcca" ) )
326 return QObject::tr( "Lambert Conformal Conic Alternative" );
327 if ( projection == QLatin1String( "leac" ) )
328 return QObject::tr( "Lambert Equal Area Conic" );
329 if ( projection == QLatin1String( "lee_os" ) )
330 return QObject::tr( "Lee Oblated Stereographic" );
331 if ( projection == QLatin1String( "loxim" ) )
332 return QObject::tr( "Loximuthal" );
333 if ( projection == QLatin1String( "lsat" ) ) //#spellok
334 return QObject::tr( "Space Oblique for LANDSAT" );
335 if ( projection == QLatin1String( "mbt_s" ) )
336 return QObject::tr( "McBryde-Thomas Flat-Polar Sine (No. 1)" );
337 if ( projection == QLatin1String( "mbt_fps" ) )
338 return QObject::tr( "McBryde-Thomas Flat-Pole Sine (No. 2)" );
339 if ( projection == QLatin1String( "mbtfpp" ) )
340 return QObject::tr( "McBride-Thomas Flat-Polar Parabolic" );
341 if ( projection == QLatin1String( "mbtfpq" ) )
342 return QObject::tr( "McBryde-Thomas Flat-Polar Quartic" );
343 if ( projection == QLatin1String( "mbtfps" ) )
344 return QObject::tr( "McBryde-Thomas Flat-Polar Sinusoidal" );
345 if ( projection == QLatin1String( "merc" ) )
346 return QObject::tr( "Mercator" );
347 if ( projection == QLatin1String( "mil_os" ) )
348 return QObject::tr( "Miller Oblated Stereographic" );
349 if ( projection == QLatin1String( "mill" ) )
350 return QObject::tr( "Miller Cylindrical" );
351 if ( projection == QLatin1String( "moll" ) )
352 return QObject::tr( "Mollweide" );
353 if ( projection == QLatin1String( "murd1" ) )
354 return QObject::tr( "Murdoch I" );
355 if ( projection == QLatin1String( "murd2" ) )
356 return QObject::tr( "Murdoch II" );
357 if ( projection == QLatin1String( "murd3" ) )
358 return QObject::tr( "Murdoch III" );
359 if ( projection == QLatin1String( "natearth" ) )
360 return QObject::tr( "Natural Earth" );
361 if ( projection == QLatin1String( "natearth2" ) )
362 return QObject::tr( "Natural Earth II" );
363 if ( projection == QLatin1String( "nell" ) )
364 return QObject::tr( "Nell" );
365 if ( projection == QLatin1String( "nell_h" ) )
366 return QObject::tr( "Nell-Hammer" );
367 if ( projection == QLatin1String( "nicol" ) )
368 return QObject::tr( "Nicolosi Globular" );
369 if ( projection == QLatin1String( "nsper" ) )
370 return QObject::tr( "Near-sided Perspective" );
371 if ( projection == QLatin1String( "nzmg" ) )
372 return QObject::tr( "New Zealand Map Grid" );
373 if ( projection == QLatin1String( "ob_tran" ) )
374 return QObject::tr( "General Oblique Transformation" );
375 if ( projection == QLatin1String( "ocea" ) )
376 return QObject::tr( "Oblique Cylindrical Equal Area" );
377 if ( projection == QLatin1String( "oea" ) )
378 return QObject::tr( "Oblated Equal Area" );
379 if ( projection == QLatin1String( "omerc" ) )
380 return QObject::tr( "Oblique Mercator" );
381 if ( projection == QLatin1String( "ortel" ) )
382 return QObject::tr( "Ortelius Oval" );
383 if ( projection == QLatin1String( "ortho" ) )
384 return QObject::tr( "Orthographic" );
385 if ( projection == QLatin1String( "patterson" ) )
386 return QObject::tr( "Patterson" );
387 if ( projection == QLatin1String( "pconic" ) )
388 return QObject::tr( "Perspective Conic" );
389 if ( projection == QLatin1String( "peirce_q" ) )
390 return QObject::tr( "Peirce Quincuncial" );
391 if ( projection == QLatin1String( "poly" ) )
392 return QObject::tr( "Polyconic (American)" );
393 if ( projection == QLatin1String( "putp1" ) )
394 return QObject::tr( "Putnins P1" );
395 if ( projection == QLatin1String( "putp2" ) )
396 return QObject::tr( "Putnins P2" );
397 if ( projection == QLatin1String( "putp3" ) )
398 return QObject::tr( "Putnins P3" );
399 if ( projection == QLatin1String( "putp3p" ) )
400 return QObject::tr( "Putnins P3'" );
401 if ( projection == QLatin1String( "putp4p" ) )
402 return QObject::tr( "Putnins P4'" );
403 if ( projection == QLatin1String( "putp5" ) )
404 return QObject::tr( "Putnins P5" );
405 if ( projection == QLatin1String( "putp5p" ) )
406 return QObject::tr( "Putnins P5'" );
407 if ( projection == QLatin1String( "putp6" ) )
408 return QObject::tr( "Putnins P6" );
409 if ( projection == QLatin1String( "putp6p" ) )
410 return QObject::tr( "Putnins P6'" );
411 if ( projection == QLatin1String( "qua_aut" ) )
412 return QObject::tr( "Quartic Authalic" );
413 if ( projection == QLatin1String( "robin" ) )
414 return QObject::tr( "Robinson" );
415 if ( projection == QLatin1String( "rouss" ) )
416 return QObject::tr( "Roussilhe Stereographic" );
417 if ( projection == QLatin1String( "rpoly" ) )
418 return QObject::tr( "Rectangular Polyconic" );
419 if ( projection == QLatin1String( "sinu" ) )
420 return QObject::tr( "Sinusoidal (Sanson-Flamsteed)" );
421 if ( projection == QLatin1String( "somerc" ) )
422 return QObject::tr( "Swiss Oblique Mercator" );
423 if ( projection == QLatin1String( "stere" ) )
424 return QObject::tr( "Stereographic" );
425 if ( projection == QLatin1String( "sterea" ) )
426 return QObject::tr( "Oblique Stereographic Alternative" );
427 if ( projection == QLatin1String( "tcc" ) )
428 return QObject::tr( "Transverse Central Cylindrical" );
429 if ( projection == QLatin1String( "tcea" ) )
430 return QObject::tr( "Transverse Cylindrical Equal Area" );
431 if ( projection == QLatin1String( "times" ) )
432 return QObject::tr( "Times" );
433 if ( projection == QLatin1String( "tissot" ) )
434 return QObject::tr( "Tissot" );
435 if ( projection == QLatin1String( "tmerc" ) )
436 return QObject::tr( "Transverse Mercator" );
437 if ( projection == QLatin1String( "tpeqd" ) )
438 return QObject::tr( "Two Point Equidistant" );
439 if ( projection == QLatin1String( "tpers" ) )
440 return QObject::tr( "Tilted Perspective" );
441 if ( projection == QLatin1String( "ups" ) )
442 return QObject::tr( "Universal Polar Stereographic" );
443 if ( projection == QLatin1String( "urm5" ) )
444 return QObject::tr( "Urmaev V" );
445 if ( projection == QLatin1String( "urmfps" ) )
446 return QObject::tr( "Urmaev Flat-Polar Sinusoidal" );
447 if ( projection == QLatin1String( "utm" ) )
448 return QObject::tr( "Universal Transverse Mercator (UTM)" );
449 if ( projection == QLatin1String( "vandg" ) )
450 return QObject::tr( "van der Grinten (I)" );
451 if ( projection == QLatin1String( "vandg2" ) )
452 return QObject::tr( "van der Grinten II" );
453 if ( projection == QLatin1String( "vandg3" ) )
454 return QObject::tr( "van der Grinten III" );
455 if ( projection == QLatin1String( "vandg4" ) )
456 return QObject::tr( "van der Grinten IV" );
457 if ( projection == QLatin1String( "vitk1" ) )
458 return QObject::tr( "Vitkovsky I" );
459 if ( projection == QLatin1String( "wag1" ) )
460 return QObject::tr( "Wagner I (Kavraisky VI)" );
461 if ( projection == QLatin1String( "wag2" ) )
462 return QObject::tr( "Wagner II" );
463 if ( projection == QLatin1String( "wag3" ) )
464 return QObject::tr( "Wagner III" );
465 if ( projection == QLatin1String( "wag4" ) )
466 return QObject::tr( "Wagner IV" );
467 if ( projection == QLatin1String( "wag5" ) )
468 return QObject::tr( "Wagner V" );
469 if ( projection == QLatin1String( "wag6" ) )
470 return QObject::tr( "Wagner VI" );
471 if ( projection == QLatin1String( "wag7" ) )
472 return QObject::tr( "Wagner VII" );
473 if ( projection == QLatin1String( "weren" ) )
474 return QObject::tr( "Werenskiold I" );
475 if ( projection == QLatin1String( "wink1" ) )
476 return QObject::tr( "Winkel I" );
477 if ( projection == QLatin1String( "wink2" ) )
478 return QObject::tr( "Winkel II" );
479 if ( projection == QLatin1String( "wintri" ) )
480 return QObject::tr( "Winkel Tripel" );
481 if ( projection == QLatin1String( "gstmerc" ) )
482 return QObject::tr( "Gauss-Schreiber" );
483 return QString();
484}
CrsType
Data provider flags.
Definition qgis.h:1696
@ Vertical
Vertical CRS.
@ Temporal
Temporal CRS.
@ Compound
Compound (horizontal + vertical) CRS.
@ Projected
Projected CRS.
@ Other
Other type.
@ Bound
Bound CRS.
@ DerivedProjected
Derived projected CRS.
@ Unknown
Unknown type.
@ Engineering
Engineering CRS.
@ Geographic3d
3D geopraphic CRS
@ Geodetic
Geodetic CRS.
@ Geographic2d
2D geographic CRS
@ Geocentric
Geocentric CRS.
CoordinateOrder
Order of coordinates.
Definition qgis.h:1771
@ XY
Easting/Northing (or Longitude/Latitude for geographic CRS)
@ YX
Northing/Easting (or Latitude/Longitude for geographic CRS)
CrsAxisDirection
Coordinate reference system axis directions.
Definition qgis.h:1721
@ ColumnPositive
Column positive.
@ SouthSouthEast
South South East.
@ NorthWest
North West.
@ ColumnNegative
Column negative.
@ RowPositive
Row positive.
@ DisplayDown
Display down.
@ GeocentricZ
Geocentric (Z)
@ DisplayRight
Display right.
@ WestSouthWest
West South West.
@ RowNegative
Row negative.
@ NorthNorthEast
North North East.
@ EastNorthEast
East North East.
@ Unspecified
Unspecified.
@ NorthEast
North East.
@ NorthNorthWest
North North West.
@ GeocentricY
Geocentric (Y)
@ SouthEast
South East.
@ CounterClockwise
Counter clockwise.
@ SouthSouthWest
South South West.
@ DisplayLeft
Display left.
@ WestNorthWest
West North West.
@ EastSouthEast
East South East.
@ SouthWest
South West.
@ DisplayUp
Display up.
@ GeocentricX
Geocentric (X)
static QString crsTypeToString(Qgis::CrsType type)
Returns a translated string representing a CRS type.
static QString translateProjection(const QString &projection)
Returns a translated string for a projection method.
static Qgis::CoordinateOrder defaultCoordinateOrderForCrs(const QgsCoordinateReferenceSystem &crs)
Returns the default coordinate order to use for the specified crs.
static QString axisDirectionToAbbreviatedString(Qgis::CrsAxisDirection axis)
Returns a translated abbreviation representing an axis direction.
This class represents a coordinate reference system (CRS).
QList< Qgis::CrsAxisDirection > axisOrdering() const
Returns an ordered list of the axis directions reflecting the native axis order for the CRS.
const QgsCoordinateReferenceSystem & crs