iso8211 0.1.5

ISO 8211 data format parsing library (IHO S-57 / S-100 family exchange format)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
use std::{
    fs::File,
    io::{BufReader, Read, Seek},
    path::Path,
};

use crate::{ddr::DataDescriptiveRecord, dr::DataRecord, Reader, Result};

pub struct DataDescriptiveFile {
    data_descriptive_record: DataDescriptiveRecord,
    data_records: Vec<DataRecord>,
}

impl DataDescriptiveFile {
    pub fn read<P: AsRef<Path>>(path: P) -> Result<DataDescriptiveFile> {
        let file = File::open(path)?;
        let buffer = BufReader::new(file);
        DataDescriptiveFile::read_buf(buffer)
    }

    pub fn read_buf<T: Read + Seek>(buffer: BufReader<T>) -> Result<DataDescriptiveFile> {
        let mut reader = Reader::new(buffer);

        let data_descriptive_record = DataDescriptiveRecord::read(&mut reader)?;

        let mut data_records = Vec::new();
        while !reader.is_eof()? {
            let data_record = DataRecord::read(&mut reader)?;
            data_records.push(data_record);
        }
        Ok(DataDescriptiveFile {
            data_descriptive_record,
            data_records,
        })
    }

    pub fn data_descriptive_record(&self) -> &DataDescriptiveRecord {
        &self.data_descriptive_record
    }

    pub fn data_records(&self) -> &[DataRecord] {
        &self.data_records
    }
}

#[cfg(test)]
pub(crate) mod tests {
    use std::io::{BufReader, Cursor};

    use crate::{tests::to_bytes, DataDescriptiveFile};

