X, Y to GPS Coords... help a math dummy

If im not mistaken, if I have a map of say, Wisconsin, and I know what the Latitude coords (degrees, hours, minutes) of the top and bottom of the map, and I know how many pixels tall the map is, then I should be able to convert, with math, degrees:hours:mins to pixels. (same thing with longitude, but lets just focus on one way first)

I would first find out how may hours (minutes would be over kill for my app) there are to a pixel. Thats pretty easy. But this gives me a decimal number. How do i convert a decimal value (like 10.25) back to degrees and hours (in other words, how do i make .25 a “60” based value)?

Ultimately, i want the user to be able to input coords in the form of degrees, hours, mins. Then convert that to X, Y (to place a marker on the map).

Has any one had experience with this or know how to do this? Probably just some easy math…right? :tb:

From what i now degrees, hours, minutes have this:

60" means 1’ and 60’ means 1* so if you have 20.90 you have 21*30’ ( i think it’s ok :slight_smile: )

U can use:


Math.round();

To transform the 20.90 to 21:) if a number it’s under x.50 it will change to x.00 and if its more then or equals with x.50 it will change to x+1.00

I hope i helped you.

good morning btibia (it’s morning here :slight_smile: )

Thank you for the reply, but I’m not sure how to follow what you replied with to a solution on my end. I understand Math.round… but i don’t understand how you’re converting a decimal number to degrees:hours:min (and in turn, converting a GPS coordinate into a X, Y position on an arbitrarily scaled map)

If you have an Atlas at home :slight_smile: take a small look, on every map they have a small SCALE. So you need to think like this (just a small exemple):

1degree = 10cm

Then if you have hours,minutes you go down with mm,etc.

And to change from cm to pixels use Adobe Photoshope :slight_smile:

I found that 10cm = 283 pixels

I hope i helped you with something…i like this thread,so we can speak more here, until you finish the problem.

Good mornin!! :slight_smile: