Not able to add a local terrain url?

Hello all,

Thank you for your time looking into this.

I am trying to load a tileset (.TERRAIN via URL). This was created from a geoTIFF to .Terrain tileset via CTB. It contains a layer.json file.

When i try to load that in UE4, i get the following:

LogCesium: Loading tileset from URL http://127.0.0.1:8088/layer.json
LogCesium: Loading tileset from URL http://127.0.0.1:8088/layer.json done
LogCesium: Warning: [2022-02-28 12:00:39.163] [warning] [TileContentFactory.cpp:77] No loader registered for tile with content type ‘application/octet-stream’ and magic value '?
LogCesium: Warning: [2022-02-28 12:00:39.163] [warning] [TileContentFactory.cpp:77] No loader registered for tile with content type ‘application/octet-stream’ and magic value '?

Similar issue reported here:

I have found the following post:

which describes that i might be missing a .metadata file, which describes the tileset availability?

I was able to load that same terrain (geoTIFF) file form Cesium ION.

I guess my question going forward is, it what Kevin describes wrt to the .metadata file @Kevin_Ring the case? how do we generate this? Please suggest?

Does anyone have a terrain tileset, that they are able to load locally without being connected to the internet? that i can learn from?

Please suggest, looking forward to your comments.

Kind Regards
Vamshi

Hi @vamsh.chittaluri,

You may very well run into an availability problem next, but the immediate problem here is different. Quantized-mesh tiles (.terrain files) must be served with a response header of Content-Type: application/vnd.quantized-mesh. Your web server is instead serving Content-Type: application/octet-stream. You should be able to modify the configuration for the web server running on 127.0.0.1:8088 to return the correct content type.

If that’s inconvenient, we recently merged a change that also allows cesium-native to identify quantized-mesh tiles by their file extension (.terrain). That change should also solve your problem, and it will be in the March release of Cesium for Unreal that will be available this week.

The availability/metadata problem is harder to solve. One solution is to use Cesium ion instead of CTB! :grinning: Another option is to extend CTB to use the metadata extension instead of availability in layer.json. And the last possibility is to implement cesium-native#292. This issue is on our list to be implemented, but I can’t commit to a time frame.

Kevin

Hey Kevin,

Thank you for the informative response.

Was able to solve the response header issue.

Kind Regards
Vamshi

Hi Vamshi,

could you share some details on your solution? Are you using GitHub - geo-data/cesium-terrain-server: A basic server for serving up filesystem based tilesets representing Cesium.js terrain models and modified the response header? I had no success with this approach.

Best,
Tim

Hey Tim,

Sorry for the late response. I did not get any notifs about posts on my email…

for the issue with Terrain Models, i just switched over to CesiumLab to generate the mesh types, but i am serving up the files through a python local HTTP server. with a modified response header. Please see attached code for how i did that.

Not sure if you are cool with setting up a python solution but its what i did.

import http.server
import socketserver

PORT = 8088

Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map={
        '': 'application/vnd.quantized-mesh', # Default
        '.manifest': 'text/cache-manifest',
	'.html': 'text/html',
        '.png': 'image/png',
	'.jpg': 'image/jpg',
	'.svg':	'image/svg+xml',
	'.css':	'text/css',
	'.js':	'application/x-javascript',
    }

with socketserver.TCPServer(("", PORT), Handler) as httpd:
    print("serving at port", PORT)
    httpd.serve_forever()

i would run this by going to the directory, running command prompt. and typing python pythonfilename.py

make sure to place the python file in the directory with the terrain filesets. If you have any questions, shoot me a message.

Kind Regards
Vamshi

Hi Vamsh,

Are you running the local server on linux? I am on a windows local server here, will try that and see.

Curiously enough, I was able to download the terrain.zip file you referenced up above (from another user) and was able to serve and load that into unreal and it displays fine. When I try to do the same thing with my generated mesh, however, I got the ‘unable to parse error’ - it says I’m trying to load extensions=octvertexnormals

I’ve managed to get your python script running and I can see that it’s serving the data correctly, but I am still getting this log error :frowning: Did you have to modify the layers.json file at all?

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

@mahalobay

Have you been able to get this working?

Hi Richard,

Yes, the .terrain files generated by CTB are compressed. I had to reconfigure the local server to identify the terrain files as gzip (I forget the actual details, there were notes I followed from another thread on here I think)

Sorry for the delay. I dont get notified on my email when this post gets comments for some reason.

However, I didnt get the working with CTB. I used cesiumlab… :stuck_out_tongue:

However, as @mahalobay this is something i will try out in the future.

the same python code works however for what i did with cesiumlab.

if @mahalobay can shed some light on how to reconfigure the local code or drop the link to the thread, i can try it out as well to make things faster.

recently was able also host tiles with it.

Kind Regards
Vamshi

Ehm, I totally hacked my local server config files and I couldn’t even tell you how it worked, but this was the article I found the answer from:

The key is that CTB generated data is actually gzipped but that information isn’t passed along in the url, so you basically have to retarget any server requests for .terrain files with Header set Content-Encoding: gzip, in order for the system to know how to properly handle the data. Once this is set up, you just call the Tileset using the ‘FromURL’ function and then a local server path similar to this:
http://192.168.1.208/Cesium_Dev/Victoria/terrain/layer.json

Having said all that, I am able to get local data into the system but I have not had a fully successful build out of CTB yet. It works but there are patches missing, incorrect bboxes, etc. I’m curious how CesiumLab might handle things, is there an English build of it?

cesium lab does offer english mode, I’ve been using it in english.

I tried using ctb and cesiumlabs to be served onto ue4 but I get the cannot parse terrain file issue on both ends.

Hey, can you post the exact error. I’ll try to look into it? The error you get when trying to load cesium labs output I mean.

Kind Regards
Vamshi

is there a separate link for the english version of cesiumlab? or is it something you can just switch to once it’s installed?


image
@vamsh.chittaluri

@mahalobay you can switch to english version after installing it by clicking EN on the bottom right corner of the window after installing.

This is the working config for my IIS server, built from parts found around the internets:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".terrain" mimeType="application/octet-stream" />
        </staticContent>
		<rewrite>
			<outboundRules>
				<rule name="Rewrite TERRAIN header" preCondition="IsTERRAIN" stopProcessing="true">
					<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
					<action type="Rewrite" value="gzip" />
				</rule>
				<preConditions>
					<preCondition name="IsTERRAIN">
						<add input="{PATH_INFO}" pattern="\.terrain$" />
					</preCondition>
				</preConditions>
			</outboundRules>            
		</rewrite>
    </system.webServer>
</configuration>

I think that was the other part I forgot to mention. The mimetype also has to be set to octet stream instead of octvertexnormals, as well as the gzip encoding notification. Hope it makes sense, not an IT pro here :slight_smile:

Please try to run the python server (terrainserver.py) on 32-bit python. python 3.8.3 32 bit for example.

Let me know what happens.


I used the 32 bit python and this is the results I got

@vamsh.chittaluri
Can I see your settings for cesiumlabs when making the terrain tiles, maybe I had the wrong settings?

Any idea what else could be done?