GeographicToWebMercator() публичный статический Метод

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.
Результат Point
Пример #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);
        }
Пример #2
0
        public static IEnvelope GetEnvelopeFromZoomRowCol(int zoom, int row, int col)
        {
            IEnvelope e = new EnvelopeClass();

            e.SpatialReference = GetSpatialReference(102100);
            IPoint llupperLeftPoint  = TileToGeographic(col, row, zoom);
            IPoint lllowerRightPoint = TileToGeographic(col + 1, row + 1, zoom);

            var    upperLeftPtWm    = WebMercatorUtil.GeographicToWebMercator(llupperLeftPoint.Y, llupperLeftPoint.X);
            IPoint wmUpperLeftPoint = new PointClass();

            wmUpperLeftPoint.X = upperLeftPtWm.X;
            wmUpperLeftPoint.Y = upperLeftPtWm.Y;

            var    lowerRightPtWm    = WebMercatorUtil.GeographicToWebMercator(lllowerRightPoint.Y, lllowerRightPoint.X);
            IPoint wmLowerRightPoint = new PointClass();

            wmLowerRightPoint.X = lowerRightPtWm.X;
            wmLowerRightPoint.Y = lowerRightPtWm.Y;

            e.UpperLeft  = wmUpperLeftPoint;
            e.LowerRight = wmLowerRightPoint;
            return(e);
        }