Originally Posted by Celludriel
Kinda sucks that the data is stored in two places. That means if I'm going to implement the parser in the terrain importer tool I have to generate two files instead of one

If you don't have an LSB parser yet, this is probably going to be the hardest part. The LSB format is far more complex than the terrain format:
http://divinity.gamepedia.com/LSB_format

Originally Posted by Celludriel
so that would mean the background layer has 50 * 50 * 24 triangles each triangle 12 bytes so that's 720000 bytes.

This part is wrong. X*Y*24 is the number of BYTES in a layer chunk. The number of triangles is X*Y*2 (see "Triangle array" section on the wiki). You can count those triangles directly on screen with the wireframe view.

Originally Posted by Celludriel
Did a small test, I removed one texture layer, then fully painted the terrain with the remaining texture layer and the file size increased. So if there hasn't been drawn on the terrain there seems to be data missing.

This is correct, if a layer is completely empty, the triangle array length and intensity array length are set to 0.

Originally Posted by Celludriel
I was curious and went into the editor and counted the tiles on the border of my 100*100 terrain , the end result was 32 on either side so (32 * 2) * (32 * 2) triangles would be the end result. But maybe the triangles in the grid view aren't the same as the triangles in the data structure ... I'm not sure

Something went wrong when you created the terrain. A terrain of size 100x100 has 50*50 tiles (i.e. 50x50 squares made of 2 triangles each).
32x32 tiles is typical of a terrain with the default dimensions (64x64).
Please, try it again.