Quantized mesh. No eastern hemisphere

I’ve made some good progress in my quantized mesh terrain generator. A lot of help has come from these forums, so much thanks!

I’ve hit what I hope is my last stumbling block. The western hemisphere renders fine, however the eastern hemisphere does not render at all.


Image: “Hello Sunshine!”

Here is the contents of the layer.json file. I’m wondering if I’m just not requesting the eastern half of the planet to be sent.

{
   attribution: '',
   bounds: [-180, -90, 180, 90],
   description: '',
   maxzoom: 23,
   minzoom: 0,
   projection: 'EPSG:4326',
   format: 'quantized-mesh-1.0',
   scheme: 'tms',
   tiles: ['{z}/{x}/{y}'],
   version: '1.0.0',
   available: [[{"startX":0,"startY":0,"endX":1,"endY":0}],
            [{"startX":0,"startY":0,"endX":3,"endY":1}],
            [{"startX":0,"startY":0,"endX":7,"endY":3}],
            [{"startX":0,"startY":0,"endX":15,"endY":7}],
            [{"startX":0,"startY":0,"endX":31,"endY":15}],
            [{"startX":0,"startY":0,"endX":63,"endY":31}],
            [{"startX":0,"startY":0,"endX":127,"endY":63}],
            [{"startX":0,"startY":0,"endX":255,"endY":127}],
            [{"startX":0,"startY":0,"endX":511,"endY":255}],
            [{"startX":0,"startY":0,"endX":1023,"endY":511}],
            [{"startX":0,"startY":0,"endX":2047,"endY":1023}],
            [{"startX":0,"startY":0,"endX":4095,"endY":2047}],
            [{"startX":0,"startY":0,"endX":8191,"endY":4095}],
            [{"startX":0,"startY":0,"endX":16383,"endY":8191}],
            [{"startX":0,"startY":0,"endX":32767,"endY":16383}],
            [{"startX":0,"startY":0,"endX":65535,"endY":32767}],
            [{"startX":0,"startY":0,"endX":131071,"endY":65535}],
            [{"startX":0,"startY":0,"endX":262143,"endY":131071}],
            [{"startX":0,"startY":0,"endX":524287,"endY":262143}],
            [{"startX":0,"startY":0,"endX":1024575,"endY":524287}],
            [{"startX":0,"startY":0,"endX":2097151,"endY":1024575}],
            [{"startX":0,"startY":0,"endX":4194303,"endY":2097151}],
            [{"startX":0,"startY":0,"endX":8388607,"endY":4194303}]]
}

Switching to a projection of EPSG:3857 fixed this problem.

Actually, switching to this projection causes holes at the poles which is not what I’m wanting. I understand why they are there, but I am confused as to why the other projection, 4326 is only showing the western hemisphere? :confused:

Heh… my x, y, and level values were being converted to strings when received by the express-js server. I’d forgotten to use @NumParam and was instead using @Param which caused a type change to string. So, ‘0’ + 0 is ‘00’ which is also zero. However, ‘1’ + 1 is ‘11’ which is eleven in the lat/lon calculations, not 1 like the calculations are expecting.

    @CatchAndSendError()
    @Get('/qm/:z/:x/:y')
    public async getElevationTile(
        @Response() res: HttpResponse,
        @NumParam('z') level: number,  // using @Param here is a bad idea...
        @NumParam('x') x: number,  // using @Param here is a bad idea...
        @NumParam('y') y: number,  // using @Param here is a bad idea...
    ) {
      ...
    }

This number conversion to string was causing a bit of a problem when calculating the latitude and longitude. :rofl:

Fixing this problem fixed the rendering issue.