# How to calculate scale

I'm working on processing some geo-spatial raster data, JOG-A raster to be exact, and know the imagery is supposed to be to a scale of 1:250000. However I would like to calculate this in code but am not coming up with the correct values.

Here are the bounds of a single image and other values needed for calculations. (coordinates are in degrees, EPSG:4326)

``````Meters Per Degree: 111319
Image Size: x: 1536 y: 1536
DPI: 90
Upper Left:   Longitude: -89.5431 Latitude: 33.6529
Upper Right:  Longitude: -88.8578 Latitude: 33.6529
Bottom Right: Longitude: -88.8578 Latitude: 33.1351
Bottom Left:  Longitude: -89.5431 Latitude: 33.1351
``````

I thought I could say

``````(degLatA - degLatB) * meterPerDeg / imageSizeY * dpi / 0.0254
33.6529deg - 33.1351deg = 0.5177deg
\$1 deg * 111319m/deg = 57634m
\$2 m / 1536px = 37.52m/px
\$3 m/px * (90px/in * 1in/0.0254m) = 132953
``````

which gives a scale of 1:132953 ... not even close! The units all cancel great, but as you can see from the calculation, the value is not even close to 250k.

Can anyone explain where I'm wrong?

EDIT: The math for calculation is all correct, I just needed the correct DPI which for CADRG imagery is 169 according to the SPEC documents. (buried on page 10 if you want to verify or read for yourself).

• "Meters per degree" is only approximately correct in the north-south direction and totally wrong east-west (it's off by about 17%). If your coordinates really are lat-lon, then computing a unique scale is hopeless, since the scale varies at each point depending on the direction. You have to decide on which scale you want to report (that is, at which specific location and in what direction) and on how accurately you want to compute it. – whuber Mar 27 '15 at 20:34
• Welcome to GIS SE. Mind using edit to trim off some of those useless decimal places -- they hurt my eyes? – Martin F Mar 28 '15 at 22:11
• Some Qs that address your issues follow: – Martin F Mar 28 '15 at 22:40
• thanks for the replies, and I'll look into the links you sent Martin. I cut everything to 4 decimal places and am not worried about a precise scale, just something relatively close. I just want to know how to calculate a value relatively close to the stated scale. i.e.: JOG-A imagery which is stated to be at a 1:250k scale how do I get a value close to that 250k? – weagle08 Mar 30 '15 at 14:47