示例#1
0
 public PointD GetMercatorCoordinate(PointD LatitudeLongitudePoint)
 {
     double mx = LatitudeLongitudePoint.X * OriginShift / 180;
     double my = Math.Log(Math.Tan((90 + LatitudeLongitudePoint.Y) * Math.PI / 360)) / (Math.PI / 180);
     my = my * OriginShift / 180;
     PointD mercatorPoint = new PointD(mx, my);
     return mercatorPoint;
 }
示例#2
0
 public Point GetPixels(PointD MercatorPoint, Int32 Zoom)
 {
     double res = Resolution(Zoom);
     Int32 px = (int)((MercatorPoint.X + OriginShift) / res);
     Int32 py = (int)((MercatorPoint.Y + OriginShift) / res);
     Point p = new Point(px, py);
     return p;
 }
示例#3
0
 public Point GetBitmapCoord(PointD mercatorPoint, Int32 zoom)
 {
     Double res = Resolution(zoom);
     Int32 x = Convert.ToInt32((mercatorPoint.X + OriginShift) / res);
     Int32 y = Convert.ToInt32((mercatorPoint.Y + OriginShift) / res);
     Point p = new Point(x, y);
     return p;
 }
示例#4
0
 public Point GetTile(PointD mercatorPoint, Int32 zoom)
 {
     Point pix = GetPixels(mercatorPoint, zoom);
     return GetTile(pix);
 }
 public void LatLonToMercatorY()
 {
     PointD expected = new PointD(15926263.117, -4643725.484);
     Assert.AreEqual(expected.Y, Math.Round(mercatorPoint.Y,3));
 }
 public void init()
 {
     globalMercator = new GlobalMercator();
     latitudeLongitudePoint = new PointD(143.068055770704, -38.4537515036619);
     mercatorPoint = new PointD(15926263.117, -4643725.484);
 }
 public void BitmapPointTestY()
 {
     Point p = new Point(459, 197);
     PointD pM = new PointD(15926263.117, -4643725.484);
     Assert.AreEqual(p.Y, globalMercator.GetBitmapCoord(pM, 1).Y);
 }
示例#8
0
        public Point GetTile(PointD mercatorPoint, Int32 zoom)
        {
            Point pix = GetPixels(mercatorPoint, zoom);

            return(GetTile(pix));
        }