# HG changeset patch # User Sascha L. Teichmann # Date 1537347457 -7200 # Node ID 5fa2eaffac84be598ec7c551d3c2a3cd48de13f6 # Parent 010cc30fdf48db45efda6c1a97ea4715de8d354e octree: Always compress the index with snappy as its halves its size. diff -r 010cc30fdf48 -r 5fa2eaffac84 cmd/tin2octree/main.go --- a/cmd/tin2octree/main.go Wed Sep 19 10:54:11 2018 +0200 +++ b/cmd/tin2octree/main.go Wed Sep 19 10:57:37 2018 +0200 @@ -1,10 +1,8 @@ package main import ( - "bufio" "database/sql" "flag" - "io" "log" "math" "os" @@ -20,8 +18,7 @@ date = flag.String("date", "", "date info") file = flag.String("file", "", "save to file") - utm = flag.Bool("utm", false, "fetch in matchin UTM zone") - snap = flag.Bool("snappy", false, "use snappy compression") + utm = flag.Bool("utm", false, "fetch in matchin UTM zone") dbhost = flag.String("dbhost", "localhost", "database host") dbport = flag.Uint("dbport", 5432, "database port") @@ -146,16 +143,7 @@ if err != nil { log.Printf("error: %v\n", err) } - type flusher interface { - io.Writer - Flush() error - } - var out flusher - if *snap { - out = snappy.NewBufferedWriter(f) - } else { - out = bufio.NewWriter(f) - } + out := snappy.NewBufferedWriter(f) if err := t.Serialize(out); err != nil { f.Close() log.Fatalf("error: %v\n", err)