in reply to Re^8: Geo Package files
in thread Geo Package files
my $unpack_string = ($flag&0x1 == 0x1) ? "d<" : "d>"; ... my $minx = unpack($unpack_string, substr($geo,8,8));
But given that your CPU is little endian, that is what your unpack from Re^4: Geo Package files already showed a value of: 637590.385 is the correct value based on the 8 bytes 50 b8 1e c5 2c 75 23 41 : that is little-endian-double for 637590.385 . The problem is that you don't believe that number is correct. But since you have not apparently tried sanity-checking your interpretation with another tool, like swl suggested in Re^9: Geo Package files, you don't know if your belief is founded in reality or not. Maybe the "min" and "max" in the bounding box might not match the "min" and "max" of the values of the coordinates as stored; the portion of the spec I read wasn't clear on what the min and max were interpreted as. Or maybe the data set you were given just mis-used "min" vs "max". A sanity check in another tool is really going to help you out.
But based on the spec you have shared, and the 16 bytes you have shared, I am confident that 637590.385 is the valid interpretation of those bytes.
(I had wanted to say most of this last week, but I kept only thinking about it when I was in a crunched-for-time or on-my-phone-browser-so-read-only situation.... and then with the week-long pause, I forgot to come back.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Geo Package files
by Bod (Parson) on Mar 11, 2022 at 20:34 UTC | |
by swl (Prior) on Mar 11, 2022 at 22:09 UTC | |
by Bod (Parson) on Mar 11, 2022 at 22:41 UTC |