Model tileset location is incorrect in local instance

I have generated a model tileset using the model-tiler (v4.5.2), giving the correct location of the origin etc.
If I upload this to the cesium.com and add it as an asset into my story, it is in the correct location as defined.

However when I serve it to my local instance and add it to the scene, it is up in space somewhere!!
Is there something I am missing when I define it to view in the Sandbox?

var tileset1 = viewer.scene.primitives.add (new Cesium.Cesium3DTileset({
url : ‘http://localhost:8002/static/3DBuilding_Sillamae_AOI_OBJ/tileset.json’, }) );

viewer.zoomTo(tileset1);

Kind regards,

John

Could you please share the asset ID with us? That would let us investigate this internally and try to reproduce the problem.

Hi Matt, have a look at 774612.

Something strange is going on here. I can get them to appear now at the right location (didn’t change anything as far as I am aware), but if you use the following command:

var tileset3 = viewer.scene.primitives.add (new Cesium.Cesium3DTileset({
url : ‘http://localhost:8002/static/Tallinn_Old_Town_p1/tileset.json’, }) );

viewer.zoomTo(tileset3);

It will not jump to the tileset3, but just have a blue earth.
Very strange and also not helpful when you are wanting to jump to the tileset to make sure it is there, as I have a number of different ones that i am loading with the asset-server.

Hi,

Thanks for sending the asset ID. I tried reproducing this problem by serving the data with asset-server, and I haven’t been able to do it yet. The data appears at the right location on the globe for me, same as when the data is served from ion.

Can you please check a couple of things and let me know what you see?

  1. With asset-server running, go to the URL of the tileset.json file in your web browser (looks like that would be http://localhost:8002/static/Tallinn_Old_Town_p1/tileset.json for you) and ensure that you can see the contents of the file.
  2. In Sandcastle, check the developer console of your web browser (Ctrl+Shift+I in Chrome) and let me know if you see any messages there.

Also, which web browser are you using?

Thanks,
Matt

Yup, there is data visible when I put that line into the browser.
There is nothing showing in the Dev console :frowning:
Using Chrome : Version 97.0.4692.71 (Official Build) (64-bit)

All right, thank you for checking that. Just to cover our bases, would you mind please sharing a link to the Sandcastle with the code you’re using? I’ll run asset-server using your same directory structure, to make sure I’m reproducing your conditions closely.

After that, I may move this thread to the CesiumJS forum, since based on what you’ve described the data side seems all right.

It’s strange as the tileset is in the correct loation, but when you do the viewer.zoomTo(tileset3); it will zoom to the heavens.

This is the code that I am using in the Sandbox:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

imageryProvider : new Cesium.TileMapServiceImageryProvider({
url : ‘http://localhost:8002/static/imagery/N057E021_Tiled/
}),

baseLayerPicker : false

});

var terrainProvider = new Cesium.CesiumTerrainProvider({
url : ‘http://localhost:8002/Estonia_Terrain_MSL’,
});

viewer.terrainProvider = terrainProvider;

var imageryLayer1 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N55E018_N60E030_15m/’ }) );

var imageryLayer3 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E021_Tiled/’ }) );

var imageryLayer4 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E022_Tiled/’ }) );

var imageryLayer5 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E023_Tiled/’ }) );

var imageryLayer6 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E024_Tiled/’ }) );

var imageryLayer7 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E025_Tiled/’ }) );

var imageryLayer8 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E026_Tiled/’ }) );

var imageryLayer9 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N057E027_Tiled/’ }) );

var imageryLayer10 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E021_Tiled/’ }) );

var imageryLayer11 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E022_Tiled/’ }) );

var imageryLayer12 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E023_Tiled/’ }) );

var imageryLayer13 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E024_Tiled/’ }) );

var imageryLayer14 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E025_Tiled/’ }) );

var imageryLayer15 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E026_Tiled/’ }) );

var imageryLayer16 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N058E027_Tiled/’ }) );

var imageryLayer17 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E022_Tiled/’ }) );

var imageryLayer18 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E023_Tiled/’ }) );

var imageryLayer19 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E024_Tiled/’ }) );

var imageryLayer20 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E025_Tiled/’ }) );

var imageryLayer21 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E026_Tiled/’ }) );

var imageryLayer22 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E027_Tiled_New/’ }) );

