# Determine if geographic coordinates are visible

**URL:** <https://community.cesium.com/t/determine-if-geographic-coordinates-are-visible/22542>\
**Category:** CesiumJS\
**Created:** [February 24, 2023, 9:49am UTC](https://community.cesium.com/t/determine-if-geographic-coordinates-are-visible/22542 "2023-02-24T09:49:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianM18](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/christianm18/32/12432_2.png) [@ChristianM18](https://community.cesium.com/u/ChristianM18)\
**Post date:** [February 24, 2023, 9:49am UTC](https://community.cesium.com/t/determine-if-geographic-coordinates-are-visible/22542/1 "2023-02-24T09:49:00Z")

</div>

Hi everyone,

My project needs to determine if given degree coordinates (on the globe surface) are visible by the camera. The following code has been written for that purpose:

```javascript
const viewer = new Cesium.Viewer("cesiumContainer"); // for instance
// set the camera over the pacific ocean
viewer.camera.position = new Cesium.Cartesian3(-33517534.12007907, -10816522.975550467, 2121682.0018882686);
viewer.camera.direction = new Cesium.Cartesian3(0.949949844026326, 0.30656056846902546, -0.06013245125809427);

let ellipsoid = viewer.scene.globe.ellipsoid;
let cameraPosition = viewer.scene.camera.position;

let bs = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
let occluder = new Cesium.Occluder(bs, cameraPosition);

let point = Cesium.Cartesian3.fromDegrees(180, 0, 0.001);
let isPointVisible = occluder.isPointVisible(point);

console.log(isPointVisible);

```

For these coordinates (180, 0, 0.001), `true` is returned in the Cesium SandCastle, which seems OK.  
However, I cannot manage to get this working for latitudes different from 0. For example, (180, -1, 0.001) returns `false`.

I guess the problem here is the altitude, so I have tried to get the right altitude by casting a Ray by following the instructions on [this topic](https://community.cesium.com/t/how-to-get-intersection-of-a-ray-from-the-camera-and-3d-terrain/8646).  
However I could not manage to make this work either.

I do not know much about Cesium yet, and maybe I am missing something trivial here. Would anyone be willing to point me any mistake I could have made, please?

Thank you all!

Cesium version: 1.94.3

---

<div class="post-metadata">

**Author:** ![peterchwl](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/peterchwl/32/15897_2.png) [@peterchwl](https://community.cesium.com/u/peterchwl)\
**Post date:** [September 5, 2023, 12:29pm UTC](https://community.cesium.com/t/determine-if-geographic-coordinates-are-visible/22542/2 "2023-09-05T12:29:59Z")

</div>

Hi,

I am dealing with a similar issue with isPointVisible and was wondering if you were able to solve your issue?
