How do I convert my data to 3D Tiles?

Hi all,

One of the most common questions we receive is “how do I convert my data to 3D Tiles?” Given that Cesium’s 3D Tiles renderer will be ready in the next few months, I expect this question to become even more popular.

In the short term, the answer is to please email me, pcozzi@agi.com, and ask. We likely already have in-house tools that can convert your data to 3D Tiles, and we’re happy to run them with your data.

We have tilers for several types of data (CAD, photogrammetry, 3D buildings, point clouds, etc.) and have successfully worked with many folks, and have written a few blog posts with the results, for example: SiteSee Photogrammetry and 3D Tiles.

Slightly longer term, these tools will be part of Cesium Composer, a commercial web service and OnPrem platform we are developing to further expand and fund open-source Cesium development. You can sign up for the beta here.

Thanks,

Patrick

在 2017年5月11日星期四 UTC+8下午8:26:23,Patrick Cozzi写道:

Hi all,

One of the most common questions we receive is "how do I convert my data to 3D Tiles?" Given that Cesium's 3D Tiles renderer will be ready in the next few months, I expect this question to become even more popular.

In the short term, the answer is to please email me, pco...@agi.com, and ask. We likely already have in-house tools that can convert your data to 3D Tiles, and we're happy to run them with your data.

We have tilers for several types of data (CAD, photogrammetry, 3D buildings, point clouds, etc.) and have successfully worked with many folks, and have written a few blog posts with the results, for example: SiteSee Photogrammetry and 3D Tiles.

Slightly longer term, these tools will be part of Cesium Composer, a commercial web service and OnPrem platform we are developing to further expand and fund open-source Cesium development. You can sign up for the beta here.

Thanks,

Patrick
--

twitter.com/pjcozzi

在 2017年5月11日星期四 UTC+8下午8:26:23,Patrick Cozzi写道:

Hi all,

One of the most common questions we receive is "how do I convert my data to 3D Tiles?" Given that Cesium's 3D Tiles renderer will be ready in the next few months, I expect this question to become even more popular.

In the short term, the answer is to please email me, pco...@agi.com, and ask. We likely already have in-house tools that can convert your data to 3D Tiles, and we're happy to run them with your data.

We have tilers for several types of data (CAD, photogrammetry, 3D buildings, point clouds, etc.) and have successfully worked with many folks, and have written a few blog posts with the results, for example: SiteSee Photogrammetry and 3D Tiles.

Slightly longer term, these tools will be part of Cesium Composer, a commercial web service and OnPrem platform we are developing to further expand and fund open-source Cesium development. You can sign up for the beta here.

Thanks,

Patrick
--

twitter.com/pjcozzi

Hi,I'm Jack,
I got some trouble recently,
when I open the city 3d model on cesium ,It is above the virtual global,they can't laminated together well ,I don't know why this happen ,and how to solve this problem .can you give some suggestions?

Hi Jack,

We’d be happy to help with your issue, but we’ll need more details. Can you post your code and / or a screenshot demonstrating the issue?

Best,

  • Rachel

Hello there,

I recently viewed your work on your website and I really seem to like it a lot. I am a student from India and I want to create the 3-D views for the buildings in my locality. I have already installed OSM on my local. I am new to this so please guide me in the things that I require to make and do rendering tasks.

Keep up the nice work.

Hi I'm working on OSM Buildings to Cesium 3d tiles conversion.

It's quite close to be done. But I still have some issues and questions.

1. What's the actual tag or branch for Cesium with 3d Tilesets support?

2. How big the overhead for tileset of tilesets? What if I'll use 4-5 levels of tilesets nesting. Are there any flaws of that?

3. IS that possible to add Tileset to scene via CZML?

Hi there,

  1. 3D Tiles will be in the next release of Cesium (July 5). Until then, you can get it from our github repo (3D Tiles has been recently merged with master). https://github.com/AnalyticalGraphicsInc/cesium

  2. Our tileset traversal is as optimized as we’ve been able to make it. (Check out our blog for more on that.) 4-5 levels of nesting should not be a problem at all.

  3. Not possible right now, unfortunately.

hope that helps,

  • Rachel

I am trying to convert a large obj file to gltf using the obj2gltf command line tool. The obj file is about 800MB. It has been taking 4 hours for the conversion, and it is still working on it. I am just wondering if the library would work for such large obj file. I did the following steps to get the obj file:

  1. Extract pbf data from metro extract

  2. Use osm2world to generate the obj file

Now I am using obj2gltf to generate the gltf file. It seems the obj file is too large to be attached here…

Hi Zxue,

