﻿
var ECWP_BASEURL = 'ecwp://3.diwa.info/resources/ecw/';
var IMAGEX_BASEURL = '/resources/ecw/';

var vectorMode = 'polygon';
var ECWVectorLayer = null;
var FOCUSRECT_COLOR = '#ff3300';
var TRANSPARENTBACKGROUND_COLOR = '#fffffe';

var rectNW = new rectGIS(4435756, 10493717, 4619656, 10348599);
var rectNO = new rectGIS(5380412, 10113476, 5560981, 9969744);
var rectSW = new rectGIS(4437230, 9599964, 4707206, 9494353);

// *** Questionnaire/Wenker specific functions ***

/*
* Shows the questionnaire in the given view.
* USED in Wenkerbogen/Bogen.aspx
* @param ecwview
* @param layername
* @param filename
*/
function showQuestionnaire(ecwview, layername, filename) {
	if (ecwview.GetNumberLayers() > 0) {
		ecwview.DeleteAllLayers();
	}
	
	var params = '';
	if (getCookie('NCSPluginInstallMethod') == 'HTML') {
		params = 'fadein=true;multilevel=true;';
	}

	ecwview.AddLayer('ECW', filename, layername, params);
	tOnInitialOptimizeTimer = setTimeout("optimize()", 2000);
}

/*
*   
*   USED in Wenkerbogen/Bogen.aspx -> optimize
*/
function findEdges(ecwview, layername, visible) {
	ecwview.SetLayerParameter(layername, 'brightness=1.0');
	ecwview.SetLayerParameter(layername, 'contrast=1.0');
		
	nImageTLX = ecwview.GetLayerImageTopLeftWorldCoordinateX(layername);
  nImageTLY = ecwview.GetLayerImageTopLeftWorldCoordinateY(layername);
  nImageBRX = ecwview.GetLayerImageBottomRightWorldCoordinateX(layername);
  nImageBRY = ecwview.GetLayerImageBottomRightWorldCoordinateY(layername);
		
	var x0 = nImageTLX;
	var y0 = nImageTLY;
	var x1 = nImageBRX - 1;
	var y1 = nImageBRY - 1;
	
	var nTreshold = 2000000;
	var a = 1;
	var nRGB = 0;

	for (x0 = 0; nRGB < nTreshold; x0++) {
	 	nRGB = ECWRGBToInt(ecwview.GetLayerRGB(layername, x0, nImageBRY * a / 3));
		a = (a == 1) ? 2 : 1;		
	}
	
	nRGB = 0;
	
	for (y0 = 0; nRGB < nTreshold; y0++) {
	 	nRGB = ECWRGBToInt(ecwview.GetLayerRGB(layername, nImageBRX * a / 3, y0));
		a = (a == 1) ? 2 : 1;
	}
	
	nRGB = 0;
	
	for (x1 = nImageBRX - 1; nRGB < nTreshold; x1--) {
		nRGB = ECWRGBToInt(ecwview.GetLayerRGB(layername, x1, nImageBRY * a / 3));
		a = (a == 1) ? 2 : 1;
	}
	
	nRGB = 0;
	
	for (y1 = nImageBRY - 1; nRGB < nTreshold; y1--) {
		nRGB = ECWRGBToInt(ecwview.GetLayerRGB(layername, nImageBRX * a / 3, y1));
		a = (a == 1) ? 2 : 1;
	}
	
	if (visible == true) {
		showRect(ecwview, x0, y0, x1, y1);
	} else {
		hideRect(ecwview)
	}
	
	while (ECWRGBToInt(ecwview.GetLayerRGB(layername, x1 + (nImageBRX - x1) / 2, y1 + (nImageBRY - y1) / 2)) > 0) {
		b0 = ecwview.GetLayerParameter(layername, 'brightness') * 100;
		b0--;
		if (sBrightness) {
			sBrightness.setValue(b0.toFixed(0));
		} else {
			ecwview.SetLayerParameter(layername, 'brightness=' + b0 / 100);
		}
		
		c0 = ecwview.GetLayerParameter(layername, 'contrast') * 100;
		c0++;
		if (sContrast) {
			sContrast.setValue(c0.toFixed(0));
		} else {
			ecwview.SetLayerParameter(layername, 'contrast=' + c0 / 100);
		}
	}
	
}

