MCPcopy Create free account
hub / github.com/OSGeo/PROJ / is3DCRS

Function is3DCRS

src/apps/cs2cs.cpp:348–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346// ---------------------------------------------------------------------------
347
348static bool is3DCRS(const PJ *crs) {
349 auto type = proj_get_type(crs);
350 if (type == PJ_TYPE_COMPOUND_CRS)
351 return true;
352 if (type == PJ_TYPE_GEOGRAPHIC_3D_CRS)
353 return true;
354 if (type == PJ_TYPE_GEODETIC_CRS || type == PJ_TYPE_PROJECTED_CRS ||
355 type == PJ_TYPE_DERIVED_PROJECTED_CRS) {
356 auto cs = proj_crs_get_coordinate_system(nullptr, crs);
357 assert(cs);
358 const bool ret = proj_cs_get_axis_count(nullptr, cs) == 3;
359 proj_destroy(cs);
360 return ret;
361 }
362 return false;
363}
364
365/************************************************************************/
366/* main() */

Callers 1

mainFunction · 0.70

Calls 4

proj_get_typeFunction · 0.85
proj_cs_get_axis_countFunction · 0.85
proj_destroyFunction · 0.85

Tested by

no test coverage detected