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

Function pj_generic_grid_init

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

Source from the content-addressed store, hash-verified

2782// ---------------------------------------------------------------------------
2783
2784ListOfGenericGrids pj_generic_grid_init(PJ *P, const char *gridkey) {
2785 std::string key("s");
2786 key += gridkey;
2787 const char *gridnames = pj_param(P->ctx, P->params, key.c_str()).s;
2788 if (gridnames == nullptr)
2789 return {};
2790
2791 auto listOfGridNames = internal::split(std::string(gridnames), ',');
2792 ListOfGenericGrids grids;
2793 for (const auto &gridnameStr : listOfGridNames) {
2794 const char *gridname = gridnameStr.c_str();
2795 bool canFail = false;
2796 if (gridname[0] == '@') {
2797 canFail = true;
2798 gridname++;
2799 }
2800 auto gridSet = GenericShiftGridSet::open(P->ctx, gridname);
2801 if (!gridSet) {
2802 if (!canFail) {
2803 if (proj_context_errno(P->ctx) !=
2804 PROJ_ERR_OTHER_NETWORK_ERROR) {
2805 proj_context_errno_set(
2806 P->ctx, PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID);
2807 }
2808 return {};
2809 }
2810 proj_context_errno_set(P->ctx,
2811 0); // don't treat as a persistent error
2812 } else {
2813 grids.emplace_back(std::move(gridSet));
2814 }
2815 }
2816
2817 return grids;
2818}
2819
2820// ---------------------------------------------------------------------------
2821

Callers 3

get_grid_valuesFunction · 0.85
xyzgridshift.cppFile · 0.85
deformation.cppFile · 0.85

Calls 7

pj_paramFunction · 0.85
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