Describe the bug
ConvertExtendedSpatialIDsToQuadkeysAndVerticalIDs()
returns FromExtendedSpatialIDToQuadkeyAndVerticalID.innerIDList
with a length=2 when the length should be 1.
type FromExtendedSpatialIDToQuadkeyAndVerticalID struct {
// quadkeyの精度
quadkeyZoom int64
// innerIDList [[quadkey,vIndex]...]
innerIDList [][2]int64
// 高さ方向の精度
vZoom int64
// 最高高度
maxHeight float64
// 最低高度
minHeight float64
}
To Reproduce
(will produce test code after issue is reported)
Expected behavior
For an Extended Spatial ID of verticalZoom=23 and horizontalZoom=23 with output zooms of the same levels, we should expect FromExtendedSpatialIDToQuadkeyAndVerticalID.innerIDList
to be length=1
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
n/a
Additional context
The reason for the length of two is likely due to a boarder problem: convertVerticallIDToBit()
calculates
spatialIDMaxHeight := float64(vIndex+1) * alt25 / float64(math.Pow(2, float64(vZoom)))
spatialIDMinHeight := float64(vIndex) * alt25 / float64(math.Pow(2, float64(vZoom)))
and when the bitIndex is calculated using Max and Min height
maxBitIndex := calcBitIndex(spatialIDMaxHeight, outputZoom, maxHeight, minHeight)
minBitIndex := calcBitIndex(spatialIDMinHeight, outputZoom, maxHeight, minHeight)
maxBitIndex
measures the location of the top of the current Extended Spatial ID and also refers to the next higher one.