forked from MTSR/mapserver
initial render impl
This commit is contained in:
parent
d960e0404b
commit
eb793e4916
@ -10,7 +10,8 @@ const (
|
|||||||
SETTING_LASTX = "last_x"
|
SETTING_LASTX = "last_x"
|
||||||
SETTING_LASTY = "last_y"
|
SETTING_LASTY = "last_y"
|
||||||
SETTING_LASTZ = "last_z"
|
SETTING_LASTZ = "last_z"
|
||||||
SETTING_INITIAL_RUN = "initial_run"
|
SETTING_INITIAL_RUN = "initial_run"
|
||||||
|
SETTING_LEGACY_PROCESSED = "legacy_processed"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
|
@ -3,6 +3,7 @@ package tilerendererjob
|
|||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"mapserver/app"
|
"mapserver/app"
|
||||||
|
"mapserver/settings"
|
||||||
"mapserver/coords"
|
"mapserver/coords"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -13,7 +14,6 @@ type InitialRenderEvent struct {
|
|||||||
|
|
||||||
func initialRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
func initialRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
||||||
|
|
||||||
rstate := ctx.Config.RenderState
|
|
||||||
totalLegacyCount, err := ctx.Blockdb.CountBlocks(0, 0)
|
totalLegacyCount, err := ctx.Blockdb.CountBlocks(0, 0)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -21,12 +21,15 @@ func initialRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := logrus.Fields{
|
fields := logrus.Fields{
|
||||||
"totalLegacyCount": totalLegacyCount,
|
"totalLegacyCount": totalLegacyCount
|
||||||
"LastMtime": rstate.LastMtime,
|
|
||||||
}
|
}
|
||||||
logrus.WithFields(fields).Info("Starting initial rendering job")
|
logrus.WithFields(fields).Info("Starting initial rendering job")
|
||||||
|
|
||||||
lastcoords := coords.NewMapBlockCoords(rstate.LastX, rstate.LastY, rstate.LastZ)
|
lastx := ctx.Settings.GetInt(settings.SETTING_LASTX, -1)
|
||||||
|
lasty := ctx.Settings.GetInt(settings.SETTING_LASTY, -1)
|
||||||
|
lastz := ctx.Settings.GetInt(settings.SETTING_LASTZ, -1)
|
||||||
|
|
||||||
|
lastcoords := coords.NewMapBlockCoords(lastx, lasty, lastz)
|
||||||
|
|
||||||
for true {
|
for true {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
@ -38,8 +41,7 @@ func initialRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(result.List) == 0 && !result.HasMore {
|
if len(result.List) == 0 && !result.HasMore {
|
||||||
rstate.InitialRun = false
|
ctx.Settings.SetBool(settings.SETTING_INITIAL_RUN, false)
|
||||||
ctx.Config.Save()
|
|
||||||
|
|
||||||
ev := InitialRenderEvent{
|
ev := InitialRenderEvent{
|
||||||
Progress: 100,
|
Progress: 100,
|
||||||
|
Loading…
Reference in New Issue
Block a user