changeset 672:5fa2eaffac84 octree

octree: Always compress the index with snappy as its halves its size.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 19 Sep 2018 10:57:37 +0200
parents 010cc30fdf48
children 9a0246ab3021
files cmd/tin2octree/main.go
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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)