Esempio n. 1
0
 private Coordinate PointToCoord(int x, int y)
 {
     Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));
     return p.PointToCoord(new Point(x, y));
 }
Esempio n. 2
0
        private int LonToX(double lon)
        {
            Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));

            Point point = p.CoordToPoint(new Coordinate(lon, 0));
            return point.X;

            //return (int)(this.Width * (lon - bounds.XMin) / bounds.Width);
        }
Esempio n. 3
0
        private double LonFromX(int x)
        {
            Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));

            Coordinate c = p.PointToCoord(new Point(x, 0));
            return c.Longitude;

            //return bounds.XMin + bounds.Width * ((double)x / this.Width);
        }
Esempio n. 4
0
        private double LatFromY(int y)
        {
            //Projection p = new Projection(bounds.Height, this.Height);
            Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));

            Coordinate c = p.PointToCoord(new Point(0, y));
            return c.Latitude;

            //return bounds.YMin + bounds.Height * ((double)y / this.Height);
        }
Esempio n. 5
0
 private Point CoordToPoint(double lon, double lat)
 {
     Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));
     return p.CoordToPoint(new Coordinate(lon, lat));
 }
Esempio n. 6
0
 /// <summary>
 /// Returns a Point in pixel-coordinates from a Node with
 /// geological coordinates. The Point is in coordinates for the
 /// entire map so it should be converted to coordinates for the
 /// specific tile that is drawn.
 /// </summary>
 private Point nodeToTilePoint(BBox box, Bitmap tile, Node node)
 {
     Coordinate c = new Coordinate(node.Longitude, node.Latitude);
     Projection p = new Projection(box.Width, tile.Width, new Coordinate(box.XMin, box.YMax));
     return p.CoordToPoint(c);
 }