Metro extracts are too big for that, even if you convert the whole piece into gltf, it will kill you’r browser.

I’m making that in steps:

  1. I split the NY extract into z12 tiles with my own tool https://github.com/kiselev-dv/gazetteer/releases/tag/Gazetteer-1.9rc4

  2. I’ve done tiled output for OSM2World (https://github.com/tordanik/OSM2World/pull/122) which creates tileset.json for each z12 tile and split them into z14 tiles.

  3. Using some scripts, I combine all z12 tilesets into one big tileset. https://github.com/kiselev-dv/osm-cesium-3d-tiles/blob/master/scripts/convert.sh (Sorry no appropriate docker image yet)

Here is the demo with what I’ve got so far http://osm.me/cesium_3d_tiles/Apps/CesiumViewer/
I still have some issues with geometricError calculation. So for instance some parts of Manhattan appears only when you fly very close to them.

So I’ll apriciate some examples of geometricError calculation or the tutorial how to twick it.

Hi Dmitry,
Thanks for sharing this method. Do you have any sample code for this? Or do you have any documentation including the commands I need to run for this process? In other words, do you have a step-by-step guide. For the last step how do you convert the gltf files to b3dm files? Or do you convert obj to b3dm and generate the titleset.json file at step 2?

As the issue I had in my previous post, I am trying to work on small dataset. I am working on the Harvard Square data from Metro Extra. Attached is the result I got. Here is the code I am using for showing this gltf tile:

var viewer = new Cesium.Viewer(‘cesiumContainer’);
var position = Cesium.Cartesian3.fromDegrees(-71.1190, 42.3736, 0);

var entity = viewer.entities.add({
name : ‘Apple Hill’,
position : position,
model : {
uri : ‘http://localhost:8003/tilesets/Harvard/harvard.gltf’,
minimumPixelSize : 128,
maximumScale : 20000
}
});
viewer.trackedEntity = entity;

``

It seems when I tried to convert the pbf to obj via OSM2World, it created a “base” for the area. Is there any way that I can only extract buildings from this dataset? Attached is my pbf file.

Any idea?

Thanks!

harvard.osm.pbf (24.4 KB)

  1. you can filter highways and other objects with osmfilter
  2. to skip terrain generation use --config here is my for instance https://github.com/kiselev-dv/osm-cesium-3d-tiles/blob/master/scripts/prop.properties

I’ve updated my docker setup here https://github.com/kiselev-dv/osm-cesium-3d-tiles

  1. build and run that docker, map some folder on the host to /opt/data

  2. download data and save it as /opt/data/map.osm.bz2

  3. run convert.sh

What could be wrong:

convert.sh will run gazetteer.jar to filter buildings and split the large dataset into smaller tiles.

you can do it manually, it require two steps

  1. java -jar /opt/gazetteer/gazetteer.jar --data-dir /opt/data split /path/to/osm.xml.bz2 or you can use pbf with osmconvert

osmconvert /path/to/pbf | java -jar /opt/gazetteer/gazetteer.jar --data-dir /opt/data split -

  1. java -jar /opt/gazetteer/gazetteer.jar tile-buildings --out-dir /opt/osm-tiles --level 12

Next convert osm into obj and split it into z14 tiles

It’s done by convert_parallel.py

Manually it’s:

cd to /opt/OSM2World

run ./osm2world.sh -i /path/to/osm -o path/to/obj --config /scripts/prop.properties

Than, obj2gltf and gltf2b3dm

Than you can use generated by OSM2World tileset.json

1 Like

I didn’t test the whole process from within docker container, but successfully converted NY metroarea using convert.sh, with some paths overwritten.

1 Like

Thanks for your help! It works great for my case! Thanks so much! Just one more question. How to do color the buildings after you convert them from obj to gltf?

Thanks a million!

Thanks for such detailed guide! I am going to try it!

Thanks!

By default, OSM2world will use coloring from OSM or apply default color/material, and obj2gltf and gltf to b3dm will keep materials from obj.

Or if you are talking about coloring on hover, like in 3d tiles demo for NY - that’s tricky part, I still don’t dig gltf deep. There is gltf lib in java, i think it’s possible to attach ids to groups of primitives using that lib, but I din’t work on using it together with OSM2World

When I use obj2gltf, it just gives me the “raw” buildings 3d models without color…
Should I just set the following option to be true?
material_BUILDING_DEFAULT_texture_colorable = true

``

To be honest, I don’t know.

I’ve tested obj2gltf on some obj models and got models with colors and textures.

OSM2World also worked with textured models out of the box.

No problem. I will try to figure it out. Thanks for help!

No worries, keep me posted.