Maria GDK 5.0.0.811
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::ViewportUtils Namespace Reference

Functions

bool ViewportExtents (const RasterProjector *baseTileViewport, const RasterProjector *rasterProjector, std::vector< BasicGeoTypes::Extents > &ext)
 
std::vector< std::pair< int, int > > calcVisibleTiles (const RasterProjector &vp, int rows=18, int cols=36, int numSamplesX=4, int numSamplesY=4, double maxPixelOffset=0.0)
 
TileCacheSpec convertGoogleMercator (const TileCacheSpec &tcs0)
 Convert from simple mercator in degrees (#mercator) to Google/Web Mercator in meters.
 
bool isCompatibleTiling (const TileCacheSpec &tcs1, const TileCacheSpec &tcs2)
 

Detailed Description

ViewportUtils - Various utility methods related to RasterProjector and Viewports

Function Documentation

◆ calcVisibleTiles()

std::vector< std::pair< int, int > > Maria::ViewportUtils::calcVisibleTiles ( const RasterProjector vp,
int  rows = 18,
int  cols = 36,
int  numSamplesX = 4,
int  numSamplesY = 4,
double  maxPixelOffset = 0.0 
)

Calculate tile indexes (row, col) on a global lat/lon grid of rows x cols which intersect the given viewport. The viewport is sampled in a grid of numSamplesX x numSamplesY to account for non-linear projections. This method will account for wraparound at 180 degrees longitude as well as an optional pixel offset buffer around each tile (maxOffsetPx). This can be used to include tiles that have items with a pixel offset that places them visually in another tile than its geographical anchor point.

◆ isCompatibleTiling()

bool Maria::ViewportUtils::isCompatibleTiling ( const TileCacheSpec tcs1,
const TileCacheSpec tcs2 
)

Check if the two tilings are compatbile. Will consider variants of global Simple Mercator and Google/Web Mercator to be compatible.