this needs to be updated a bit to reflect new way to create directory path for the jp2 and dem files

A typical file is 00x126156800y25395200.jp2

x126156800 y25395200 is upper left hand corner of tile (long lat) x and y are just used to parse name. 00 is there to denote type of data 00 in this case means longitude/latitude in DD.

to make them int, the long and lat has been multiplied by 1,000,000

so x126156800 / 1000000 = 126.156800 longitude in DD (generally we want to keep six decimal .123456 places for precision purposes) Longitude values are between -180 and 180 DD, Lat between -90 and 90 DD.

so upper left had corner of the world would be 00x-180000000y90000000.jp2

Two neighboring sample files in one of my folders in sort order: M:\jp2\aomori\819200\00x125337600y37683200.jp2 M:\jp2\aomori\819200\00x126156800y25395200.jp2

notice the x part (longitude) is different, it is different by the tile size 126156800 - 125337600 = 819200

819200 is the tile size in Decimal Degrees, it is used in the path name, and is one of generally 6 layers.

so to compute BBOX of 00x126156800y25395200.jp2

x126156800 = ULLON = 126156800
y25395200 = ULLAT = 25395200

so LRLON = 126156800(ULLON) + 819200 = 126976000
so LRLAT = 25395200 (ULLAT) - 819200 = 24576000

The problem is that WMS BBOX is usually LLLON LLLAT URLON URLAT(xmin, ymin, xmax and ymax), the opposite of what we have above.

so to get BBOX you would have to use

knowing that

ULLON = LLLON
ULLAT = URLAT
LRLON = URLON
LRLAT = LLLAT

So BBOX is the same as ULLON LRLAT LRLON LLLAT