MCPcopy Create free account
hub / github.com/Kitware/VTK / getListOfGridSets

Function getListOfGridSets

ThirdParty/libproj/vtklibproj/src/grids.cpp:2837–2862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2835// ---------------------------------------------------------------------------
2836
2837static ListOfHGrids getListOfGridSets(PJ_CONTEXT *ctx, const char *grids) {
2838 ListOfHGrids list;
2839 auto listOfGrids = internal::split(std::string(grids), ',');
2840 for (const auto &grid : listOfGrids) {
2841 const char *gridname = grid.c_str();
2842 bool canFail = false;
2843 if (gridname[0] == '@') {
2844 canFail = true;
2845 gridname++;
2846 }
2847 auto gridSet = HorizontalShiftGridSet::open(ctx, gridname);
2848 if (!gridSet) {
2849 if (!canFail) {
2850 if (proj_context_errno(ctx) != PROJ_ERR_OTHER_NETWORK_ERROR) {
2851 proj_context_errno_set(
2852 ctx, PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID);
2853 }
2854 return {};
2855 }
2856 proj_context_errno_set(ctx, 0); // don't treat as a persistent error
2857 } else {
2858 list.emplace_back(std::move(gridSet));
2859 }
2860 }
2861 return list;
2862}
2863
2864/**********************************************/
2865ListOfHGrids pj_hgrid_init(PJ *P, const char *gridkey) {

Callers 1

pj_hgrid_initFunction · 0.85

Calls 6

proj_context_errnoFunction · 0.85
proj_context_errno_setFunction · 0.85
splitFunction · 0.50
stringClass · 0.50
c_strMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected