MCPcopy Index your code
hub / github.com/MapServer/MapServer / GetDeltaExtentsUsingScale

Function GetDeltaExtentsUsingScale

mapscale.c:470–497  ·  view source on GitHub ↗

/ double GetDeltaExtentsUsingScale(double scale, int units, */ double centerLat, int width, */ double resolution) */ / Utility function to return the maximum extent using the */ scale and the width of the image. */ / Base on the function msCalculateScale (mapscale.c) */ /

Source from the content-addressed store, hash-verified

468/* Base on the function msCalculateScale (mapscale.c) */
469/************************************************************************/
470double GetDeltaExtentsUsingScale(double scale, int units, double centerLat, int width, double resolution)
471{
472 double md = 0.0;
473 double dfDelta = -1.0;
474
475 if (scale <= 0 || width <=0)
476 return -1;
477
478 switch (units)
479 {
480 case(MS_DD):
481 case(MS_METERS):
482 case(MS_KILOMETERS):
483 case(MS_MILES):
484 case(MS_NAUTICALMILES):
485 case(MS_INCHES):
486 case(MS_FEET):
487 /* remember, we use a pixel-center to pixel-center extent, hence the width-1 */
488 md = (width-1)/(resolution*msInchesPerUnit(units,centerLat));
489 dfDelta = md * scale;
490 break;
491
492 default:
493 break;
494 }
495
496 return dfDelta;
497}
498
499/************************************************************************/
500/* static double Pix2Georef(int nPixPos, int nPixMin, double nPixMax,*/

Callers 1

map.cFile · 0.85

Calls 1

msInchesPerUnitFunction · 0.85

Tested by

no test coverage detected