[gdal-dev] File Geodatabase raster driver
Even Rouault
even.rouault at spatialys.com
Thu Jul 7 07:22:51 PDT 2016
Le jeudi 07 juillet 2016 14:53:04, jramm a écrit :
> Based on Even's work on FGDB vector, I have begun looking at raster data,
> here: https://github.com/JamesRamm/fgdb_raster_spec
>
> So far everything I've found is pretty much based on the output of v the
> dump_gdb script. I have two troubling areas currently blocking progress
>
> 1. I can locate pixel data blocks but cannot decipher how to read them,
> even when the contents are known.
So if I look at all_ones.gdb/a0000000c.gdbtable the challenge is to decypher
the block_data records ?
I see they begin with 0x78 0x9c bytes which is the zlib magic header for
deflate default compression ( http://stackoverflow.com/questions/9050260/what-
does-a-zlib-header-look-like ).
So after running the blob through :
import zlib
val = zlib.decompress(val)
I get a 67584 uncompressed blob, that starts with :
00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 01 followed by 7F FF
FF FF to pad the line, that repeated 5 times. Which seems to match the
Field: band_width : 5
Field: band_height : 5
declaration.
To have lines of 128x4, I guess the shape of your raster is more a diamond of
ones and not a square ?
At offset 0x10000, there's 2048 bytes of trailer content, most of them being
zeroed and a few 0xF8 bytes. Probably not very important for decoding.
>
> 2. It is unclear how more than one raster is handled. It appears to be
> based solely on the names of files but any patterns/groupings are not
> obvious
Not sure to understand but it looks to be the same as for vector bands, ie you
have to cross compare the a00000001.gdbtable and a00000004.gdbtable
a00000001.gdbtable:
FID = 9 ---> a00000009.gdbtable
feature_offset = 302
blob_len = 13
Field: Name : "all_ones"
Field: FileFormat : 0
FID = 10 ---> a0000000a.gdbtable 0xa=10
feature_offset = 319
blob_len = 22
Field: Name : "fras_ras_all_ones"
Field: FileFormat : 0
FID = 11 ---> a0000000b.gdbtable 0xb=11
feature_offset = 345
blob_len = 22
Field: Name : "fras_aux_all_ones"
Field: FileFormat : 0
FID = 12
feature_offset = 371
blob_len = 22
Field: Name : "fras_blk_all_ones"
Field: FileFormat : 0
FID = 13
feature_offset = 397
blob_len = 22
Field: Name : "fras_bnd_all_ones"
Field: FileFormat : 0
a00000004.gdbtable:
FID = 3
feature_offset = 1633
blob_len = 4214
flags = [120, 212]
Field: UUID : "393a7e99ffc3c244b029422a075064fd"
Field: Type : "a367d65ea99ca2448029d95bf23704b9"
Field: Name : "all_ones"
Field: PhysicalName : "ALL_ONES"
Field: Path : "\all_ones"
Field: DatasetSubtype1 : NULL
Field: DatasetSubtype2 : NULL
Field: DatasetInfo1 : NULL
Field: DatasetInfo2 : NULL
Field: URL : ""
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list