// *** ECW Utilities **
/*
* Saves the current coordinates in a cookie.
*/
function saveZoomWindow(ecwview) {
  usrTLX = ecwview.GetTopLeftWorldCoordinateX();
  usrTLY = ecwview.GetTopLeftWorldCoordinateY();
  usrBRX = ecwview.GetBottomRightWorldCoordinateX();
  usrBRY = ecwview.GetBottomRightWorldCoordinateY();

  setCookieEx('usrTLX', usrTLX);
  setCookieEx('usrTLY', usrTLY);
  setCookieEx('usrBRX', usrBRX);
  setCookieEx('usrBRY', usrBRY);

  alert('Ausschnitt gespeichert.');
}

/*
* Restores coordinates from a cookie and extents the view to these coordinates.
*/
function restoreZoomWindow(ecwview) {
  nZoomToSavedExtents = true;

  if (getCookieEx("usrTLX") != null) { usrTLX = parseFloat(getCookieEx("usrTLX")) } else { nZoomToSavedExtents = false };
  if (getCookieEx("usrTLY") != null) { usrTLY = parseFloat(getCookieEx("usrTLY")) } else { nZoomToSavedExtents = false };
  if (getCookieEx("usrBRX") != null) { usrBRX = parseFloat(getCookieEx("usrBRX")) } else { nZoomToSavedExtents = false };
  if (getCookieEx("usrBRY") != null) { usrBRY = parseFloat(getCookieEx("usrBRY")) } else { nZoomToSavedExtents = false };

  if (nZoomToSavedExtents) {
    ecwview.SetExtents(usrTLX, usrTLY, usrBRX, usrBRY);
  }
}
/*
* Captures the image currently displayed in the view to the clipboard.
*/
function copyView(ecwview) {
	ecwview.CaptureView('');
	alert('Die gewählte Ansicht wurde kopiert.');
}

/*
* Shows an Rect with the coordinates (x0,y0) and (x1, y1) for the left top and right bottom corner.
*/
function showRect(ecwview, x0, y0, x1, y1) {
	var vecObject = 'linewidth=1;color=' + FOCUSRECT_COLOR + ';fillcolor=' + TRANSPARENTBACKGROUND_COLOR + ';filledpolygon1=';	
	vecObject += x0 + ',' + y0 + '|';
  vecObject += x1 + ',' + y0 + '|';
 	vecObject += x1 + ',' + y1 + '|';
 	vecObject += x0 + ',' + y1 + ';';

	if (ecwview.GetLayerIndex('_rect') == -1) {
		ecwview.AddLayer('simplevector', '', '_rect', ';')
	}
	
  ecwview.SetLayerParameter('_rect', vecObject);
	ecwview.SetLayerTransparency('_rect', TRANSPARENTBACKGROUND_COLOR, 0.0);
}

/*
* Hides the Rect with is created with the showRect-method.
*/
function hideRect(ecwview) {
	if (ecwview.GetLayerIndex('_rect') > -1) {
		ecwview.DeleteLayer('_rect');
	}	
}

/*
* Shows a croshair in the ecwview with the coordinate (x,y) at the center.
*/
function showCrosshair(ecwview, x, y) {
  if (x == 0 || y == 0) {
    return (0);
  }
  
  var srcx0 = ecwview.GetTopLeftWorldCoordinateX();
  var srcy0 = ecwview.GetTopLeftWorldCoordinateY();
  var srcx1 = ecwview.GetBottomRightWorldCoordinateX();
  var srcy1 = ecwview.GetBottomRightWorldCoordinateY();
  
  var vecObject1 = 'linewidth=1;color=' + FOCUSRECT_COLOR + ';polygon1=';
  vecObject1 += srcx0 + ',' + y + '|';
  vecObject1 += srcx1 + ',' + y + ';';
  var vecObject2 = 'linewidth=1;color=' + FOCUSRECT_COLOR + ';polygon2=';
  vecObject2 += x + ',' + srcy0 + '|';
  vecObject2 += x + ',' + srcy1 + ';';
  
  if (ecwview.GetLayerIndex('_crosshair') == -1) {
    ecwview.AddLayer('simplevector', '', '_crosshair', ';')
  }

  ecwview.SetLayerParameter('_crosshair', vecObject1);
  ecwview.SetLayerParameter('_crosshair', vecObject2);
  ecwview.SetLayerTransparency('_crosshair', TRANSPARENTBACKGROUND_COLOR, 0.0);
}

/*
* Hides the crosshair showed with the showCrosshair-method.
*/
function hideCrosshair(ecwview) {
  if (ecwview.GetLayerIndex('_crosshair') > -1) {
    ecwview.DeleteLayer('_crosshair');
  }
}

// *** General Utilities ***
/*
* Basis 16 -> Basis 10
* #091513 -> 595219
*/
function ECWRGBToInt(sRGB) {
	nRGB = parseInt(sRGB.substr(1, 6), 16);
	return(nRGB);
}


// *** ECW Toolbar
function createToolbar(uid, objectid, width, mode) {
	// define ECWToolbarCB() locally to match ECWView purposes
	var ECWToolbar1 = new NCSToolbar(uid, objectid, width);

	ECWToolbar1.addButton('Ausschnitt verschieben',
		'/App_Themes/ecwtools/roam.png',
		'/App_Themes/ecwtools/roamSelect.png',
		true, ECWToolbarCB, 'UID_VIEW_PAN');
	ECWToolbar1.addButton('Zoomausschnitt vergrößern oder verkleinern',
		'/App_Themes/ecwtools/zoom.png',
		'/App_Themes/ecwtools/zoomSelect.png',
		true, ECWToolbarCB, 'UID_VIEW_ZOOM');
	ECWToolbar1.addButton('Zoomausschnitt definieren',
		'/App_Themes/ecwtools/zoombox.png',
		'/App_Themes/ecwtools/zoomBoxSelect.png',
		true, ECWToolbarCB, 'UID_VIEW_ZOOMBOX');
	ECWToolbar1.addButton('Gesamtansicht',
		'/App_Themes/ecwtools/reset.png', 
		'/App_Themes/ecwtools/resetSelect.png', 
		false, ECWToolbarCB, 'UID_VIEW_RESET');
	
	switch (mode) {
		case 0:
			// questionnaire, ..:
			break;
			
		case 1:
			// map:
			ECWToolbar1.addSpace('', 'UID_SPACE');
		
			ECWToolbar1.addButton('Datenmodus',
				'/App_Themes/ecwtools/pointer.png',
				'/App_Themes/ecwtools/pointerSelect.png',
				true, ECWToolbarCB, 'UID_VIEW_POINTER');
				
			break;
	}
		
	ECWToolbar1.getTable().cellSpacing = 2;
	ECWToolbar1.setCurrentItem('UID_VIEW_PAN');
	
}

// *** map callbacks 
var CU_INVALID = 0;
var CU_METERS = 1;
var CU_DEGREES = 2;
var CU_FEET = 3;

function onMapMouseDown(buttonMask, screenX, screenY, worldX, worldY) {
  
}

function onMapMouseMove(buttonMask, screenX, screenY, worldX, worldY) {
  
}

function onMapMouseUp(buttonMask, screenX, screenY, worldX, worldY) {
  
}

function onMapExtentsChange(worldTLX, worldTLY, worldBRX, worldBRY) {
  
}

