Ejemplo n.º 1
0
 public Point[] GetUtmCorrectedRelativePolygon(TileXY tilexy, int zone)
 {
     double[] input  = new double[4];
     double[] result = new double[8];
     input[0] = box.top;
     input[1] = box.right;
     input[2] = box.bottom;
     input[3] = box.left;
     for (int i = 0; i < 4; i++)
     {
         input[i] = input[i] * Math.PI / 180;
     }
     MUtilities.LatLonRectangleExpandByUtm(zone, input, result);
     for (int i = 0; i < 8; i++)
     {
         result[i] = result[i] * 180 / Math.PI;
     }
     Point[] points = new Point[4];
     points[0] = BingProjection.LatLongToPixelXY(result[0], result[1], tilexy.level);
     points[1] = BingProjection.LatLongToPixelXY(result[2], result[3], tilexy.level);
     points[2] = BingProjection.LatLongToPixelXY(result[4], result[5], tilexy.level);
     points[3] = BingProjection.LatLongToPixelXY(result[6], result[7], tilexy.level);
     for (int i = 0; i < 4; i++)
     {
         points[i].X -= tilexy.x * 256;
         points[i].Y -= tilexy.y * 256;
     }
     return(points);
 }
Ejemplo n.º 2
0
 public Point[] GetRelativePolygon(TileXY tilexy)
 {
     Point[] points = new Point[4];
     points[0] = BingProjection.LatLongToPixelXY(box.top, box.left, tilexy.level);
     points[1] = BingProjection.LatLongToPixelXY(box.top, box.right, tilexy.level);
     points[2] = BingProjection.LatLongToPixelXY(box.bottom, box.right, tilexy.level);
     points[3] = BingProjection.LatLongToPixelXY(box.bottom, box.left, tilexy.level);
     for (int i = 0; i < 4; i++)
     {
         points[i].X -= tilexy.x * 256;
         points[i].Y -= tilexy.y * 256;
     }
     return(points);
 }