# How to calculate degrees per pixel in a given image? Or .nth of degree?

I am trying to make very rough estimates of Lat/Long coordinates in some random parking lot images. If I visit any such random parking lot on a Google map, I can click some driving area and Google gives me a location. For example.

Here is a parking lot image from Florida. (Hosted on wikimedia commons.)

The image is 1280 pixel width and I can find some pretty close coordinates for the corners of the building on the google map. Here is the corresponding map view served up at Google.

The left side of the Big Lots is very close to 30.180806, -82.670137. And the right side of the store is very close to 30.180752, -82.669594

So there is a LAT difference of 0.000054 and a LONG difference of 0.000543.

Let's say I measure the pixels of the Big Lots CarPark in the image and find it uses 800 pixels. With that, I can approximate the width of each pixel.

`0.000543 / 800 = 0.000000679 per pixel.`

My First Question (not so important) is: what is that 0.000000679 measurement called? (One 0.000000679 th of a degree per pixel?)

Anyway, to the real question.

If I have some other image, for which I cannot reliably find the location on map or GIS, how can I make a similar estimate, given close guess of the the locations LAT and LONG?

Example:

Here is another parking lot image for which I cannot know the exact location. I can make a guess that the store front is something like 100 feet wide, by counting the parking spaces. I might even guess the image is 120 feet wide, just for the sake of making calculations.

Then let's say I assign an arbitrary LAT / LONG to the pixel at the left side of the image, at ground level with the building foundation.

LAT 34.065154 LONG -118.468884

Note: I am also arbitrarily assuming the camera is facing directly north.

I can find on the internet that at this latitude, there are 363922 feet in a degree of longitude.

So, how can I calculate the 0.0000XXX per pixel?

I am given:

``````rough estimate of ground distance, 120 feet
estimated 363922 feet per degree latitude
left most pixel location:  34.065154, -118.468884
image pixel width 1280
``````

I should be able to estimate the LAT / LONG on the other side of the image right?

Here is my uneducated guess:

``````120 feet / 1280 pixels = 0.09375 ft/pixel
0.09375 ft/pixel / 363922 ft/deg/lat = 0.000000258 nth degree per pixel?
``````

If so, do I calculate the right side of the image like this?

``````-118.468884 + (0.000000258 * 1280) =
-118.468884 + 0.000329741 =
-118.468554259

LAT  34.065154
LONG -118.468554
``````

Is the same working for the latitude if I estimate the distance to the camera by counting the cars for instance?

• Wouldn't you be better off saying a parking space is on average 6 feet and estimate from that (get better average data than that rough estimate) based on that there's 9 spaces in front of the building which makes it 54 feet wide. BTW the unit is called Decimal Degrees which distinguishes it from Degrees, minutes, seconds which is the other common degree unit. It is IMPOSSIBLE TO GEOLOCATE JUST BY LOOKING AT A PICTURE. Commented Sep 26, 2014 at 0:56
• Thanks for the correct designtion. Decimal Degree. I guess the numbers are not super critical in this case. I've read that parking lot spaces are 8ft wide in the states though, so I just took a guess. I am just racking my brain to know the formula for the degrees per pixel. In fact, I don't even need a genuine location for this project, just a correct math that can come close if I have an assumed location to start with. Commented Sep 26, 2014 at 1:00
• Parking spaces in the states must be much more generous than in Australia, I'd estimate at about 6-7 feet wide. In this case the orientation of the camera is super important, after that it's Pythagorean mathematics (ignoring spherical aberration of camera lenses). Commented Sep 26, 2014 at 1:03
• My first car in 1985 was a rusted out '75 cadillac that I got for \$500. They were 6.5 ft wide. Commented Sep 26, 2014 at 1:10
• Mine was a Datsun 200B at Total width: 1630mm (5.34 ft)... don't see so many big cars like that in Australia, lanes are only 3.5m (11.48 ft) wide (officially) and you wouldn't like to use the left 2 feet too much. Commented Sep 26, 2014 at 1:15

After testing the math against the known location parking lot image, I am pretty sure my guess is correct.

I found distances between the type of lot in the map image vary in some parking lot code specifications that I located on Google.

In a two-way traffic direction, with 60 degree parking stalls, requirements vary from 55 to 62 feet between the long parallel lines.

Based on the left building edge next to the pizza place, and the appearance of a van on the right (at the edge of the parking lot) I counted 5 two-way traffic lanes.

Using 55 feet between them made a reasonably close result. Starting guess of left side longitude:

Doing the math:

``````330 estimated image width in feet
------------------------------------  = 0.2578125 feet per pixel
1280 image width in pixels

AND SO:

0.2578125 feet_per_pixel
------------------------------------  = 0.00000071 decimal degree per pixel
363699 feet_per_degree_of_longitude

Using the values calculated above:

-82.670329 + (0.00000071 * 1280) =
-82.670329 + 0.0009088 =
-82.669420

LAT        LON
Left  30.180805, -82.670329
Right 30.180805, -82.669420
``````

And here is the map location using my end result.

I think it is close enough for my project.

In case it ever comes up again, here are the equations.

``````                              ~                             ~
| estimated image width in feet |
|-------------------------------|
decimal degree per pixel =   |     image width in pixels     |
~                             ~
-------------------------------------
feet_per_degree_of_longitude

~                                                             ~
|  ~                                 ~                          |
| |  ~                             ~  |                         |
| | | estimated image width in feet | |                         |
| | |-------------------------------| |                         |
image right side longitude = | | |     image width in pixels     | | * image width in pixels | + image left side longitude
| |  ~                             ~  |                         |
| |-----------------------------------|                         |
| |    feet_per_degree_of_longitude   |                         |
|  ~                                 ~                          |
~                                                             ~
``````