1
0
forked from MTSR/mapserver
This commit is contained in:
NatureFreshMilk 2019-02-14 09:05:39 +01:00
parent 52b29dbd47
commit a0a8569168
10 changed files with 16 additions and 27 deletions

View File

@ -15,7 +15,7 @@ type Config struct {
EnableRendering bool `json:"enablerendering"`
Webdev bool `json:"webdev"`
WebApi *WebApiConfig `json:"webapi"`
Layers []*layer.Layer `json:"layers"`
Layers []*layer.Layer `json:"layers"`
RenderingFetchLimit int `json:"renderingfetchlimit"`
RenderingJobs int `json:"renderingjobs"`
RenderingQueue int `json:"renderingqueue"`

View File

@ -8,7 +8,7 @@ const (
minValue = -1 << (numBitsPerComponent - 1)
maxValue = 1<<(numBitsPerComponent-1) - 1
MinPlainCoord = -34351347711
MinPlainCoord = -34351347711
)
func CoordToPlain(c *MapBlockCoords) int64 {

View File

@ -12,11 +12,11 @@ func init() {
log = logrus.WithFields(logrus.Fields{"prefix": "coords/convert_test"})
}
func TestMinCoord(t *testing.T){
func TestMinCoord(t *testing.T) {
c := NewMapBlockCoords(MinCoord, MinCoord, MinCoord)
pc := CoordToPlain(c)
log.WithFields(logrus.Fields{"coords": c, "plain": pc,"plain-1": pc-1}).Info("TestMinCoord")
log.WithFields(logrus.Fields{"coords": c, "plain": pc, "plain-1": pc - 1}).Info("TestMinCoord")
if pc != MinPlainCoord {
t.Fatal("no min match")
}

View File

@ -2,8 +2,8 @@ package db
import (
"mapserver/coords"
"mapserver/settings"
"mapserver/layer"
"mapserver/settings"
)
type Block struct {
@ -13,9 +13,9 @@ type Block struct {
}
type InitialBlocksResult struct {
List []*Block
List []*Block
UnfilteredCount int
HasMore bool
HasMore bool
}
type DBAccessor interface {

View File

@ -1,12 +1,14 @@
package postgres
import (
"mapserver/settings"
"mapserver/layer"
"mapserver/db"
"mapserver/layer"
"mapserver/settings"
)
const (
SETTING_LAST_LAYER = "last_layer"
)
func (this *PostgresAccessor) FindNextInitialBlocks(s settings.Settings, layers []*layer.Layer, limit int) (*db.InitialBlocksResult, error) {
return nil, nil

View File

@ -1,6 +1,5 @@
package postgres
const getBlocksByMtimeQuery = `
select posx,posy,posz,data,mtime
from blocks b
@ -9,17 +8,6 @@ order by b.mtime asc
limit ?
`
const getLastBlockQuery = `
select posx,posy,posz,data,mtime
from blocks b
where b.mtime = 0
and b.posx >= ?
and b.posy >= ?
and b.posz >= ?
order by b.posx asc, b.posy asc, b.posz asc, b.mtime asc
limit ?
`
const countBlocksQuery = `
select count(*) from blocks b where b.mtime >= ? and b.mtime <= ?
`

View File

@ -4,12 +4,12 @@ import (
_ "github.com/mattn/go-sqlite3"
"mapserver/coords"
"mapserver/db"
"mapserver/settings"
"mapserver/layer"
"mapserver/settings"
)
const (
SETTING_LAST_POS = "last_pos"
SETTING_LAST_POS = "last_pos"
)
const getLastBlockQuery = `

View File

@ -3,8 +3,8 @@ package mapblockaccessor
import (
"mapserver/eventbus"
"mapserver/layer"
"mapserver/settings"
"mapserver/mapblockparser"
"mapserver/settings"
cache "github.com/patrickmn/go-cache"
"github.com/sirupsen/logrus"

View File

@ -1,6 +1,5 @@
package sqlite
const getMapDataPosQuery = `
select o.id, o.type, o.mtime,
o.x, o.y, o.z,

View File

@ -9,7 +9,7 @@ import (
//Public facing config
type PublicConfig struct {
Layers []*layer.Layer `json:"layers"`
Layers []*layer.Layer `json:"layers"`
MapObjects *app.MapObjectConfig `json:"mapobjects"`
}