 y-min x-max y-max z-min z-max m-min m-max ;
 
 : read-header ( -- header )
-    4 read be> dup 9994 assert= ! file code
+    4 read be> dup 9994 assert=
     20 read drop ! unused
-    4 read be> ! file-length
-    read-int dup 1000 assert= ! version
-    read-int ! shape-type
-    read-double ! x-min
-    read-double ! y-min
-    read-double ! x-max
-    read-double ! y-max
-    read-double ! z-min
-    read-double ! z-max
-    read-double ! m-min
-    read-double ! m-max
+    4 read be>
+    read-int dup 1000 assert=
+    read-int
+    read-double
+    read-double
+    read-double
+    read-double
+    read-double
+    read-double
+    read-double
+    read-double
     header boa ;
 
 TUPLE: point x y ;


: read-multipoint-m ( -- multipoint-m )
    read-box read-int
    [ read-points read-range ] [ read-double-array ] bi
    multipoint-m boa ;

TUPLE: polyline-m box parts points m-range m-array ;

: read-polyline-m ( -- polyline-m )
    read-box read-int read-int [ read-int-array ] dip
    [ read-points read-range ] [ read-double-array ] bi
    polyline-m boa ;

TUPLE: polygon-m box parts points m-range m-array ;

: read-polygon-m ( -- polyline-m )
    read-box read-int read-int [ read-int-array ] dip
    [ read-points read-range ] [ read-double-array ] bi
    polygon-m boa ;

TUPLE: point-z x y z m ;

TUPLE: multipoint box points ;

: read-multipoint ( -- multipoint )
    read-box read-int read-points multipoint boa ;

TUPLE: polyline box parts points ;

: read-polyline ( -- polyline )
    read-box read-int read-int [ read-ints ] dip
    read-points polyline boa ;

TUPLE: polygon box parts points ;

: read-polygon ( -- polygon )
    read-box read-int read-int [ read-ints ] dip
    read-points polygon boa ;

TUPLE: point-m x y m ;

