Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Conervsion formula for XY coordinates of Picture Box to Lat/Long

Conervsion formula for XY coordinates of Picture Box to Lat/Long

Scheduled Pinned Locked Moved C#
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kjsl2k9
    wrote on last edited by
    #1

    Hi, Do anyone know the formula for converting XY coordinates of Picture Box to Latitude and Longitude of Earth. Thanks.

    A L 2 Replies Last reply
    0
    • K kjsl2k9

      Hi, Do anyone know the formula for converting XY coordinates of Picture Box to Latitude and Longitude of Earth. Thanks.

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      kjsl2k9 wrote:

      converting XY coordinates of Picture Box to Latitude and Longitude of Earth

      what does it mean?? do you mean you need to apply Great Circle formula to the picturebox ?? Or you need to geocode the area that is shown in the picture. If you mean the later, it is impossible... :-D :-D

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      1 Reply Last reply
      0
      • K kjsl2k9

        Hi, Do anyone know the formula for converting XY coordinates of Picture Box to Latitude and Longitude of Earth. Thanks.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        First of all, you must know how to convert degree,minute,second to decimal and vice versa... The next step, you must know, how big is your image (for example : 1000x1000 pixel) Then you must know, which coordinate is the left, right, top and bottom side. For example : Image is X = 1000 pixel Y = 1000 pixel Left = 0° Right = 10° Top = 0° Bottom = 10° That means horizontal at pixel 500 is (500*10)/1000 = 5° and vertical pixel 300 is (300*10)/1000 = 3° and so on...

        K 1 Reply Last reply
        0
        • L Lost User

          First of all, you must know how to convert degree,minute,second to decimal and vice versa... The next step, you must know, how big is your image (for example : 1000x1000 pixel) Then you must know, which coordinate is the left, right, top and bottom side. For example : Image is X = 1000 pixel Y = 1000 pixel Left = 0° Right = 10° Top = 0° Bottom = 10° That means horizontal at pixel 500 is (500*10)/1000 = 5° and vertical pixel 300 is (300*10)/1000 = 3° and so on...

          K Offline
          K Offline
          kjsl2k9
          wrote on last edited by
          #4

          Hi, I had used the formula for calculating the Lat and Long by first calculating the dX and dY and then applying the following formula : - public point XYtoLatLong(float X, float Y) { float Lat = LAT0 + dY * Y ; float Long = LONG0 + dX * X ; point pnt = new point(X, Y, Lat, Long); return pnt; } where X and Y are the points of the picture box where the mouse is moved , Lat0 and Long0 are calulated as : - delX = (maxLONG().LONG - minLONG().LONG) / (maxLONG().X - minLONG().X); delY = (minLAT().LAT - maxLAT().LAT) / (minLAT().Y - maxLAT().Y); lat0 = maxLAT().LAT - maxLAT().Y * dY; long0 = minLONG().LONG - minLONG().X * dX; maxLat and maxLong are used for getting the maximum Lat and Long but the Lat and Long I am getting is giving the error of -0.00478 in Lat and +0.00389 in Long.How can I remove the Error. Thanks

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups