I have noticed when sampling a large number of points that all of the requests are made simultaneously for the terrain tiles. This isn’t a problem in Firefox or Edge, but it causes Chrome to throw ERR_INSUFFICIENT_RESOURCES for any tiles over a certain number, so you get a lot of null height responses in Chrome when there are actually tiles there.
The maximumRequestsPerServer works correctly when just scrolling around the map.
Is it deliberate that it doesn’t work with sampleTerrain? Is there some way to enable it or control chunking?
Example of large number of simultaneous requests on sampleTerrain:
My best guess is sampleTerrain may not be accounting for this just because it isn’t a common use case. Can you describe more what you’re trying to do? If the scene you’re sampling is already loaded doing a series of globe.getHeight calls should be a lot more efficient: https://cesium.com/docs/cesiumjs-ref-doc/Globe.html#getHeight.
We’re mapping the height of an area in high detail, so we’re talking sampling hundreds of thousands of points at a detail level of 15-16. This often results in many thousands of tiles being loaded. This isn’t using a Cesium Ion terrain server, but one in our local network, so the network side of things tends to be pretty quick even with this number of requests. I would love to use getHeight but then we have no control over the detail level of the tiles that are being used in the area we are sampling. It needs to be consistent.
Otherwise, it sounds like this operation could be faster if you just request all the tiles covering the area of interest at level 15-16, then just look up the heights in your grid. I’m actually not sure whether doing this with sampleTerrain will more or less behave that way if it’s caching tiles.
In any event, I think a contribution to have sampleTerrain obey the maximumRequests would be welcome. This is where requests currently get throttled:
I think you may need to change how sampleTerrain is making the request to go through the request scheduler, or otherwise apply that same logic there.
I have seen that you have the viewshed tool available and have tried reaching out through that link multiple times in the past (including right after you sent this reply). I have never received a response.
If I get time I will have a look at making that suggested change. Thanks.