From 8c29975d2709f03c7462191f0c2ac2bcfae9fcfc Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sat, 20 Sep 2014 21:57:01 +0200 Subject: [PATCH] Fixed tile offset. --- cmd/mtseeder/main.go | 8 ++++---- cmd/mtwebmapper/tilesupdater.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/mtseeder/main.go b/cmd/mtseeder/main.go index 521a955..5d13502 100644 --- a/cmd/mtseeder/main.go +++ b/cmd/mtseeder/main.go @@ -26,10 +26,10 @@ func main() { flag.IntVar(&port, "port", 6379, "port to of mtredisalize server") flag.IntVar(&port, "p", 6379, "port to of mtredisalize server (shorthand)") flag.StringVar(&host, "host", "localhost", "host to mtredisalize server") - flag.IntVar(&xMin, "xmin", -1936, "x min of the area to tile") - flag.IntVar(&xMax, "xmax", 1920, "x max of the area to tile") - flag.IntVar(&zMin, "zmin", -1936, "z min of the area to tile") - flag.IntVar(&zMax, "zmax", 1920, "z max of the area to tile") + flag.IntVar(&xMin, "xmin", -1933, "x min of the area to tile") + flag.IntVar(&xMax, "xmax", 1932, "x max of the area to tile") + flag.IntVar(&zMin, "zmin", -1933, "z min of the area to tile") + flag.IntVar(&zMax, "zmax", 1932, "z max of the area to tile") flag.StringVar(&colorsFile, "colors", "colors.txt", "definition of colors") flag.StringVar(&outDir, "output-dir", "map", "directory with the resulting image tree") flag.StringVar(&outDir, "o", "map", "directory with the resulting image tree") diff --git a/cmd/mtwebmapper/tilesupdater.go b/cmd/mtwebmapper/tilesupdater.go index d929466..70f9ab9 100644 --- a/cmd/mtwebmapper/tilesupdater.go +++ b/cmd/mtwebmapper/tilesupdater.go @@ -30,7 +30,7 @@ type xz struct { } func (c xz) quantize() xz { - return xz{X: (c.X - -1936) / 16, Z: (c.Z - -1936) / 16} + return xz{X: (c.X - -1933) / 16, Z: (c.Z - -1933) / 16} } func newTileUpdater(mapDir, redisAddress string, colors *common.Colors, workers int) *tileUpdater { @@ -106,8 +106,8 @@ func (tu *tileUpdater) doUpdates() { func updateBaseTiles(jobs chan xz, btc *common.BaseTileCreator, done *sync.WaitGroup) { for job := range jobs { - x := job.X*16 + -1936 - 1 - z := job.Z*16 + -1936 - 1 + x := job.X*16 + -1933 - 1 + z := job.Z*16 + -1933 - 1 log.Printf("%d/%d %d/%d", x, z, job.X, job.Z) if err := btc.CreateTile(x, z, int(job.X), int(job.Z)); err != nil { log.Printf("WARN: create tile failed: %s", err)