Esri / i3s-spec

This repository hosts the specification for Scene Layers which are containers for arbitrarily large amounts of geographic data. The delivery and persistence model for Scene Layers, referred to as Indexed 3d Scene Layer (I3S) and Scene Layer Package (SLPK) respectively, are specified.
Other
319 stars 85 forks source link

How to write attribute file(bin)? #48

Closed intckarl closed 4 years ago

intckarl commented 5 years ago

I found that in ArcGIS Pro generated slpk files's attribute file, there are many blank in the beginning, and the attribute value would repeate for so many times, sometime even with unrelevant strings. Like this:

image

Can you tell me what's the rules here?

And how to write the attributeStorageInfo part?

sreinhard commented 5 years ago

The attributeStorageInfo is documented here: https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md The example shows the attributeStorageInfo for a string attribute.

The first 8 bytes correspond to the header. the first 4 bytes are the count, meaning the number of strings in the file. in your example this is 0x80 strings in hex or 128 in decimal. The second value is the total number of bytes of all strings.

Following this is an array of count * 4 bytes which contains the length of each string in the array, including a zero byte for termination. A length of 0 indicates a NULL value.

The last part of the file are the actual string values in utf-8 encoding.

kelleyma49 commented 4 years ago

FYI, you can use https://kaitai.io/ to help you examine .bin files. You'll have to define a .ksy file yourself, but it's pretty easy to set one up.