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).
-
2"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– whuber2015年03月27日 20:34:42 +00:00Commented Mar 27, 2015 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– Martin F2015年03月28日 22:11:29 +00:00Commented Mar 28, 2015 at 22:11
-
Some Qs that address your issues follow:Martin F– Martin F2015年03月28日 22:40:15 +00:00Commented Mar 28, 2015 at 22:40
-
gis.stackexchange.com/questions/75528/… gis.stackexchange.com/questions/116119/… gis.stackexchange.com/questions/99812/… gis.stackexchange.com/questions/5821/… gis.stackexchange.com/questions/122703/… gis.stackexchange.com/questions/120312/…Martin F– Martin F2015年03月28日 22:40:32 +00:00Commented Mar 28, 2015 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– weagle082015年03月30日 14:47:01 +00:00Commented Mar 30, 2015 at 14:47
1 Answer 1
Your calculations appear to be sound. I suspect the problem is with the very first assumption: "the imagery is supposed to be to a scale of 1:250000" (emphasis mine).
I know nothing of JOG-A or CADRG but I do know that, when it comes to displaying images on a computer screen, there are often many scale transformations that take place between the original image creation and the final display on a computer screen. There can be so many scale changes that an original statement of scale can appear to be almost meaningless in a later context.
In the case of analog photogrammetry – I use this because at least the film (the negative) had a fixed physical size – the imagery is given a nominal scale relating measurements on the original photographic contact print (inches, say) and measurements on the ground (e.g., miles). Even if the images have been enlarged or reduced, for reasons of convenience, the original statement of scale is often carried with the imagery as part of the meta data, to give folks an idea of how much detail is captured. Ideally, there would be notes that the statement refers to the original capture and not to any current reduction/enlargement, but these may be missing.
As soon as you move into the digital realm, the display scale can so easily be changed – intentionally by users/designers/publishers or automatically by software (to make things fit the page/screen) – it soon becomes very difficult to reconcile nominal statements of scale with actual physical measures of scale. That is why "bar scales", or graphical scales that are part of the map or image, are so useful.
-
if only you worked here on our team so I could show you what I'm trying to do! I need your knowledge here! lol... I will keep working at this and will report back the solution when I come up with it. You are probably right about the moving from print to digital thought because most CADRG maps are scanned images and so they were originally 1:250k but when moved to digital it may now be impossible to come up with that scale via calculations.weagle08– weagle082015年03月31日 16:11:50 +00:00Commented Mar 31, 2015 at 16:11
-
1gave you credit for the answer since your explanation here got me to thinking and eventually brought me to the correct DPI.weagle08– weagle082015年04月01日 20:07:00 +00:00Commented Apr 1, 2015 at 20:07