# Can I calculate forward/backward transformation from geolocation(lat/lon/height) to screen X,Y?

**URL:** <https://community.cesium.com/t/can-i-calculate-forward-backward-transformation-from-geolocation-lat-lon-height-to-screen-x-y/5574>\
**Category:** CesiumJS\
**Created:** [May 31, 2017, 12:31am UTC](https://community.cesium.com/t/can-i-calculate-forward-backward-transformation-from-geolocation-lat-lon-height-to-screen-x-y/5574 "2017-05-31T00:31:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ko-hei\_OHTSUKA](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@Ko-hei\_OHTSUKA](https://community.cesium.com/u/Ko-hei_OHTSUKA)\
**Post date:** [May 31, 2017, 12:31am UTC](https://community.cesium.com/t/can-i-calculate-forward-backward-transformation-from-geolocation-lat-lon-height-to-screen-x-y/5574/1 "2017-05-31T00:31:15Z")

</div>

Hi,

I want to know what geolocation point(lat/lon/height) is shown on the screen X,Y without user clicking event.  
And also, want to know if each geolocation point is visible now or hidden behind the ridge.

Such calculation is possible?

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [May 31, 2017, 6:16pm UTC](https://community.cesium.com/t/can-i-calculate-forward-backward-transformation-from-geolocation-lat-lon-height-to-screen-x-y/5574/2 "2017-05-31T18:16:12Z")

</div>

Hi Ko-hei,

Yes! You can get the Cartesian3 (3D scene space position) from a given (x, y) pixel coordinates using Scene.pickPosition. Here’s some example code: [http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Picking.html&label=Showcases](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Picking.html&label=Showcases)

Create a ray from your current camera position to the 3d point of interest, then use pick [http://cesiumjs.org/Cesium/Build/Documentation/Globe.html?classFilter=globe#pick](http://cesiumjs.org/Cesium/Build/Documentation/Globe.html?classFilter=globe#pick) (which takes a ray) to return the first entity along that ray. If pick gives you the expected entity, then it’s visible. Otherwise, if its a different entity or undefined, it’s occluded.

Hope that helps!

- Rachel

---

<div class="post-metadata">

**Author:** ![Ko-hei\_OHTSUKA](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@Ko-hei\_OHTSUKA](https://community.cesium.com/u/Ko-hei_OHTSUKA)\
**Post date:** [June 1, 2017, 12:06am UTC](https://community.cesium.com/t/can-i-calculate-forward-backward-transformation-from-geolocation-lat-lon-height-to-screen-x-y/5574/3 "2017-06-01T00:06:45Z")

</div>

Hi Rachel,

Great! I will try, thank you!

Kohei

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [June 2, 2017, 8:51pm UTC](https://community.cesium.com/t/can-i-calculate-forward-backward-transformation-from-geolocation-lat-lon-height-to-screen-x-y/5574/4 "2017-06-02T20:51:47Z")

</div>

Hi Kohei,

The point to point visibility issue is a little more complicated than I described, so here’s a code example: [http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=822f432f2955dc9d57dee6d42f3632a6](http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=822f432f2955dc9d57dee6d42f3632a6)

Let me know if you need any clarifications – hope that helps!

- Rachel
