in reply to Re^2: Geo Package files
in thread Geo Package files
You should wind up with something like: 47 50 XX YY... 0x47 means "G" and 0x50 means "P". The next byte looks like a version number - probably doesn't mean much to you. The very next flag byte means a lot (emphasis added) and we need to know what that is in order to understand what "double[] envelope;" means.
My code for dealing with binary headers like this usually has a substr() to select an range of bytes then it applies the appropriate unpack template upon that subset of bytes. I suspect that some relatively straightforward, special purpose code will be able to decode your specific blobs. Decoding this binary geo format in a general sense appears to be a "non-trivial" task. Your code will probably wind up depending upon the flag byte being a particular value - your code being specific to decoding segments with that particular set of flags.
The code to decode the bulk of the BLOB depends critically upon knowing what the flag byte is. Lets see the first 16 bytes of this $geo blob in hex dump format...
Also don't forget the ord() function. print "Got G!\n" if ( ord(substr($geo,0,1)) == 0x47 ); I think will work.
I have no idea of how many BLOB's you need to decode or what the performance implications are. I would try to get something functionally working and then worry about performance tweaks later. It could very well be that such tweaks are not necessary.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Geo Package files
by Bod (Parson) on Mar 05, 2022 at 00:58 UTC | |
by Marshall (Canon) on Mar 05, 2022 at 04:19 UTC | |
by Bod (Parson) on Mar 05, 2022 at 14:17 UTC | |
by soonix (Chancellor) on Mar 05, 2022 at 18:07 UTC | |
by Bod (Parson) on Mar 06, 2022 at 13:59 UTC | |
| |
by Marshall (Canon) on Mar 07, 2022 at 23:50 UTC | |
by Bod (Parson) on Mar 11, 2022 at 20:20 UTC | |
by Bod (Parson) on Mar 11, 2022 at 22:43 UTC | |
| |
by Bod (Parson) on Mar 11, 2022 at 19:52 UTC | |
| |
|
Re^4: Geo Package files
by hv (Prior) on Mar 05, 2022 at 14:21 UTC | |
|
Fixed starting bytes (was: Re^4: Geo Package files)
by Bod (Parson) on Mar 12, 2022 at 19:16 UTC | |
by Marshall (Canon) on Mar 12, 2022 at 20:12 UTC |