import*as t from"./extent.js";import*as e from"./types.js";export function write(t,n,r,o,s){var u=s===e.geometries.POINTZ,i=u?36:20,a=100,f=0,p=0;t.forEach((function(t,e){r.setInt32(f,e),r.setInt32(f+4,i/2),r.setInt32(f+8,s,!0),r.setFloat64(f+12,t[0],!0),r.setFloat64(f+20,t[1],!0),u&&(r.setFloat64(f+28,t[2]||0,!0),r.setFloat64(f+36,t[3]||0,!0)),o.setInt32(p,a/2),o.setInt32(p+4,i/2),p+=8,f+=i+8,a+=i+8}))}export function extent(e){return e.reduce((function(e,n){return t.enlarge(e,n)}),t.blank())}export function parts(t,e){return t.length}export function shxLength(t){return 8*t.length}export function shpLength(t,n){return t.length*(n===e.geometries.POINTZ?44:28)}