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

Function isPointInExtent

src/grids.cpp:1689–1704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1687// ---------------------------------------------------------------------------
1688
1689static bool isPointInExtent(double x, double y, const ExtentAndRes &extent,
1690 double eps = 0) {
1691 if (!(y + eps >= extent.south && y - eps <= extent.north))
1692 return false;
1693 if (extent.fullWorldLongitude())
1694 return true;
1695 if (extent.isGeographic) {
1696 if (x + eps < extent.west)
1697 x += 2 * M_PI;
1698 else if (x - eps > extent.east)
1699 x -= 2 * M_PI;
1700 }
1701 if (!(x + eps >= extent.west && x - eps <= extent.east))
1702 return false;
1703 return true;
1704}
1705
1706// ---------------------------------------------------------------------------
1707

Callers 1

gridAtMethod · 0.85

Calls 1

fullWorldLongitudeMethod · 0.80

Tested by

no test coverage detected