Any idea to determine one point is in the sea or one the land with cesium?

I wanna pick one entity and change its position to other, but i can’t change the ship on the land, so any idea about this?

Hi, Please elaborate your question with the help of any image, code sample or sandcastle link. It would help us to provide you quick solution.

  • Regards

Are you using a terrain service? Some terrain providers include a waterMask in terrain results. I don’t see an easy way to check the water-mask for a cartographic position, and I haven’t made direct calls to the TerrainProvider before – I usually query terrain via sampleHeight / sampleHeightMostDetailed instead. So, you could try to figure out the waterMask yourself, or you could try calling sampleHeight and treating anything very close to zero as being “in water”, which would probably get a “good enough” result for a first pass.

I would recommend to have a geojson of oceans, then check if point is in that polygon using turfjs funtion boolean within. If point is within ocean polygon it will return true otherwise false…
Another way is, use sampleHeightMostDetailed function of cesium, it will give you elevation values from cesium terrain, if the value is 0, it depicts this point is at mean sea level. so you call can it as its in the ocean.

1 Like

I agree with you. :clap: