Conervsion formula for XY coordinates of Picture Box to Lat/Long
-
Hi, Do anyone know the formula for converting XY coordinates of Picture Box to Latitude and Longitude of Earth. Thanks.
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.
-
Hi, Do anyone know the formula for converting XY coordinates of Picture Box to Latitude and Longitude of Earth. Thanks.
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...
-
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...
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