function onLayerResponseCb(sName, sURL, sBody, sAction, dWorldTLX, dWorldTLY, dWorldBRX, dWorldBRY, sResponse) {
  if(sResponse == "NCS_OVERLAY_SUCCESS") {
  
  } else if(sResponse.substr(0, ("NCS_OVERLAY_FAILURE").length) == "NCS_OVERLAY_FAILURE") {
    // alert("Overlay Error\r\nURL: " + sURL + "\r\nBody: " + sBody + "\r\nResponse: " + sResponse);
  } else {
    // alert(sResponse);
  }
}

function onMapPercentCompleteStatus(p) {
  // do NOT use PARAM_VIEW_ONPERCENTCOMPLETE callback!
  // ecwview event continues firing 100 at 100%
  if (p < 100) {
    info = p + '%...';
  } else {
    info = '100%';
  }
  // info ..
}


// *** utilities
/*
* Saves a point with his lat/lon values and world-coordinates.
*/
function pointGIS(_lat, _lon, _worldX, _worldY) {
  this.lat = _lat;
  this.lon = _lon;
  this.worldX = _worldX;
  this.worldY = _worldY;

  this.move = function (_lat, _lon, _worldX, _worldY) {
    this.lat = _lat;
    this.lon = _lon;
    this.worldX = _worldX;
    this.worldY = _worldY;
  }
  
  this.dbg = function() {
    alert(this.lat + ', ' + this.lon + '\n' + this.worldX + ', ' + this.worldY);
  }
}

/*
* Saves coordinates of a rectangle.
*/
function rectGIS(_worldtlx, _worldtly, _worldbrx, _worldbry) {
  this.worldTLX = _worldtlx;
  this.worldTLY = _worldtly;
  this.worldBRX = _worldbrx;
  this.worldBRY = _worldbry;
}

var CM_DEC = 1;
var CM_DEG = 2;
var CM_WORLD = 4;
var CM_SOLAR = 8;
var CM_HISTORIC = 16;
var CM_GRIDSQUARE = 32;

var OFFSET_FERRO = 17 + (39 / 60) + ((46 / 60) / 100);

/**
* Takes the value with the given precision. If no precision is set then the precision is 2.
*
* ex.: value = 12,65543354
* no precision => 12,66
* precision = 3 => 12,655
*/
function roundEx(value, precision) {
  precision = (!precision ? 2 : precision);
  return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);
}

/*
* Converts decimal value to degree, minute and sec format.
*
* USED by this.getCoords()
*/
function decToDMS(dec) {
  var deg = Math.floor(dec);
  dec = (dec - deg) * 60;
  var min = Math.floor(dec);
  var sec = (dec - min) * 60;
  sec = roundEx(sec, 2);
  return deg + '&#xB0; ' + min + '&#x2032; ' + sec + '&#x2033;';
}

