how to view data which contains in Cesium3DTileset

300 views
Skip to first unread message

lakshmi...@gmail.com

unread,
Apr 9, 2018, 7:00:35 AM4/9/18
to cesium-dev
1. A concise explanation of the problem you're experiencing.

I want Cesium3DTileset data of buildings where I can compare and modify to my function latitude

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.


var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: 'https://beta.cesium.com/api/assets/1461?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s',
shadows: true,
terrainShadows: Cesium.ShadowMode.ENABLED
}));

console.log("tileset=="); console.log(tileset);

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to compare Cesium3DTileset data with my existing lat longs.


4. The Cesium version you're using, your operating system and browser.

1.39 cesuim, windows 10 OS

Sean Lilley

unread,
Apr 9, 2018, 10:48:39 PM4/9/18
to cesium-dev
Are you trying to find if a tileset covers a certain lat/long? Or something else?

Dhana lakshmi

unread,
Apr 10, 2018, 1:11:04 AM4/10/18
to cesiu...@googlegroups.com
 Hi  Sean Lilley,

I am trying to compare latitude longitude of tileset and with my  present  latitude & longitude.

I am trying to implement line of sight function where i can restrict line ray not to pass thru other buildings.


Is that possible to get data latitude longitude & height of objects parameters of Cesium3DTileset  without click event ?


Request to guide me.

Regards
Dhanalakshmi




--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/4NldMgzFfGU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dhana lakshmi

unread,
Apr 10, 2018, 4:42:15 AM4/10/18
to cesiu...@googlegroups.com
Hi Sean,

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
       url: 'https://beta.cesium.com/api/assets/1461?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s',
     shadows: true,
     terrainShadows: Cesium.ShadowMode.ENABLED
   }));


Here from this code , i receive graphical image  of 3D buildings where line of sight passing thru the buildings.

can u help me out , how can we change graphical image to opaque  in  Cesium3DTileset.


Regards
Dhana

Sean Lilley

unread,
Apr 10, 2018, 7:34:12 PM4/10/18
to cesium-dev
Oh I think I see now. Right now we don't have support for ray-tileset intersection which is needed for line of sight. The shadows effect is purely visual.

The NYC tileset that you're using does have some attributes that may help approximate line of sight. Each building has a longitude, latitude, area, and height, and with these values you can estimate a bounding box for each building. Then its just a matter of getting the visible tiles (one way is tileset._selectedTiles), looping over the features in each tile, getting the longitude, latitude, area, height properties, and then doing a ray vs. estimated bounding box test. It's not the easiest thing to do but it's possible.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

Dhana lakshmi

unread,
Apr 11, 2018, 3:07:06 AM4/11/18
to cesiu...@googlegroups.com
Hi  Sean ,

Thanks for the information.

can help me out, how to find bounding box for each building in  Cesium3DTileset.


Regards
Dhanalakshmi

To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.

Dhana lakshmi

unread,
Apr 11, 2018, 3:08:06 AM4/11/18
to cesiu...@googlegroups.com
Hi ,

My question is a function to find bounding box for each building in  Cesium3DTileset.

Regards
Dhana

Gabby Getz

unread,
Apr 11, 2018, 10:59:45 AM4/11/18
to cesium-dev
Currently, you can't retrieve the bounding box of a specific building through the Cesium API.

Sean Lilley

unread,
Apr 12, 2018, 6:51:01 PM4/12/18
to cesium-dev
Dhana, the best you can do is approximate it with the steps I listed above, however as noted it can get complicated.

Dhana lakshmi

unread,
Apr 13, 2018, 2:28:51 AM4/13/18
to cesiu...@googlegroups.com
Hi Sean,

I have written code for 360 degrees with human vision distance. My loop is hanging out. Please, can u help me out with calculations?

am using cesuim3dtileset data for tileset data comparison to stop the line with final lat long.




below is my code:
---------------------

     terrainShadows: Cesium.ShadowMode.ENABLED,
 classificationType : Cesium.ClassificationType.TERRAIN,
 tilesLoaded : true
   }));
   
   
   
var tileset =[];
   tileset.tileLoad.addEventListener(function(tile) {
    var content = tile.content;

    for (var i = 0; i < content.featuresLength; i++) {
        var feature = content.getFeature(i);
 tileset [i]=[];
 tileset [i]['latitude']=content.getFeature(i).getProperty('latitude');
 tileset [i]['longitude']=content.getFeature(i).getProperty('longitude');
 tileset [i]['area']=content.getFeature(i).getProperty('area');
 tileset [i]['height']=content.getFeature(i).getProperty('height');
 tileset [i]['SOURCE_ID']=content.getFeature(i).getProperty('SOURCE_ID');
 tileset [i]['name']=content.getFeature(i).getProperty('name');
    }
});
console.log("tileset_data----"+ tileset );




