Zoom to visible 3d tiles

205 views
Skip to first unread message

frank...@gmail.com

unread,
Feb 4, 2019, 4:06:49 PM2/4/19
to cesium-dev
I'm trying with 3d tiles,because my project project has grown in data and I have a doubt.
How can I go through each building (all, not only visible) with the example of ny? On the other hand, how can I zoom in the bounding box of several show=true entities, just as can be done with kml?

This features are posible using viewer.datasource but using 3d tiles i dont have idea

Thanks for your help and cesium ion is a killer server

Omar Shehata

unread,
Feb 5, 2019, 10:21:24 AM2/5/19
to cesium-dev
Once a tileset is ready, you can actually use viewer.zoomTo to get to it. So it would look like this:

tileset.readyPromise.then(function() {
 viewer
.zoomTo(tileset);
});

For zooming in to particular features, the Cesium ion 3D Tiling pipeline will save metadata per feature. For the NYC each building has a longitude/latitude properties saved on it, so you can use that to zoom in. Check out this Sandcastle:


Select the "Zoom to metadata" radio button, then right click on any building. Let me know if this does what you need. And thanks for your kind words! Glad you've been enjoying using Cesium ion. We're constantly improving it so if you have feedback or ideas for features let me know here or feel free to post on the ion community repo (https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D%20Tiles%20Interactivity.html).

Francisco José Raga López

unread,
Feb 5, 2019, 11:13:03 AM2/5/19
to cesiu...@googlegroups.com
Thanks for a quick response.

I know those examples!
The problem is to only zoom the visible ones, for example, in https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D%20Tiles%20Feature%20Styling.html, click on "hide by height" and many buildings disappear, but some are the ones that fulfill the condition.

How can I zoom to the buildings that it meets:
'$ {height}> 200'

using kml i make array of entities,but in 3D Tiles?

Extract which buildings meet that condition?I don't Know

thanks
Francisco Raga | Full-Stack Open Source GIS Developer 
    
Móvil: (+34) 654275432 | e-Mail: frank...@gmail.com | skype: francisco_raga
Github: https://goo.gl/ydNTjY
 | Linkedin: https://goo.gl/TCfj8S | Site: https://goo.gl/qiypDj

"La vida real no tiene ningún mapa.."  Ivy Compton Burnett


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Omar Shehata

unread,
Feb 7, 2019, 8:58:36 AM2/7/19
to cesium-dev
I think you would have to do something similar to what you would do with KML. After you apply the style to your tileset, you'd have to iterate through all the tiles and their features, collect the ones that are not hidden (perhaps by checking their .show property) and then you can potentially average their long/lat positions to figure out where to zoom to.

Is that similar to what you'd done before with KML? Perhaps one thing that CesiumJS can do to make it easier is to allow the camera to zoom in to any given set of entities/models. If you do end up implementing this it'd be awesome to post it here (or even better, contribute the code back to Cesium!)
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.

Francisco José Raga López

unread,
Feb 7, 2019, 9:08:52 AM2/7/19
to cesiu...@googlegroups.com
thanks

this is the question,how Can i  iterate through all the tiles and their features, collect the ones that are not hidden (perhaps by checking their .show property ?? this is the question

When I have that, it is easy to implement the zoon if we have latitude, longitude, area and height for each building.


regards 
Francisco raga  | Desarrollador GIS de  código abierto de  pila completa 
    
Móvil: (+34) 654275432 | e-Mail: frank...@gmail.com | skype: francisco_raga
Github: https://goo.gl/ydNTjY
 | Linkedin: https://goo.gl/TCfj8S | Site: https://goo.gl/qiypDj

"La vida real no tiene ningún mapa.."  Ivy Compton Burnett
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

Omar Shehata

unread,
Feb 7, 2019, 1:33:32 PM2/7/19
to cesium-dev
Given a tileset, you can get its root property, which is a Cesium3DTile. Each tile has a children property as well as a content property. The Cesium3DTileContent can tell you the featuresLength, and you can use the content.getFeature from 0 up to the length to get all the features. And finally, a Cesium3DTileFeature has a show property.

Note that you'll only be able to get the content for tiles that are already loaded, so ones that already on screen. So perhaps a good way to do this is to zoom the camera to the whole tileset, apply the style, then do this iteration/collection.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.

Francisco José Raga López

unread,
Feb 7, 2019, 1:55:59 PM2/7/19
to cesiu...@googlegroups.com
Thank you very much for your reply

I will try that way and publish the solution

regards
Francisco Raga | Full-Stack Open Source GIS Developer 
    
Móvil: (+34) 654275432 | e-Mail: frank...@gmail.com | skype: francisco_raga
Github: https://goo.gl/ydNTjY
 | Linkedin: https://goo.gl/TCfj8S | Site: https://goo.gl/qiypDj

"La vida real no tiene ningún mapa.."  Ivy Compton Burnett

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages