Not able to add a local terrain url?

The problem with the second error,
“LogCesium: Error: [2022-04-10 12:25:34.664] [error] [QuantizedMeshContent.cpp:721] Unable to parse quantized-mesh-1.0 tile http://192.168.1.27:8088/0/1/0.terrain?v=1.1.0&extensions=octvertexnormals
is that you’re not sending the appropriate header, e.g. you should include “Content-Encoding” = “gzip”

Try sub-classing the simple server.

class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def send_header(self, keyword, value):
if not hasattr(self, ‘_headers_map_buffer’):
self._headers_map_buffer = {}
self._headers_map_buffer[keyword] = value
http.server.SimpleHTTPRequestHandler.send_header(self, keyword, value)

def end_headers(self):
    self.send_my_headers()
    self._headers_map_buffer = {}
    http.server.SimpleHTTPRequestHandler.end_headers(self)

def send_my_headers(self):
    #TODO add logic to only add this to .terrain files
    print(self._headers_map_buffer)
    if self._headers_map_buffer.get('Content-type', None) == 'application/octet-stream':
        self.send_header("Content-Encoding", "gzip")
1 Like