/*
* Transforms a point to a string with the representation in different coordinatesystems.
* The constants to use for coordsmode are: CM_DEC,CM_DEG,CM_GRIDSQUARE,CM_WORLD and CM_SOLAR
* @param _point Point to convert
* @param _units For world-coordinates, only if CM_WORLD in coordsmode is set.
* @param coordsmode Bitmap for transform-modes (CM_DEC,CM_DEG,CM_GRIDSQUARE,CM_WORLD, CM_SOLAR)
*/
function getCoords(_point, _units, coordsmode) {
  // cell units
  _unit = ''
  switch (_units) {
    case CU_INVALID:
      break;
    case CU_METERS:
      _unit = 'm'
      break;
    case CU_DEGREES:
      _unit = '°'
      break;
    case CU_FEET:
      _unit = 'ft'
  }
  
  // direction
  _ns = (_point.worldY < 0 ? 'S' : 'N');
  _we = (_point.worldX < 0 ? 'W' : 'O');
	
	_coords = '';

	if ((coordsmode & CM_DEC) || (coordsmode & CM_DEG)) {
	  // projected coords
	  if (!isNaN(_point.lat) && !isNaN(_point.lon)) {
	    if (coordsmode & CM_HISTORIC) {
	      lon0 = _point.lon + OFFSET_FERRO;
	    } else {
	      lon0 = _point.lon;
	    }
	    
	    if (coordsmode & CM_DEG) {
	      _coords = decToDMS(_point.lat) + ' ' + _ns + ' ' + decToDMS(lon0) + ' ' + _we;
	    } else {
	      _coords = Math.abs(roundEx(_point.lat, 6)) + '° ' + _ns + ' ' + Math.abs(roundEx(lon0, 6)) + '° ' + _we;
	    }
	    
	  } else {
	    _coords = '(Transformation nicht möglich)';
	  }
	}

	if (coordsmode & CM_GRIDSQUARE) {
	  if (!isNaN(_point.lat) && !isNaN(_point.lon)) {
	    tmpLabel = getGridSquare(_point);
	    if (tmpLabel != '') {
	      _coords += ' [' + tmpLabel + ']';
	    }
	  }
	}
	
	if (coordsmode & CM_WORLD) {
	  if (_coords != '') {
	    _coords += '<br />';
	  }
	  _coords += Math.abs(roundEx(_point.worldY, 6)) + _unit + ' ' + _ns + ' ' + Math.abs(roundEx(_point.worldX, 6)) + _unit + ' ' + _we;
	}
	
  if (coordsmode & CM_SOLAR) {
    if (!isNaN(_point.lat) && !isNaN(_point.lon)) {
      var now = new Date();
      _rise = getRise(_point.lat, (-1) * _point.lon, now);
      _set = getSet(_point.lat, (-1) * _point.lon, now);

      if (_coords != '') {
        _coords += '<br />';
      }
      _coords += 'Sonnenaufgang: ' + _rise + '\nSonnenuntergang: ' + _set + ' (UTC)';
    }
  }
  
	return(_coords); 
}

/*
* Identifies the sheet for the legend-thumb.
*/
function identSheet(ecwview) {
  mx = 5000274;//x-value of the midpoint of the 3 wenker cards.
  my = 9970571;//y-value of the midpoint of the 3 wenker cards.
  srcx0 = ecwview.GetTopLeftWorldCoordinateX();
  srcy0 = ecwview.GetTopLeftWorldCoordinateY();
  srcx1 = ecwview.GetBottomRightWorldCoordinateX();
  srcy1 = ecwview.GetBottomRightWorldCoordinateY();
  srcmx = (srcx0 + srcx1) / 2;
  srcmy = (srcy0 + srcy1) / 2;

  // wenker maps reliably use CU_METERS
  w = srcx1 - srcx0;
  h = srcy0 - srcy1;

  if (w > 1000000 || h > 1000000) {
    // zoom window too large for a guess
    return ('ZOOM_IN');
  } else {
    if (srcmx > mx) {
      // E
      if (srcmy < my) {
        return ('SO');
      } else {
        return ('NO');
      }

    } else {
      // W
      if (srcmy < my) {
        return ('SW');
      } else {
        return ('NW');
      }

    }
  }
}

/*
* Returns the square of the point.  
* See also hashtables for grid square labels below.
*/
function getGridSquare(_point) {
  if ((_point.lat < yLabels[0][0]) || (_point.lat > yLabels[yLabels.length - 1][1])
    || (_point.lon < xLabels[0][0]) || (_point.lon > xLabels[xLabels.length - 1][1])) {
    return ('');
  }

  var tmpLabel = '';
// search the label for y
  for (i = 0; i <= yLabels.length - 1; i++) {
    if ((yLabels[i][0] <= _point.lat) && (yLabels[i][1] >= _point.lat)) {
      tmpLabel = yLabels[i][2];
      break;
    }
  }
// search the label for x
  for (i = 0; i <= xLabels.length - 1; i++) {
    if ((xLabels[i][0] <= _point.lon) && (xLabels[i][1] >= _point.lon)) {
      tmpLabel += ' ' + xLabels[i][2];
      break;
    }
  }

  return (tmpLabel);
}

