The fundamental issue I’m trying to solve is that I want to place lots of objects on the earth according to known longitude, latitude and height data.
As a test, I picked an arbitrary point with a known elevation, because finding lat and long seems easy. In my test case I picked Guadalupe Peak in Texas. I went to bing maps and I found the longitude and latitude. I figured bing was a safer than google maps, because that’s what Cesium uses right? So I got the latitude and longitude values of 31.891330 and -104.861100 respectively.
Then I went to wikipedia and found the height. The listed height is 2667 meters.
So what I did was a made a simple actor who’s parent class was CesiumGeoreference. I added a sphere to it and then in the construction script I did this:
I find the CesiumGeoreference on which the world is based. From it, I call the Inaccurate Transform Longitude Latitude Height to UE node with the values above to generate an xyz position (note in the node it’s long then lat). Then I set the actor’s position to that xyz value. I visually set the origin (red sphere) to where I thought the peak was. The white sphere is where the above blueprint set the sphere. All things considered, it’s pretty close, but I was hoping to get dead on accuracy.
from the side
from the front
I think there’s something else going on though, because if I manually type in the latitude and longitude that I got from bing, with the height I got from wikipedia into the world’s cesium georeference, for where the center is, they are almost exactly in the same spot, but it’s the same wrong spot. The red sphere moves to where the white sphere is, now both of them are not in the right spot.
This makes it seem like the data I got, or the map data is incorrect. It’s safe to say that Cesium isn’t the problem right? I checked the lat/long against google maps, and it’s only ever so slightly different. The height of 2667 meters is listed in multiple places. So I think my numbers are ok. I realize the node has Inaccurate in the name, but I’m hoping it’s the centimeter inaccuracy, not the dozens of meters inaccuracy. Also, it doesn’t make sense that when I recenter my world according to my lat, long, and height numbers, that they’d match so closely. Anyways, I’m left scratching my head. I’m sure I did something dumb, so hopefully someone can point me in the right direction. I tried to be as transparent as possible with my approach, and I’m happy to provide clarification where it’s still needed.
Sorry for the massive post! Thanks in advance.