in reply to Re^6: Geo Package files
in thread Geo Package files
We know that this format is in "little endian". Is your processor also "little endian", e.g. an Intel processor? If it is then maybe we don't have to write completely platform independent code?
I think also relevant to this would be: Is your Perl version 32 or 64 bit? I am running 64 bit Perl on a 64 bit Windows platform. And I have a 64 bit GCC complier. On my 64 bit machine, in C, a simple float is 64 bits. I don't know for sure, but I would suspect that 64 bit Perl's representation of a simple float is also 64 bits? Added: I see trouble if you are using 32 bit Perl.
I don't know where the 6 comes from in 'nCCV(V)6'? Each float is 8 bytes, not 6 bytes.
From what I understand so far,
index 8, length 8 bytes => minx
index 16.length 8 bytes => maxx
index 24,length 8 bytes => miny
index 32,length 8 bytes => maxy
index 40,length 8 bytes => minz
index 48.length 8 bytes => maxz
so, my $minx = unpack ("d8", substr($geo,8,8)); may work??
I am not sure if f8 would work also?
Update: BTW, what is length ($geo)?
Also, again, I request the binary data dump of $geo, NOT what you think that binary unpacks as.
Dump should be 2 hex digits per byte, with a space between bytes. 0 should be 00 so that
columns line up nicely. 16 bytes per line would be fine.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Geo Package files
by Bod (Parson) on Mar 11, 2022 at 20:20 UTC | |
|
Re^8: Geo Package files
by Bod (Parson) on Mar 11, 2022 at 22:43 UTC | |
by Marshall (Canon) on Mar 12, 2022 at 20:43 UTC | |
|
Re^8: Geo Package files
by Bod (Parson) on Mar 11, 2022 at 19:52 UTC | |
by pryrt (Abbot) on Mar 11, 2022 at 20:16 UTC | |
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 |