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

Function pj_expand_init_internal

ThirdParty/libproj/vtklibproj/src/init.cpp:358–397  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

356
357/*****************************************************************************/
358static paralist *pj_expand_init_internal(PJ_CONTEXT *ctx, paralist *init, int allow_init_epsg) {
359/******************************************************************************
360Append expansion of <key> to the paralist <init>. The expansion is appended,
361rather than inserted at <init>'s place, since <init> may contain
362overrides to the expansion. These must take precedence, and hence come first
363in the expanded list.
364
365Consider e.g. the key 'foo:bar' which (hypothetically) expands to 'proj=utm
366zone=32 ellps=GRS80', i.e. a UTM projection on the GRS80 ellipsoid.
367
368The expression 'init=foo:bar ellps=intl' will then expand to:
369
370 'init=foo:bar ellps=intl proj=utm zone=32 ellps=GRS80',
371
372where 'ellps=intl' precedes 'ellps=GRS80', and hence takes precedence,
373turning the expansion into an UTM projection on the Hayford ellipsoid.
374
375Note that 'init=foo:bar' stays in the list. It is ignored after expansion.
376
377******************************************************************************/
378 paralist *last;
379 paralist *expn;
380
381 /* Nowhere to start? */
382 if (nullptr==init)
383 return nullptr;
384
385 expn = get_init(ctx, init->param, allow_init_epsg);
386
387 /* Nothing in expansion? */
388 if (nullptr==expn)
389 return nullptr;
390
391 /* Locate the end of the list */
392 for (last = init; last && last->next; last = last->next);
393
394 /* Then append and return */
395 last->next = expn;
396 return init;
397}
398
399paralist *pj_expand_init(PJ_CONTEXT *ctx, paralist *init) {
400 return pj_expand_init_internal(ctx, init, TRUE);

Callers 2

pj_expand_initFunction · 0.85

Calls 1

get_initFunction · 0.85

Tested by

no test coverage detected