function polyLinedisplay(longitude,latitude,status,height,tileset){
 
 //console.log(3);
console.log("tileset"+tileset);

//alert("status-"+status);
//console.log("color=="+color);
var glowingLine;
 
if(status==1){
// LINE OF SIGHT
//var longitude=longitudeString;
//var latitude=latitudeString;
var theta=360 ; 
                            //bearing in degre
//var R= 5000 ;    // distance in meters 
var degree=[];
                                                        var k=0;
for(R=10;R<5000;R=R+10)
{
for(var i=0;i<=theta;i++){
//var findlatlong=findLatlongs(longitude,latitude,i);
//console.log("findlatlong");console.log(findlatlong);
if(degree.indexOf(i)==-1)
{
var dx1 = R * Math.cos(i) ; 
//console.log("dx=="+dx1);

var dy1 = R * Math.sin(i); 
//console.log("dy=="+dy1);
var delta_longitude1 = dx1/(111320*Math.cos(42.25732445310803));
//console.log(delta_longitude1);

var delta_latitude1 = dy1/110540;
//console.log(delta_latitude1);

Final_longitude1 = longitude + delta_longitude1;
Final_latitude1 = latitude + delta_latitude1;
console.log("i==="+i+"=="+"Final_longitude1"+Final_latitude1+","+Final_latitude1);
// Storing the matched degrees
for(var j=0;j<tileset.length;j++){
var p_Final_longitude1 = parseFloat(Final_longitude1.toFixed(6));
var p_Final_latitude1 = parseFloat(Final_latitude1.toFixed(6));
var p_tileset_longitude1 = parseFloat(tileset[j]['longitude'].toFixed(6));
var p_tileset_latitude1 = parseFloat(tileset[j]['latitude'].toFixed(6));
console.log("p_Final_longitude1-----"+p_Final_longitude1);
console.log("p_Final_latitude1-----"+p_Final_latitude1);
console.log("p_tileset_longitude1-----"+p_tileset_longitude1);
console.log("p_tileset_latitude1-----"+p_tileset_latitude1);
if(p_tileset_longitude1==p_Final_longitude1 && p_tileset_latitude1==p_Final_latitude1){
 degree[k]=  i;
 k++;
} 
}
console.log("degree---"+degree);
var value=longitude+","+latitude+","+height+","+Final_longitude1+","+Final_latitude1+","+height;
console.log("value==");console.log(value);

//var arr=[value];
//console.log("arr==");console.log(arr);

var res = value.split(",");
console.log("finalarray_result==="+res); 
  
glowingLine = viewer.entities.add({
name : 'Glowing blue line on the surface',
polyline : {
//positions : Cesium.Cartesian3.fromDegreesArray(res),
//followSurface:false,
positions : Cesium.Cartesian3.fromDegreesArrayHeights(res),
width : 1,
material : Cesium.Color.ORANGE.withAlpha(0.5),
   
}
});

viewer.camera.flyTo({
destination : Cesium.Cartesian3.fromDegrees(longitude,latitude,1000)
});
  // viewer.zoomTo(viewer.entities);
}

}
}
}else{
 viewer.entities.removeAll(); 
}
}


To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
Message has been deleted

sush

unread,
Sep 8, 2018, 7:44:41 AM9/8/18
to cesium-dev
hi any update on this?

Omar Shehata

unread,
Sep 9, 2018, 11:38:07 AM9/9/18
to cesium-dev
If you're asking specifically about how to get the height of a tileset at a particular point, there has been some progress! Check out Gabby's response here: https://groups.google.com/d/msg/cesium-dev/fOwyt5-_XPc/WsZb6jNwBgAJ

On Saturday, September 8, 2018 at 7:44:41 AM UTC-4, sush wrote:
hi any update on this?

sushmapriy...@gmail.com

unread,
Sep 10, 2018, 6:19:00 AM9/10/18
to cesium-dev
i'm actually looking for ray tileset intersection.

Gabby Getz

unread,
Sep 11, 2018, 10:16:10 AM9/11/18
to cesiu...@googlegroups.com
Hi sush,

That's what that pull request should accomplish. We'd get the height by testing the intersection of a ray perpendicular to the ellipsoid's surface, but it will work for any ray.

Thanks!
Gabby

On Mon, Sep 10, 2018 at 6:19 AM, <sushmapriy...@gmail.com> wrote:
i'm actually looking for ray tileset intersection.

--
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.
Reply all
Reply to author
Forward
0 new messages