// Converts a WMS tile coordinate (z,x,y) into a wgs bounding box
inline void xyzToWGS84(
    const int x, const int y, const int z, double &minx, double &miny, double &maxx, double &maxy)
{
    minx = x * TILE_SIZE;
    miny = (y + 1.0) * TILE_SIZE;
    maxx = (x + 1.0) * TILE_SIZE;
    maxy = y * TILE_SIZE;
    // 2^z * TILE_SIZE
    const double shift = (1u << static_cast<unsigned>(z)) * TILE_SIZE;
    pixelToDegree(shift, minx, miny);
    pixelToDegree(shift, maxx, maxy);
}
Beispiel #2
0
double LatLonConvert::bottomNorth()
{
	if (isGu()) {
		return northGreenich.southDegree(90);
	}else {
		double d = pixelToDegree((int)scrDaegak());
		double np = northGreenich.southDegree(d);
		double dy = mppToDegree();
		return baseWJ(np, dy) - dy;
	}
}
Beispiel #3
0
double LatLonConvert::mppToDegree()
{
	double degree = pixelToDegree(qMin(srcHeight(), srcHeight()));

	double dy = 10.0;
	if (degree < 1) {
		dy = 0.1;
	}else if(degree < 4) {
		dy = 0.5;
	}else if(degree < 8) {
		dy = 1.0;
	}else if(degree < 40) {
		dy = 5.0;
	}else {
		dy = 10.0;
	}
	return dy;
}
Beispiel #4
0
double LatLonConvert::rightGreenich()
{
	if (isGu()) {
		return northGreenich.eastDegree(180);
	}else {
		double d = pixelToDegree((int)scrDaegak());
		NorthGreenichPoint p1, p2;
		p1.set(north(), greenich());
		p1.moveEast(d);
		p1.moveNorth(d);
		p2.set(north(), greenich());
		p2.moveEast(d);
		p2.moveSouth(d);
		double gp = qMax(p1.greenich(), p2.greenich());
		gp = northGreenich.eastDegree(d);

		double dy = mppToDegree();
		double max =  baseWJ(gp, dy) + dy + dy;
		return max;
	}
}
Beispiel #5
0
double LatLonConvert::leftGreenich()
{
	if (isGu()) {
		return northGreenich.westDegree(180);
	}else {

		double d = pixelToDegree((int)scrDaegak());
		NorthGreenichPoint p1, p2;
		p1.set(north(), greenich());
		p1.moveNorth(d);
		p1.moveWest(d);
		p2.set(north(), greenich());
		p2.moveSouth(d);
		p2.moveWest(d);

		double gp = qMin(p1.greenich(), p2.greenich());
		gp = northGreenich.westDegree(d);

		double dy = mppToDegree();
		double min = baseWJ(gp, dy) - dy;
		return min;
	}
}