var imageryLayer23 = viewer.imageryLayers.addImageryProvider (new Cesium.TileMapServiceImageryProvider ({
url : ‘http://localhost:8002/static/N059E028_Tiled_New/’ }) );

var tileset3 = viewer.scene.primitives.add (new Cesium.Cesium3DTileset({
url : ‘http://localhost:8002/static/Tallinn_Old_Town_p1/tileset.json’, }) );

viewer.scene.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(24.75381111, 59.43864167, 75),
orientation: {
heading: Cesium.Math.toRadians(20),
pitch: Cesium.Math.toRadians(-20),
},
});

viewer.zoomTo(tileset3);

Thanks for that. Could you please use the Share button in Sandcastle (at the top of the page) to send me a link to your code? I noticed that some of the formatting changed during copy/paste (e.g., apostrophes), and I just want to make certain that we’re looking at the same thing.

Off the top of my head, I wonder if there might be a problem with calling viewer.scene.camera.flyTo before viewer.zoomTo, but I can test it out once I have the Sandcastle. Thanks!

http://localhost:8080/Apps/Sandcastle/index.html#c=zZhrbuM2EICvwqYBLAO2Hn7H6wQFdvOjQJJdbNwCBQwYtMTYbGhSICk/usg1epD+7ml6kg4p2ZZsp1b7pxJgSBrO45shOYa4whKtKFkTiW4RJ2v0kSiaLN2frcyphfb1o+AaU05krYG+TThC5ofoEs+J3H6RYkUjcDDMOxhTRh5x/Ezkiobkx6KqY52YK5EM7GoLreOh5zERYrYQSg8Hvt/ylMaahl4Wx3vyu/17vxVMje/Iq1kfb/XGHmiGFXnAWyK/0PDVAr1gpsiET/hb/YO5rSBdTaSEZPbYhbzT27ioUhL3XmnBKZ5m1tPH54da4xDaVtQ9jX4k2XNmaduEAtDLHOTFysVRdFRb5JSdBeR8s3UrMwdP3e69HwymTz3/3m/706C79GpQfFQ/y9v+33mP1sr7qJ2KoLYuo3Yrgtq+jNqrCGrnMmq/Iqjdy6iDiqD2LqPeVAS1fxk18CvAOijXrYKgIqwl2lXQqghriX4VtCvCWqJhBZ2KsJboWEG3IqwlWlbQqwhrmZ5VhX+tm5J9YFAR1jJ94KYirCX6QMuvCGuJPtAKKsJaog+0WhVhzfrA9Ims/5G3XRHewXne7LMbhhTROVYVEk7cWNIl1XRFLG6BL721P41TU/MZXoZmjBmjnE8/s2g6Fms+jQMvi+7+qgSvNXK1zKOEeEkkdl/YdizSb/6IKE05eBV8uKfCUsMT5m33RYrlJzKXhCin1XH73fYggKuBujdupz3odYJev4H63fSMQkhKuM6cZUcKC4Ijyud7549YL1wtvoIUc3Dqp6YIxVSHi/fUmju9t8N5w1XjaqT0lpG73eHFD3QZC6nNjDqu62myjBmGVLxZEr5CbUKlUtNU/XstBJvBzO1PP8wJS/g6lyLh0RDJ+Qw7nVYD7X6+OzD2O90YptOm1ok3OfFMSFhdTQnoiSoOvp0JTnmc6DzCikiYZMyamNE5FHJJo4iR07hNLeIhahVi74ZmQmuxLI6eC67xjBGkCyXQEir+IiSY20dTwl8cP5+5ldN0nvfqUJ6OQgQr0hSJLhXWTeLLkdvtePNecC44KRcpgn1yOVbz3wQzt5GXX4KjiK4QjW4nV0fHipMrFDKsFIy8JIw909/I5Opu5IH+iSkTdsd8hnXA8NaoLYK7h1Touu7Ig9fzllnSYLKjHNn87w75jPRMRFsUYY2bM8qNFRSBYLP1mO2pOevUQBa0YQ/B3kYJLL3rGEvY7zCJthuj29tbdG10G8hU+6Bg3o5UoH7FOCZSdDdKd4PexsTEWpDwdSY2UL0CghET2KBqIda2jGB56qsoAZmKMS840mSjYVqhKTagZSsKpRqi73bUVD0TRkJbQUvvWPK6jWh8nYlgDQox9n4vuW0gEZt1pg6q++NetR8cW+SaYYYuv8IsyblOw5PI2qSYVnJcnJL1KswF7IM5rFnoRhzefPOEN/AUwJPSJDZC1w+OpioDxCxe4Az3pxgUQFaz7muny6Ak3SyBFsd3eOlbbpulG7C5lxcWEKPh6xC9JDw0RXXqsKB3NZSYKuJky/ga9MnGqdc/wB8POpnKEPOvqfpO7yQbc/31+x8n9F4KVq3cmVjvlmOZ3B9S9Qu5//lfcweBzHcuz7auQ2vz8r0t3xD/Bg

I put the viewer.scene.camera.flyto in there as they viewer.zoomTo (tileset3) wasn’t working and it got me to the approximate area I was interested in

Thanks, appreciate you helping me try to reproduce this. I still haven’t been able to see it on my end, but would you mind please trying this Sandcastle and letting me know what you see?

I removed everything but the tileset that you are attempting to zoom to. I’m hoping that helps us zero in on the problem, in case it’s something with the terrain or imagery providers that is throwing it off.

Same issue, doesn’t zoom to the tileset.

In the console it is just complaining about the:

An error occurred in “IonImageryProvider”: Failed to obtain image tile X: 14 Y: 4 Level: 3.

Probably because one is not defined.

image001.jpg

Thanks for trying that and for the screenshot. Can you please use one of your Cesium ion access tokens in the Sandcastle? Let me know if you have any questions about how to find your access tokens or use them (Cesium ion dashboard → Access Tokens).

Cesium.Ion.defaultAccessToken = '<your-access-token>';

Also, are you testing this with an internet connection or without one? Are you looking to do this entirely offline?

This is being tested with an internet connection although currently all the items required are being served locally.

The idea is not to rely on external sources for data but to host them ourselves.

Does the access token have to be generated on the machine that I am running the asset-server and cesium-ion on? Not exactly sure why I need one…

The access token just needs to be able to get the assets that are available on Cesium ion for free, so your ion account’s default access token should suffice. The imagery provider is trying to get Bing maps imagery (which is the default imagery used by the viewer when no custom ImageryProvider is provided, as you noted).

Also, since it looks like you are using a local copy of Cesium, please check if you have pulled the latest changes. I’m wondering if we rotated the default access token, which is what is causing the problem you are seeing.