ArcStache.WebMercatorUtil.GeographicToWebMercator C# (CSharp) Method

GeographicToWebMercator() public static method

Converts a coordinate pair in geographic projection (WKID 4326) to web mercator auxillary sphere (102100).
public static GeographicToWebMercator ( double latitude, double longitude ) : Point
latitude double The latitude coordinate.
longitude double The longitude coordinate.
return Point
        public static Point GeographicToWebMercator(double latitude, double longitude)
        {
            var x = LongitudeToX(longitude);
            var y = LatitudeToY(latitude);
            return new Point() { X = x, Y = y };
        }

Usage Example

Example #1
0
        private IPoint GeographicToWebMercatorPoint(IPoint geographicPoint)
        {
            Point  tempPoint = WebMercatorUtil.GeographicToWebMercator(geographicPoint.Y, geographicPoint.X);
            IPoint point     = new PointClass();

            point.PutCoords(tempPoint.X, tempPoint.Y);
            point.SpatialReference = _spatialReference;
            return(point);
        }
All Usage Examples Of ArcStache.WebMercatorUtil::GeographicToWebMercator