//=========================================================================================
// hashtables for grid square labels
var xLabels = [
[5.84233333333334, 6.009, 2],
[6.009, 6.17566666666667, 3],
[6.17566666666667, 6.34233333333334, 4],
[6.34233333333334, 6.509, 5],
[6.509, 6.67566666666667, 6],
[6.67566666666667, 6.84233333333334, 7],
[6.84233333333334, 7.009, 8],
[7.009, 7.17566666666667, 9],
[7.17566666666667, 7.34233333333334, 10],
[7.34233333333334, 7.509, 11],
[7.509, 7.67566666666667, 12],
[7.67566666666667, 7.84233333333334, 13],
[7.84233333333334, 8.009, 14],
[8.009, 8.17566666666667, 15],
[8.17566666666667, 8.34233333333334, 16],
[8.34233333333334, 8.509, 17],
[8.509, 8.67566666666667, 18],
[8.67566666666667, 8.84233333333334, 19],
[8.84233333333334, 9.009, 20],
[9.009, 9.17566666666667, 21],
[9.17566666666667, 9.34233333333334, 22],
[9.34233333333334, 9.509, 23],
[9.509, 9.67566666666667, 24],
[9.67566666666667, 9.84233333333334, 25],
[9.84233333333334, 10.009, 26],
[10.009, 10.1756666666667, 27],
[10.1756666666667, 10.3423333333333, 28],
[10.3423333333333, 10.509, 29],
[10.509, 10.6756666666667, 30],
[10.6756666666667, 10.8423333333333, 31],
[10.8423333333333, 11.009, 32],
[11.009, 11.1756666666667, 33],
[11.1756666666667, 11.3423333333333, 34],
[11.3423333333333, 11.509, 35],
[11.509, 11.6756666666667, 36],
[11.6756666666667, 11.8423333333333, 37],
[11.8423333333333, 12.009, 38],
[12.009, 12.1756666666667, 39],
[12.1756666666667, 12.3423333333333, 40],
[12.3423333333333, 12.509, 41],
[12.509, 12.6756666666667, 42],
[12.6756666666667, 12.8423333333333, 43],
[12.8423333333333, 13.009, 44],
[13.009, 13.1756666666667, 45],
[13.1756666666667, 13.3423333333333, 46],
[13.3423333333333, 13.509, 47],
[13.509, 13.6756666666667, 48],
[13.6756666666667, 13.8423333333333, 49],
[13.8423333333333, 14.009, 50],
[14.009, 14.1756666666667, 51],
[14.1756666666667, 14.3423333333333, 52],
[14.3423333333333, 14.509, 53],
[14.509, 14.6756666666667, 54],
[14.6756666666667, 14.8423333333333, 55],
[14.8423333333333, 15.009, 56],
[15.009, 15.1756666666667, 57],
[15.1756666666667, 15.3423333333333, 58],
[15.3423333333333, 15.509, 59],
[15.509, 15.6756666666667, 60],
[15.6756666666667, 15.8423333333333, 61],
[15.8423333333333, 16.009, 62],
[16.009, 16.1756666666667, 63],
[16.1756666666667, 16.3423333333333, 64],
[16.3423333333333, 16.509, 65],
[16.509, 16.6756666666667, 66],
[16.6756666666667, 16.8423333333333, 67],
[16.8423333333333, 17.009, 68],
[17.009, 17.1756666666667, 69],
[17.1756666666667, 17.3423333333333, 70],
[17.3423333333333, 17.509, 71],
[17.509, 17.6756666666667, 72],
[17.6756666666667, 17.8423333333333, 73],
[17.8423333333333, 18.009, 74],
[18.009, 18.1756666666667, 75],
[18.1756666666667, 18.3423333333333, 76],
[18.3423333333333, 18.509, 77],
[18.509, 18.6756666666667, 78],
[18.6756666666667, 18.8423333333333, 79],
[18.8423333333333, 19.009, 80],
[19.009, 19.1756666666667, 81],
[19.1756666666667, 19.3423333333333, 82],
[19.3423333333333, 19.509, 83],
[19.509, 19.6756666666667, 84],
[19.6756666666667, 19.8423333333333, 85],
[19.8423333333333, 20.009, 86],
[20.009, 20.1756666666667, 87],
[20.1756666666667, 20.3423333333333, 88],
[20.3423333333333, 20.509, 89],
[20.509, 20.6756666666667, 90],
[20.6756666666667, 20.8423333333333, 91],
[20.8423333333333, 21.009, 92],
[21.009, 21.1756666666667, 93],
[21.1756666666667, 21.3423333333333, 94],
[21.3423333333333, 21.509, 95],
[21.509, 21.6756666666667, 96],
[21.6756666666667, 21.8423333333333, 97],
[21.8423333333333, 22.009, 98],
[22.009, 22.1756666666667, 99],
[22.1756666666667, 22.3423333333333, 100],
[22.3423333333333, 22.509, 101],
[22.509, 22.6756666666667, 102],
[22.6756666666667, 22.8423333333333, 103],
[22.8423333333333, 23.009, 104],
[23.009, 23.1756666666667, 105],
[23.1756666666667, 23.3423333333333, 106]
];

