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

Function normalizeX

src/transformations/gridshift.cpp:584–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582// ---------------------------------------------------------------------------
583
584static PJ_XY normalizeX(const GenericShiftGrid *grid, const PJ_XYZ in,
585 const NS_PROJ::ExtentAndRes *&extentOut) {
586 PJ_XY normalized;
587 normalized.x = in.x;
588 normalized.y = in.y;
589 extentOut = &(grid->extentAndRes());
590 if (extentOut->isGeographic) {
591 const double epsilon =
592 (extentOut->resX + extentOut->resY) * REL_TOLERANCE_HGRIDSHIFT;
593 if (normalized.x < extentOut->west - epsilon)
594 normalized.x += 2 * M_PI;
595 else if (normalized.x > extentOut->east + epsilon)
596 normalized.x -= 2 * M_PI;
597 }
598 return normalized;
599}
600
601// ---------------------------------------------------------------------------
602

Callers 1

grid_apply_internalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected