Beispiel #1
0
        /// <summary>
        /// Converts Latitude/Longitude to Pixel X/Y
        /// </summary>
        /// <param name="lat">Latitude in Degrees</param>
        /// <param name="lon">Longitude in Degrees</param>
        public Tuple <int, int> latlon2xy(float lat, float lon)
        {
            var xy = GeoTools.lonlat2xy(satelliteLongitude, GeoTools.deg2rad(lon), GeoTools.deg2rad(lat), coff, cfac, loff, lfac);

            if (fixAspect)
            {
                xy = new Tuple <int, int>(xy.Item1, (int)(xy.Item2 * aspectRatio));
            }

            return(xy);
        }
Beispiel #2
0
        /// <summary>
        /// Converts Pixel X/Y to Latitude/Longitude
        /// </summary>
        /// <param name="x">The x coordinate.</param>
        /// <param name="y">The y coordinate.</param>
        public Tuple <float, float> xy2latlon(int x, int y)
        {
            var radCoord = GeoTools.xy2lonlat(satelliteLongitude, x, y, coff, cfac, loff, lfac);

            return(new Tuple <float, float>(GeoTools.rad2deg(radCoord.Item2), GeoTools.rad2deg(radCoord.Item1)));
        }