var yLabels = [
[45.5, 45.5833333333333, 'z\'\''],
[45.5833333333333, 45.6666666666667, 'y\'\''],
[45.6666666666667, 45.75, 'x\'\''],
[45.75, 45.8333333333333, 'w\'\''],
[45.8333333333333, 45.9166666666667, 'v\'\''],
[45.9166666666667, 46, 'u\'\''],
[46, 46.0833333333333, 't\'\''],
[46.0833333333333, 46.1666666666667, 's\'\''],
[46.1666666666667, 46.25, 'r\'\''],
[46.25, 46.3333333333333, 'q\'\''],
[46.3333333333333, 46.4166666666667, 'p\'\''],
[46.4166666666667, 46.5, 'o\'\''],
[46.5, 46.5833333333333, 'n\'\''],
[46.5833333333333, 46.6666666666667, 'm\'\''],
[46.6666666666667, 46.75, 'l\'\''],
[46.75, 46.8333333333333, 'k\'\''],
[46.8333333333333, 46.9166666666667, 'i\'\''],
[46.9166666666667, 47, 'h\'\''],
[47, 47.0833333333333, 'g\'\''],
[47.0833333333333, 47.1666666666667, 'f\'\''],
[47.1666666666667, 47.25, 'e\'\''],
[47.25, 47.3333333333333, 'd\'\''],
[47.3333333333333, 47.4166666666667, 'c\'\''],
[47.4166666666667, 47.5, 'b\'\''],
[47.5, 47.5833333333333, 'a\'\''],
[47.5833333333333, 47.6666666666667, 'z\''],
[47.6666666666667, 47.75, 'y\''],
[47.75, 47.8333333333333, 'x\''],
[47.8333333333333, 47.9166666666667, 'w\''],
[47.9166666666667, 48, 'v\''],
[48, 48.0833333333333, 'u\''],
[48.0833333333333, 48.1666666666667, 't\''],
[48.1666666666667, 48.25, 's\''],
[48.25, 48.3333333333333, 'r\''],
[48.3333333333333, 48.4166666666667, 'q\''],
[48.4166666666667, 48.5, 'p\''],
[48.5, 48.5833333333333, 'o\''],
[48.5833333333333, 48.6666666666667, 'n\''],
[48.6666666666667, 48.75, 'm\''],
[48.75, 48.8333333333333, 'l\''],
[48.8333333333333, 48.9166666666667, 'k\''],
[48.9166666666667, 49, 'i\''],
[49, 49.0833333333333, 'h\''],
[49.0833333333333, 49.1666666666667, 'g\''],
[49.1666666666667, 49.25, 'f\''],
[49.25, 49.3333333333333, 'e\''],
[49.3333333333333, 49.4166666666667, 'd\''],
[49.4166666666667, 49.5, 'c\''],
[49.5, 49.5833333333333, 'b\''],
[49.5833333333333, 49.6666666666667, 'a\''],
[49.6666666666667, 49.75, 'Z\''],
[49.75, 49.8333333333333, 'Y\''],
[49.8333333333333, 49.9166666666667, 'X\''],
[49.9166666666667, 50, 'W\''],
[50, 50.0833333333333, 'V\''],
[50.0833333333333, 50.1666666666667, 'U\''],
[50.1666666666667, 50.25, 'T\''],
[50.25, 50.3333333333333, 'S\''],
[50.3333333333333, 50.4166666666667, 'R\''],
[50.4166666666667, 50.5, 'Q\''],
[50.5, 50.5833333333333, 'P\''],
[50.5833333333333, 50.6666666666667, 'O\''],
[50.6666666666667, 50.75, 'N\''],
[50.75, 50.8333333333333, 'M\''],
[50.8333333333333, 50.9166666666667, 'L\''],
[50.9166666666667, 51, 'K\''],
[51, 51.0833333333333, 'I\''],
[51.0833333333333, 51.1666666666667, 'H\''],
[51.1666666666667, 51.25, 'G\''],
[51.25, 51.3333333333333, 'F\''],
[51.3333333333333, 51.4166666666667, 'E\''],
[51.4166666666667, 51.5, 'D\''],
[51.5, 51.5833333333333, 'C\''],
[51.5833333333333, 51.6666666666667, 'B\''],
[51.6666666666667, 51.75, 'A\''],
[51.75, 51.8333333333333, 'z'],
[51.8333333333333, 51.9166666666667, 'y'],
[51.9166666666667, 52, 'x'],
[52, 52.0833333333333, 'w'],
[52.0833333333333, 52.1666666666667, 'v'],
[52.1666666666667, 52.25, 'u'],
[52.25, 52.3333333333333, 't'],
[52.3333333333333, 52.4166666666667, 's'],
[52.4166666666667, 52.5, 'r'],
[52.5, 52.5833333333333, 'q'],
[52.5833333333333, 52.6666666666667, 'p'],
[52.6666666666667, 52.75, 'o'],
[52.75, 52.8333333333333, 'n'],
[52.8333333333333, 52.9166666666667, 'm'],
[52.9166666666667, 53, 'l'],
[53, 53.0833333333333, 'k'],
[53.0833333333333, 53.1666666666667, 'i'],
[53.1666666666667, 53.25, 'h'],
[53.25, 53.3333333333333, 'g'],
[53.3333333333333, 53.4166666666667, 'f'],
[53.4166666666667, 53.5, 'e'],
[53.5, 53.5833333333333, 'd'],
[53.5833333333333, 53.6666666666667, 'c'],
[53.6666666666667, 53.75, 'b'],
[53.75, 53.8333333333333, 'a'],
[53.8333333333333, 53.9166666666667, 'Z'],
[53.9166666666667, 54, 'Y'],
[54, 54.0833333333333, 'X'],
[54.0833333333333, 54.1666666666667, 'W'],
[54.1666666666667, 54.25, 'V'],
[54.25, 54.3333333333333, 'U'],
[54.3333333333333, 54.4166666666667, 'T'],
[54.4166666666667, 54.5, 'S'],
[54.5, 54.5833333333333, 'R'],
[54.5833333333333, 54.6666666666667, 'Q'],
[54.6666666666667, 54.75, 'P'],
[54.75, 54.8333333333333, 'O'],
[54.8333333333333, 54.9166666666667, 'N'],
[54.9166666666667, 55, 'M'],
[55, 55.0833333333333, 'L'],
[55.0833333333333, 55.1666666666667, 'K'],
[55.1666666666667, 55.25, 'I'],
[55.25, 55.3333333333333, 'H'],
[55.3333333333333, 55.4166666666667, 'G'],
[55.4166666666667, 55.5, 'F'],
[55.5, 55.5833333333333, 'E'],
[55.5833333333333, 55.6666666666667, 'D'],
[55.6666666666667, 55.75, 'C'],
[55.75, 55.8333333333333, 'B'],
[55.8333333333333, 55.9166666666667, 'A']
];