    #[test]
    fn test_ddr_leader() {
        let bytes = [
            // 00000000: 017753LE1 090025
            to_bytes("30 31 37 37 35 33 4c 45 31 20 30 39 30 30 32 35"),
            // 00000010: 6 ! 340400001230
            to_bytes("36 20 21 20 33 34 30 34 30 30 30 30 31 32 33 30"),
            // 00000020: 000DSID1300123DS
            to_bytes("30 30 30 44 53 49 44 31 33 30 30 31 32 33 44 53"),
            // 00000030: SI1180253ATCS044
            to_bytes("53 49 31 31 38 30 32 35 33 41 54 43 53 30 34 34"),
            // 00000040: 0371FTCS0470415A
            to_bytes("30 33 37 31 46 54 43 53 30 34 37 30 34 31 35 41"),
            // 00000050: TTR0580462CSID08
            to_bytes("54 54 52 30 35 38 30 34 36 32 43 53 49 44 30 38"),
            // 00000060: 40520CRSH0950604
            to_bytes("34 30 35 32 30 43 52 53 48 30 39 35 30 36 30 34"),
            // 00000070: CSAX0500699VDAT0
            to_bytes("43 53 41 58 30 35 30 30 36 39 39 56 44 41 54 30"),
            // 00000080: 550749C2IT055080
            to_bytes("35 35 30 37 34 39 43 32 49 54 30 35 35 30 38 30"),
            // 00000090: 4C2IL0550859PRID
            to_bytes("34 43 32 49 4c 30 35 35 30 38 35 39 50 52 49 44"),
            // 000000a0: 0710914CRID07109
            to_bytes("30 37 31 30 39 31 34 43 52 49 44 30 37 31 30 39"),
            // 000000b0: 85PTAS0571056SEG
            to_bytes("38 35 50 54 41 53 30 35 37 31 30 35 36 53 45 47"),
            // 000000c0: H0351113SRID0731
            to_bytes("48 30 33 35 31 31 31 33 53 52 49 44 30 37 33 31"),
            // 000000d0: 148RIAS0671221FR
            to_bytes("31 34 38 52 49 41 53 30 36 37 31 32 32 31 46 52"),
            // 000000e0: ID0841288FOID064
            to_bytes("49 44 30 38 34 31 32 38 38 46 4f 49 44 30 36 34"),
            // 000000f0: 1372SPAS0831436.
            to_bytes("31 33 37 32 53 50 41 53 30 38 33 31 34 33 36 1e"),
            // 00000100: 0000;&   .DSIDDS
            to_bytes("30 30 30 30 3b 26 20 20 20 1f 44 53 49 44 44 53"),
            // 00000110: SIDSIDATCSDSIDFT
            to_bytes("53 49 44 53 49 44 41 54 43 53 44 53 49 44 46 54"),
            // 00000120: CSCSIDCRSHCRSHCS
            to_bytes("43 53 43 53 49 44 43 52 53 48 43 52 53 48 43 53"),
            // 00000130: AXCRSHVDATPRIDC2
            to_bytes("41 58 43 52 53 48 56 44 41 54 50 52 49 44 43 32"),
            // 00000140: ITCRIDPTASCRIDSE
            to_bytes("49 54 43 52 49 44 50 54 41 53 43 52 49 44 53 45"),
            // 00000150: GHSEGHC2ILSRIDRI
            to_bytes("47 48 53 45 47 48 43 32 49 4c 53 52 49 44 52 49"),
            // 00000160: ASFRIDFOIDFRIDAT
            to_bytes("41 53 46 52 49 44 46 4f 49 44 46 52 49 44 41 54"),
            // 00000170: TRFRIDSPAS.3600;
            to_bytes("54 52 46 52 49 44 53 50 41 53 1e 33 36 30 30 3b"),
            // 00000180: &%/GData Set Ide
            to_bytes("26 25 2f 47 44 61 74 61 20 53 65 74 20 49 64 65"),
            // 00000190: ntification.RCNM
            to_bytes("6e 74 69 66 69 63 61 74 69 6f 6e 1f 52 43 4e 4d"),
            // 000001a0: !RCID!ENSP!ENED!
            to_bytes("21 52 43 49 44 21 45 4e 53 50 21 45 4e 45 44 21"),
            // 000001b0: PRSP!PRED!PROF!D
            to_bytes("50 52 53 50 21 50 52 45 44 21 50 52 4f 46 21 44"),
            // 000001c0: SNM!DSTL!DSRD!DS
            to_bytes("53 4e 4d 21 44 53 54 4c 21 44 53 52 44 21 44 53"),
            // 000001d0: LG!DSAB!DSED\\*D
            to_bytes("4c 47 21 44 53 41 42 21 44 53 45 44 5c 5c 2a 44"),
            // 000001e0: STC.(b11,b14,7A,
            to_bytes("53 54 43 1f 28 62 31 31 2c 62 31 34 2c 37 41 2c"),
            // 000001f0: A(8),3A,b11).160
            to_bytes("41 28 38 29 2c 33 41 2c 62 31 31 29 1e 31 36 30"),
            // 00000200: 0;&   Data Set S
            to_bytes("30 3b 26 20 20 20 44 61 74 61 20 53 65 74 20 53"),
            // 00000210: tructure Informa
            to_bytes("74 72 75 63 74 75 72 65 20 49 6e 66 6f 72 6d 61"),
            // 00000220: tion.DCOX!DCOY!D
            to_bytes("74 69 6f 6e 1f 44 43 4f 58 21 44 43 4f 59 21 44"),
            // 00000230: COZ!CMFX!CMFY!CM
            to_bytes("43 4f 5a 21 43 4d 46 58 21 43 4d 46 59 21 43 4d"),
            // 00000240: FZ!NOIR!NOPN!NOM
            to_bytes("46 5a 21 4e 4f 49 52 21 4e 4f 50 4e 21 4e 4f 4d"),
            // 00000250: N!NOCN!NOXN!NOSN
            to_bytes("4e 21 4e 4f 43 4e 21 4e 4f 58 4e 21 4e 4f 53 4e"),
            // 00000260: !NOFR.(3b48,10b1
            to_bytes("21 4e 4f 46 52 1f 28 33 62 34 38 2c 31 30 62 31"),
            // 00000270: 4).2600;&   Attr
            to_bytes("34 29 1e 32 36 30 30 3b 26 20 20 20 41 74 74 72"),
            // 00000280: ibute Codes.*ATC
            to_bytes("69 62 75 74 65 20 43 6f 64 65 73 1f 2a 41 54 43"),
            // 00000290: D!ANCD.(A,b12).2
            to_bytes("44 21 41 4e 43 44 1f 28 41 2c 62 31 32 29 1e 32"),
            // 000002a0: 600;&   Feature
            to_bytes("36 30 30 3b 26 20 20 20 46 65 61 74 75 72 65 20"),
            // 000002b0: Type Codes.*FTCD
            to_bytes("54 79 70 65 20 43 6f 64 65 73 1f 2a 46 54 43 44"),
            // 000002c0: !FTNC.(A,b12).26
            to_bytes("21 46 54 4e 43 1f 28 41 2c 62 31 32 29 1e 32 36"),
            // 000002d0: 00;&%/GAttribute
            to_bytes("30 30 3b 26 25 2f 47 41 74 74 72 69 62 75 74 65"),
            // 000002e0: .*NATC!ATIX!PAIX
            to_bytes("1f 2a 4e 41 54 43 21 41 54 49 58 21 50 41 49 58"),
            // 000002f0: !ATIN!ATVL.(3b12
            to_bytes("21 41 54 49 4e 21 41 54 56 4c 1f 28 33 62 31 32"),
            // 00000300: ,b11,A).1100;&
            to_bytes("2c 62 31 31 2c 41 29 1e 31 31 30 30 3b 26 20 20"),
            // 00000310:  Coordinate Refe
            to_bytes("20 43 6f 6f 72 64 69 6e 61 74 65 20 52 65 66 65"),
            // 00000320: rence System Rec
            to_bytes("72 65 6e 63 65 20 53 79 73 74 65 6d 20 52 65 63"),
            // 00000330: ord Identifier.R
            to_bytes("6f 72 64 20 49 64 65 6e 74 69 66 69 65 72 1f 52"),
            // 00000340: CNM!RCID!NCRC.(b
            to_bytes("43 4e 4d 21 52 43 49 44 21 4e 43 52 43 1f 28 62"),
            // 00000350: 11,b14,b11).1600
            to_bytes("31 31 2c 62 31 34 2c 62 31 31 29 1e 31 36 30 30"),
            // 00000360: ;&%/GCoordinate
            to_bytes("3b 26 25 2f 47 43 6f 6f 72 64 69 6e 61 74 65 20"),
            // 00000370: Reference System
            to_bytes("52 65 66 65 72 65 6e 63 65 20 53 79 73 74 65 6d"),
            // 00000380:  Header.CRIX!CRS
            to_bytes("20 48 65 61 64 65 72 1f 43 52 49 58 21 43 52 53"),
            // 00000390: T!CSTY!CRNM!CRSI
            to_bytes("54 21 43 53 54 59 21 43 52 4e 4d 21 43 52 53 49"),
            // 000003a0: !CRSS!SCRI.(3b11
            to_bytes("21 43 52 53 53 21 53 43 52 49 1f 28 33 62 31 31"),
            // 000003b0: ,2A,b11,A).2100;
            to_bytes("2c 32 41 2c 62 31 31 2c 41 29 1e 32 31 30 30 3b"),
            // 000003c0: &   Coordinate S
            to_bytes("26 20 20 20 43 6f 6f 72 64 69 6e 61 74 65 20 53"),
            // 000003d0: ystem Axes.*AXTY
            to_bytes("79 73 74 65 6d 20 41 78 65 73 1f 2a 41 58 54 59"),
            // 000003e0: !AXUM.(2b11).160
            to_bytes("21 41 58 55 4d 1f 28 32 62 31 31 29 1e 31 36 30"),
            // 000003f0: 0;&%/GVertical D
            to_bytes("30 3b 26 25 2f 47 56 65 72 74 69 63 61 6c 20 44"),
            // 00000400: atum.DTNM!DTID!D
            to_bytes("61 74 75 6d 1f 44 54 4e 4d 21 44 54 49 44 21 44"),
            // 00000410: TSR!SCRI.(2A,b11
            to_bytes("54 53 52 21 53 43 52 49 1f 28 32 41 2c 62 31 31"),
            // 00000420: ,A).2100;&   2-D
            to_bytes("2c 41 29 1e 32 31 30 30 3b 26 20 20 20 32 2d 44"),
            // 00000430:  Integer Coordin
            to_bytes("20 49 6e 74 65 67 65 72 20 43 6f 6f 72 64 69 6e"),
            // 00000440: ate Tuple.YCOO!X
            to_bytes("61 74 65 20 54 75 70 6c 65 1f 59 43 4f 4f 21 58"),
            // 00000450: COO.(2b24).2100;
            to_bytes("43 4f 4f 1f 28 32 62 32 34 29 1e 32 31 30 30 3b"),
            // 00000460: &   2-D Integer
            to_bytes("26 20 20 20 32 2d 44 20 49 6e 74 65 67 65 72 20"),
            // 00000470: Coordinate List.
            to_bytes("43 6f 6f 72 64 69 6e 61 74 65 20 4c 69 73 74 1f"),
            // 00000480: *YCOO!XCOO.(2b24
            to_bytes("2a 59 43 4f 4f 21 58 43 4f 4f 1f 28 32 62 32 34"),
            // 00000490: ).1100;&   Point
            to_bytes("29 1e 31 31 30 30 3b 26 20 20 20 50 6f 69 6e 74"),
            // 000004a0:  Record Identifi
            to_bytes("20 52 65 63 6f 72 64 20 49 64 65 6e 74 69 66 69"),
            // 000004b0: er.RCNM!RCID!RVE
            to_bytes("65 72 1f 52 43 4e 4d 21 52 43 49 44 21 52 56 45"),
            // 000004c0: R!RUIN.(b11,b14,
            to_bytes("52 21 52 55 49 4e 1f 28 62 31 31 2c 62 31 34 2c"),
            // 000004d0: b12,b11).1100;&
            to_bytes("62 31 32 2c 62 31 31 29 1e 31 31 30 30 3b 26 20"),
            // 000004e0:   Curve Record I
            to_bytes("20 20 43 75 72 76 65 20 52 65 63 6f 72 64 20 49"),
            // 000004f0: dentifier.RCNM!R
            to_bytes("64 65 6e 74 69 66 69 65 72 1f 52 43 4e 4d 21 52"),
            // 00000500: CID!RVER!RUIN.(b
            to_bytes("43 49 44 21 52 56 45 52 21 52 55 49 4e 1f 28 62"),
            // 00000510: 11,b14,b12,b11).
            to_bytes("31 31 2c 62 31 34 2c 62 31 32 2c 62 31 31 29 1e"),
            // 00000520: 2100;&   Point A
            to_bytes("32 31 30 30 3b 26 20 20 20 50 6f 69 6e 74 20 41"),
            // 00000530: ssociation.*RRNM
            to_bytes("73 73 6f 63 69 61 74 69 6f 6e 1f 2a 52 52 4e 4d"),
            // 00000540: !RRID!TOPI.(b11,
            to_bytes("21 52 52 49 44 21 54 4f 50 49 1f 28 62 31 31 2c"),
            // 00000550: b14,b11).1100;&
            to_bytes("62 31 34 2c 62 31 31 29 1e 31 31 30 30 3b 26 20"),
            // 00000560:   Segment Header
            to_bytes("20 20 53 65 67 6d 65 6e 74 20 48 65 61 64 65 72"),
            // 00000570: .INTP.(b11).1100
            to_bytes("1f 49 4e 54 50 1f 28 62 31 31 29 1e 31 31 30 30"),
            // 00000580: ;&   Surface Rec
            to_bytes("3b 26 20 20 20 53 75 72 66 61 63 65 20 52 65 63"),
            // 00000590: ord Identifier.R
            to_bytes("6f 72 64 20 49 64 65 6e 74 69 66 69 65 72 1f 52"),
            // 000005a0: CNM!RCID!RVER!RU
            to_bytes("43 4e 4d 21 52 43 49 44 21 52 56 45 52 21 52 55"),
            // 000005b0: IN.(b11,b14,b12,
            to_bytes("49 4e 1f 28 62 31 31 2c 62 31 34 2c 62 31 32 2c"),
            // 000005c0: b11).2100;&   Ri
            to_bytes("62 31 31 29 1e 32 31 30 30 3b 26 20 20 20 52 69"),
            // 000005d0: ng Association.*
            to_bytes("6e 67 20 41 73 73 6f 63 69 61 74 69 6f 6e 1f 2a"),
            // 000005e0: RRNM!RRID!ORNT!U
            to_bytes("52 52 4e 4d 21 52 52 49 44 21 4f 52 4e 54 21 55"),
            // 000005f0: SAG!RAUI.(b11,b1
            to_bytes("53 41 47 21 52 41 55 49 1f 28 62 31 31 2c 62 31"),
            // 00000600: 4,3b11).1100;&
            to_bytes("34 2c 33 62 31 31 29 1e 31 31 30 30 3b 26 20 20"),
            // 00000610:  Feature Type Re
            to_bytes("20 46 65 61 74 75 72 65 20 54 79 70 65 20 52 65"),
            // 00000620: cord Identifier.
            to_bytes("63 6f 72 64 20 49 64 65 6e 74 69 66 69 65 72 1f"),
            // 00000630: RCNM!RCID!NFTC!R
            to_bytes("52 43 4e 4d 21 52 43 49 44 21 4e 46 54 43 21 52"),
            // 00000640: VER!RUIN.(b11,b1
            to_bytes("56 45 52 21 52 55 49 4e 1f 28 62 31 31 2c 62 31"),
            // 00000650: 4,2b12,b11).1100
            to_bytes("34 2c 32 62 31 32 2c 62 31 31 29 1e 31 31 30 30"),
            // 00000660: ;&   Feature Obj
            to_bytes("3b 26 20 20 20 46 65 61 74 75 72 65 20 4f 62 6a"),
            // 00000670: ect Identifier.A
            to_bytes("65 63 74 20 49 64 65 6e 74 69 66 69 65 72 1f 41"),
            // 00000680: GEN!FIDN!FIDS.(b
            to_bytes("47 45 4e 21 46 49 44 4e 21 46 49 44 53 1f 28 62"),
            // 00000690: 12,b14,b12).2100
            to_bytes("31 32 2c 62 31 34 2c 62 31 32 29 1e 32 31 30 30"),
            // 000006a0: ;&   Spatial Ass
            to_bytes("3b 26 20 20 20 53 70 61 74 69 61 6c 20 41 73 73"),
            // 000006b0: ociation.*RRNM!R
            to_bytes("6f 63 69 61 74 69 6f 6e 1f 2a 52 52 4e 4d 21 52"),
            // 000006c0: RID!ORNT!SMIN!SM
            to_bytes("52 49 44 21 4f 52 4e 54 21 53 4d 49 4e 21 53 4d"),
            // 000006d0: AX!SAUI.(b11,b14
            to_bytes("41 58 21 53 41 55 49 1f 28 62 31 31 2c 62 31 34"),
            // 000006e0: ,b11,2b14,b11).0
            to_bytes("2c 62 31 31 2c 32 62 31 34 2c 62 31 31 29 1e 30"),
            // 000006f0: 0623 D     00065
            to_bytes("30 36 32 33 20 44 20 20 20 20 20 30 30 30 36 35"),
            // 00000700:    3304DSID09900
            to_bytes("20 20 20 33 33 30 34 44 53 49 44 30 39 39 30 30"),
            // 00000710: 0DSSI065099ATCS3
            to_bytes("30 44 53 53 49 30 36 35 30 39 39 41 54 43 53 33"),
            // 00000720: 12164FTCS082476.
            to_bytes("31 32 31 36 34 46 54 43 53 30 38 32 34 37 36 1e"),
            // 00000730: .....S-100 Part
            to_bytes("0a 01 00 00 00 53 2d 31 30 30 20 50 61 72 74 20"),
            // 00000740: 10a.1.1.INT.IHO.
            to_bytes("31 30 61 1f 31 2e 31 1f 49 4e 54 2e 49 48 4f 2e"),
            // 00000750: S-101.1.0.1.0.1.
            to_bytes("53 2d 31 30 31 2e 31 2e 30 1f 31 2e 30 1f 31 1f"),
            // 00000760: 1012C002C3NEWCC.
            to_bytes("31 30 31 32 43 30 30 32 43 33 4e 45 57 43 43 2e"),
            // 00000770: 000.2C3NEWCCV41.
            to_bytes("30 30 30 1f 32 43 33 4e 45 57 43 43 56 34 31 1f"),
            // 00000780: 20200713EN..1.0.
            to_bytes("32 30 32 30 30 37 31 33 45 4e 1f 1f 31 2e 30 1f"),
            // 00000790: ................
            to_bytes("0e 12 1e 00 00 00 00 00 00 00 00 00 00 00 00 00"),
            // 000007a0: ................
            to_bytes("00 00 00 00 00 00 00 00 00 00 00 80 96 98 00 80"),
            // 000007b0: ...d............
            to_bytes("96 98 00 64 00 00 00 00 00 00 00 01 00 00 00 00"),
            // 000007c0: ................
            to_bytes("00 00 00 01 00 00 00 00 00 00 00 04 00 00 00 04"),
            // 000007d0: ....marksNavigat
            to_bytes("00 00 00 1e 6d 61 72 6b 73 4e 61 76 69 67 61 74"),
            // 000007e0: ionalSystemOf...
            to_bytes("69 6f 6e 61 6c 53 79 73 74 65 6d 4f 66 1f 01 00"),
            // 000007f0: categoryOfTempor
            to_bytes("63 61 74 65 67 6f 72 79 4f 66 54 65 6d 70 6f 72"),
            // 00000800: alVariation...da
            to_bytes("61 6c 56 61 72 69 61 74 69 6f 6e 1f 02 00 64 61"),
            // 00000810: taAssessment...f
            to_bytes("74 61 41 73 73 65 73 73 6d 65 6e 74 1f 03 00 66"),
            // 00000820: eaturesDetected.
            to_bytes("65 61 74 75 72 65 73 44 65 74 65 63 74 65 64 1f"),
            // 00000830: ..leastDepthOfDe
            to_bytes("04 00 6c 65 61 73 74 44 65 70 74 68 4f 66 44 65"),
            // 00000840: tectedFeaturesMe
            to_bytes("74 65 63 74 65 64 46 65 61 74 75 72 65 73 4d 65"),
            // 00000850: asured...signifi
            to_bytes("61 73 75 72 65 64 1f 05 00 73 69 67 6e 69 66 69"),
            // 00000860: cantFeaturesDete
            to_bytes("63 61 6e 74 46 65 61 74 75 72 65 73 44 65 74 65"),
            // 00000870: cted...fullSeafl
            to_bytes("63 74 65 64 1f 06 00 66 75 6c 6c 53 65 61 66 6c"),
            // 00000880: oorCoverageAchie
            to_bytes("6f 6f 72 43 6f 76 65 72 61 67 65 41 63 68 69 65"),
            // 00000890: ved...horizontal
            to_bytes("76 65 64 1f 07 00 68 6f 72 69 7a 6f 6e 74 61 6c"),
            // 000008a0: PositionUncertai
            to_bytes("50 6f 73 69 74 69 6f 6e 55 6e 63 65 72 74 61 69"),
            // 000008b0: nty...uncertaint
            to_bytes("6e 74 79 1f 08 00 75 6e 63 65 72 74 61 69 6e 74"),
            // 000008c0: yFixed...vertica
            to_bytes("79 46 69 78 65 64 1f 09 00 76 65 72 74 69 63 61"),
            // 000008d0: lUncertainty...m
            to_bytes("6c 55 6e 63 65 72 74 61 69 6e 74 79 1f 0a 00 6d"),
            // 000008e0: aximumDisplaySca
            to_bytes("61 78 69 6d 75 6d 44 69 73 70 6c 61 79 53 63 61"),
            // 000008f0: le...minimumDisp
            to_bytes("6c 65 1f 0b 00 6d 69 6e 69 6d 75 6d 44 69 73 70"),
            // 00000900: layScale....Navi
            to_bytes("6c 61 79 53 63 61 6c 65 1f 0c 00 1e 4e 61 76 69"),
            // 00000910: gationalSystemOf
            to_bytes("67 61 74 69 6f 6e 61 6c 53 79 73 74 65 6d 4f 66"),
            // 00000920: Marks...QualityO
            to_bytes("4d 61 72 6b 73 1f 01 00 51 75 61 6c 69 74 79 4f"),
            // 00000930: fBathymetricData
            to_bytes("66 42 61 74 68 79 6d 65 74 72 69 63 44 61 74 61"),
            // 00000940: ...DataCoverage.
            to_bytes("1f 02 00 44 61 74 61 43 6f 76 65 72 61 67 65 1f"),
            // 00000950: ..LandArea....00
            to_bytes("03 00 4c 61 6e 64 41 72 65 61 1f 04 00 1e 30 30"),
            // 00000960: 130 D     00065
            to_bytes("31 33 30 20 44 20 20 20 20 20 30 30 30 36 35 20"),
            // 00000970:   2204CSID0700CR
            to_bytes("20 20 32 32 30 34 43 53 49 44 30 37 30 30 43 52"),
            // 00000980: SH1707CRSH2024CS
            to_bytes("53 48 31 37 30 37 43 52 53 48 32 30 32 34 43 53"),
            // 00000990: AX0344VDAT1847..
            to_bytes("41 58 30 33 34 34 56 44 41 54 31 38 34 37 1e 0f"),
            // 000009a0: .........WGS84.4
            to_bytes("01 00 00 00 02 1e 01 01 01 57 47 53 38 34 1f 34"),
            // 000009b0: 326.......meanSe
            to_bytes("33 32 36 1f 02 1f 1e 02 05 03 6d 65 61 6e 53 65"),
            // 000009c0: aLevel........me
            to_bytes("61 4c 65 76 65 6c 1f 1f ff 1f 1e 0c 04 1e 6d 65"),
            // 000009d0: anSeaLevel.3....
            to_bytes("61 6e 53 65 61 4c 65 76 65 6c 1f 33 1f 02 1f 1e"),
            // 000009e0: 00055 D     0003
            to_bytes("30 30 30 35 35 20 44 20 20 20 20 20 30 30 30 33"),
            // 000009f0: 7   1104PRID90C2
            to_bytes("37 20 20 20 31 31 30 34 50 52 49 44 39 30 43 32"),
            // 00000a00: IT99.n.........T
            to_bytes("49 54 39 39 1e 6e 01 00 00 00 01 00 01 1e 00 54"),
            // 00000a10: ...F.#.00116 D
            to_bytes("e1 ed 00 46 c3 23 1e 30 30 31 31 36 20 44 20 20"),
            // 00000a20:    00057   2204C
            to_bytes("20 20 20 30 30 30 35 37 20 20 20 32 32 30 34 43"),
            // 00000a30: RID0900PTAS0709S
            to_bytes("52 49 44 30 39 30 30 50 54 41 53 30 37 30 39 53"),
            // 00000a40: EGH0216C2IL4118.
            to_bytes("45 47 48 30 32 31 36 43 32 49 4c 34 31 31 38 1e"),
            // 00000a50: x........n......
            to_bytes("78 01 00 00 00 01 00 01 1e 6e 01 00 00 00 03 1e"),
            // 00000a60: ...T...F.#.....F
            to_bytes("04 1e 00 54 e1 ed 00 46 c3 23 c0 11 d2 ed 00 46"),
            // 00000a70: .#.......#.T....
            to_bytes("c3 23 c0 11 d2 ed f5 ba c0 23 00 54 e1 ed f5 ba"),
            // 00000a80: .#.T...F.#.00055
            to_bytes("c0 23 00 54 e1 ed 00 46 c3 23 1e 30 30 30 35 35"),
            // 00000a90:  D     00037   1
            to_bytes("20 44 20 20 20 20 20 30 30 30 33 37 20 20 20 31"),
            // 00000aa0: 104SRID90RIAS99.
            to_bytes("31 30 34 53 52 49 44 39 30 52 49 41 53 39 39 1e"),
            // 00000ab0: .........x......
            to_bytes("82 02 00 00 00 01 00 01 1e 78 01 00 00 00 01 01"),
            // 00000ac0: ..00055 D     00
            to_bytes("01 1e 30 30 30 35 35 20 44 20 20 20 20 20 30 30"),
            // 00000ad0: 037   1104SRID90
            to_bytes("30 33 37 20 20 20 31 31 30 34 53 52 49 44 39 30"),
            // 00000ae0: RIAS99..........
            to_bytes("52 49 41 53 39 39 1e 82 03 00 00 00 01 00 01 1e"),
            // 00000af0: x........00055 D
            to_bytes("78 01 00 00 00 01 01 01 1e 30 30 30 35 35 20 44"),
            // 00000b00:      00037   110
            to_bytes("20 20 20 20 20 30 30 30 33 37 20 20 20 31 31 30"),
            // 00000b10: 4SRID90RIAS99...
            to_bytes("34 53 52 49 44 39 30 52 49 41 53 39 39 1e 82 04"),
            // 00000b20: .......x........
            to_bytes("00 00 00 01 00 01 1e 78 01 00 00 00 01 01 01 1e"),
            // 00000b30: 00055 D     0003
            to_bytes("30 30 30 35 35 20 44 20 20 20 20 20 30 30 30 33"),
            // 00000b40: 7   1104SRID90RI
            to_bytes("37 20 20 20 31 31 30 34 53 52 49 44 39 30 52 49"),
            // 00000b50: AS99..........x.
            to_bytes("41 53 39 39 1e 82 01 00 00 00 01 00 01 1e 78 01"),
            // 00000b60: .......00103 D
            to_bytes("00 00 00 01 01 01 1e 30 30 31 30 33 20 44 20 20"),
            // 00000b70:    00057   2204F
            to_bytes("20 20 20 30 30 30 35 37 20 20 20 32 32 30 34 46"),
            // 00000b80: RID1100FOID0911A
            to_bytes("52 49 44 31 31 30 30 46 4f 49 44 30 39 31 31 41"),
            // 00000b90: TTR1020SPAS1630.
            to_bytes("54 54 52 31 30 32 30 53 50 41 53 31 36 33 30 1e"),
            // 00000ba0: d...............
            to_bytes("64 01 00 00 00 01 00 01 00 01 1e 12 07 f1 0f 00"),
            // 00000bb0: .d.........9....
            to_bytes("00 64 00 1e 01 00 01 00 00 00 01 39 1f 1e 82 01"),
            // 00000bc0: ..............00
            to_bytes("00 00 00 01 00 00 00 00 ff ff ff ff 01 1e 30 30"),
            // 00000bd0: 183 D     00061
            to_bytes("31 38 33 20 44 20 20 20 20 20 30 30 30 36 31 20"),
            // 00000be0:   2304FRID11000F
            to_bytes("20 20 32 33 30 34 46 52 49 44 31 31 30 30 30 46"),
            // 00000bf0: OID09011ATTR8602
            to_bytes("4f 49 44 30 39 30 31 31 41 54 54 52 38 36 30 32"),
            // 00000c00: 0SPAS16106.d....
            to_bytes("30 53 50 41 53 31 36 31 30 36 1e 64 02 00 00 00"),
            // 00000c10: ............d...
            to_bytes("02 00 01 00 01 1e 12 07 f2 0f 00 00 64 00 1e 02"),
            // 00000c20: ......6........3
            to_bytes("00 01 00 00 00 01 36 1f 03 00 01 00 00 00 01 33"),
            // 00000c30: ................
            to_bytes("1f 04 00 01 00 00 00 01 1f 05 00 01 00 03 00 01"),
            // 00000c40: 0........0......
            to_bytes("30 1f 06 00 01 00 03 00 01 30 1f 07 00 01 00 00"),
            // 00000c50: ..0.............
            to_bytes("00 01 30 1f 08 00 01 00 00 00 01 1f 09 00 01 00"),
            // 00000c60: ................
            to_bytes("07 00 01 1f 0a 00 01 00 00 00 01 1f 09 00 01 00"),
            // 00000c70: ................
            to_bytes("09 00 01 1f 1e 82 02 00 00 00 01 00 00 00 00 ff"),
            // 00000c80: .....00121 D
            to_bytes("ff ff ff 01 1e 30 30 31 32 31 20 44 20 20 20 20"),
            // 00000c90:  00057   2204FRI
            to_bytes("20 30 30 30 35 37 20 20 20 32 32 30 34 46 52 49"),
            // 00000ca0: D1100FOID0911ATT
            to_bytes("44 31 31 30 30 46 4f 49 44 30 39 31 31 41 54 54"),
            // 00000cb0: R2820SPAS1648.d.
            to_bytes("52 32 38 32 30 53 50 41 53 31 36 34 38 1e 64 03"),
            // 00000cc0: ...............d
            to_bytes("00 00 00 03 00 01 00 01 1e 12 07 f3 0f 00 00 64"),
            // 00000cd0: .........90000..
            to_bytes("00 1e 0b 00 01 00 00 00 01 39 30 30 30 30 1f 0c"),
            // 00000ce0: ......180000....
            to_bytes("00 01 00 00 00 01 31 38 30 30 30 30 1f 1e 82 03"),
            // 00000cf0: ..............00
            to_bytes("00 00 00 01 00 00 00 00 ff ff ff ff 01 1e 30 30"),
            // 00000d00: 085 D     00049
            to_bytes("30 38 35 20 44 20 20 20 20 20 30 30 30 34 39 20"),
            // 00000d10:   2204FRID1100FO
            to_bytes("20 20 32 32 30 34 46 52 49 44 31 31 30 30 46 4f"),
            // 00000d20: ID0911SPAS1620.d
            to_bytes("49 44 30 39 31 31 53 50 41 53 31 36 32 30 1e 64"),
            // 00000d30: ................
            to_bytes("04 00 00 00 04 00 01 00 01 1e 12 07 f4 0f 00 00"),
            // 00000d40: d...............
            to_bytes("64 00 1e 82 04 00 00 00 01 00 00 00 00 ff ff ff"),
            // 00000d50: ...
            to_bytes("ff 01 1e"),
        ]
        .concat();

        let buffer = Cursor::new(&bytes);
        let buffer = BufReader::new(buffer);
        let result = DataDescriptiveFile::read_buf(buffer);

        assert!(result.is_ok());
    }
}