-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting elevation incorrect outside of west coast north america #655
Comments
@bkovitz and I did some work this afternoon on using an old fashioned raycaster to find the ground Here is a quick video of the attempt showing raycaster events for a box geometry but not the 3dtiles: Here is a link to the WIP raycaster demo that does not work yet... Instead, we may need to go lower level. This is a key part of the draping example.
looking at the a-frame raycaster component, it only intersects with elements in the a-frame scene graph (dom): So perhaps after getting objects on line 185, we can then add all of the children object3d from the visible 3dtiles, see here: nytimes/three-loader-3dtiles#97 |
I read this thread. Is it okay if I try to resolve this issue using the method suggested by Avnerus? Convert height from |
In the process of my searches, I found that the height in the Google Maps API is indeed transmitted in the GM96 format, while the coordinates are in the WGS84 format. I also discovered that it is possible to get elevation information by coordinates in WGS84 format through other APIs such as: Open Elevation API, NASA, USGS Elevation Point Query Service. Or we can convert the height from EGM96 to WGS 84 using the egm96-universal translator (https://www.npmjs.com/package/egm96-universal) or proj4 library, for example. But transator is heavy (2,5mb). |
Alexander, that sounds like promising info: that the elevation is EGM96 but the coordinates are WGS84 (very surprising!). If you could get that to work, it would be a principled solution. The solution that @kfarr and I put in on Saturday is somewhat unprincipled but it's very simple—just a few lines of code. It "empirically" finds the ground by doing a raycast from a high elevation straight down and seeing what it intersects. This avoids the problem that elevation databases can have inaccuracies, but it might still go wrong because tiles of different Levels of Detail get loaded into memory gradually and the raycaster might find a huge, coarse tile and therefore misjudge the elevation. It might be worthwhile to implement the EGM96–WGS84 translation and then try out both methods at a variety of different geographical locations to see which method is truly reliable. All that really matters, of course, is that the eyepoint of the camera start out somewhat above ground. Even hundreds of meters above ground is OK, but below ground is not OK. |
@bkovitz @Algorush I also spent some time last night on the ability to do this via math instead of raycaster. Ben and I feared that the Ground Elevation Model would require interpolation and therefore be inaccurate. However, in my testing the accuracy is plenty good, but the remaining issue is that it uses a large GEM dataset either on the client (minimum 500k up to many megabytes) or needs to be a backend service that we or others host. Here are 2 precise examples to validate this method. I used the NOAA API however that only works for US locations. There does not appear to be a simple / free / open api like this for all global lat/long points. Rural location in Montana:
Hetch Hetchy reservoir / Yosemite:
A few options to proceed:
I vote to continue (1) |
I can also try to make a cloud (Firebase?) function that will accept lat, long and return the height in WGS84 to the request. |
Ok I have a PR for review: #720 On a sidenote, I used the local firebase emulator which was helpful to avoid waiting for time to deploy firebase function to dev server:
I also deployed on dev server: compare response to: it's within a half a meter accuracy for that long/lat, that's plenty great and we can add a few meters to be safe? (to ensure that we're always above ground and not below ground?) but we should test a few more lat/long locations next steps:
|
setting elevation of 3dtiles from google maps lat/long was incorrect – using a ‘constant’ to convert between is faulty for the following cases
To reproduce:
Why?
Question:
height
value of threejs 3d tiles loader based onelevation
3dstreet/src/components/street-geo.js
Line 107 in 5d6bacc
How to find the answer:
Related concepts:
The text was updated successfully, but these errors were encountered: