+ Reply to Thread
Results 1 to 3 of 3

Thread: How to Caluculate Lat/Lon from Polar Stereo Maps

  1. #1
    esrij ms
    Join Date
    Apr 2012
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default How to Caluculate Lat/Lon from Polar Stereo Maps

    I would like to know that how to implementation to show the Latitude and Longiitude with mouse move on north-polar stereo map (WKID : 102018) and south-polar stereo map (WKID : 102021) other than calling a geometry service.

    I have tried the below code, but can't get correct value.
    Please teach me a correct expression.

    Code:
            private void map1_MouseMove(object sender, MouseEventArgs e)
            {
                if (map1.SpatialReference.WKID == 102018)
                {
                    System.Windows.Point screenPoint = e.GetPosition(map1);
                    MapPoint mapPoint = map1.ScreenToMap(screenPoint);
    
                    Double p = Math.Sqrt((mapPoint.Y * mapPoint.Y) + (mapPoint.X * mapPoint.X));
                    Double lat = Math.Acos(mapPoint.X / p);
                    lat = lat * 180 / Math.PI + 90;
    
                    Double lon = Math.PI / 2 - Math.Atan(p / (2 * 6378.137 * 1000));
                    lon = lon * 180 / Math.PI / 2;
    
                    LatitudeTextBlock.Text = string.Format("Latitude: Y = {0}", lat);
                    LongiitudeTextBlock.Text = string.Format("Longiitude: X = {0}", lon);
                }
            }

  2. #2
    Chris Bradberry
    Join Date
    Apr 2010
    Posts
    152
    Points
    13
    Answers Provided
    1


    0

    Default Re: How to Caluculate Lat/Lon from Polar Stereo Maps

    It would be much easier to use the geometry service to project the coordinates.

    http://help.arcgis.com/en/webapi/sil...tm#MouseCoords

    That gives you the coordinates, and you will have to add some code to project the coordinates using:

    http://help.arcgis.com/en/webapi/sil...rt.htm#Project

    Chris
    Chris Bradberry
    Oregon Dept of Forestry

  3. #3
    esrij ms
    Join Date
    Apr 2012
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Re: How to Caluculate Lat/Lon from Polar Stereo Maps

    Thank you for comment.
    Your method is much easier, however it is a little bit heavy to show the Latitude and Longitude with mouse move at all time.
    I would like to consider to use the geometry service.

    Thanks!

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts