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

Function proj_create_argv

src/create.cpp:257–285  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

255
256/*************************************************************************************/
257PJ *proj_create_argv(PJ_CONTEXT *ctx, int argc, char **argv) {
258 /**************************************************************************************
259 Create a new PJ object in the context ctx, using the given definition
260 argument array argv. If ctx==0, the default context is used, if
261 definition==0, or invalid, a null-pointer is returned. The definition
262 arguments may use '+' as argument start indicator, as in {"+proj=utm",
263 "+zone=32"}, or leave it out, as in {"proj=utm", "zone=32"}.
264 **************************************************************************************/
265
266 if (nullptr == ctx)
267 ctx = pj_get_default_ctx();
268 if (nullptr == argv) {
269 proj_context_errno_set(ctx, PROJ_ERR_INVALID_OP_MISSING_ARG);
270 return nullptr;
271 }
272
273 /* We assume that free format is used, and build a full proj_create
274 * compatible string */
275 char *c = pj_make_args(argc, argv);
276 if (nullptr == c) {
277 proj_context_errno_set(ctx, PROJ_ERR_INVALID_OP /* ENOMEM */);
278 return nullptr;
279 }
280
281 PJ *P = proj_create(ctx, c);
282
283 free((char *)c);
284 return P;
285}
286
287/*************************************************************************************/
288PJ *pj_create_argv_internal(PJ_CONTEXT *ctx, int argc, char **argv) {

Callers 3

TESTFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 4

pj_get_default_ctxFunction · 0.85
proj_context_errno_setFunction · 0.85
pj_make_argsFunction · 0.85
proj_createFunction · 0.85

Tested by 1

TESTFunction · 0.68