Skip to content
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

Z-coordinate difference between Height service and embedded values in swissBUILDINGS3D 2.0 #3156

Open
RobertoMinelli opened this issue Apr 16, 2019 · 8 comments

Comments

@RobertoMinelli
Copy link

Dear all,

I am trying to create a single 3D model (.stl) that contains both a 3D surface representing a terrain and the buildings that lie on that terrain.

To generate the terrain surface, I create a XY-grid of coordinates and I obtain the elevation using the Height service of the GeoAdmin API REST services.

I obtain the buildings contained in the terrain by leveraging the swissBUILDINGS3D 2.0 dataset that I've bought.

Now, the problem: The COLLADA (.dae) models contained in the swissBUILDINGS3D 2.0 dataset have embedded XYZ coordinates (i.e., each building knows where it should be placed on the terrain). X and Y coordinates match with my terrain. Unfortunately, the Z-coordinate do not march (i.e., the terrain is always above the buildings, as per screenshot attached). Do you have any intuition? Am I doing something wrong?

screenshot_2019-04-05_at_11 20 17

cc: @danduk82 @davidoesch @oterral @procrastinatio 😇

@procrastinatio
Copy link
Contributor

procrastinatio commented Apr 16, 2019

For the height service, SwissBuilding and 3D terrain tiles in map.geo.admin.ch are using the usual height (LN02). So altitude for these datasets must be consistent.

But as coordinates in the two latter are WGS84, it is possible that some tools assume that altitude is the expected WGS84 ellipsoidal height one, hence the about 50 meters discrepancy. If you intermixes between the various local (=swiss) systems (LN02, RAN95, etc.), errors will remain within a few meters margins.

@RobertoMinelli
Copy link
Author

Thanks, @procrastinatio. You are right, Collada uses WGS84 🤦‍♂️

@daguer daguer assigned danduk82 and unassigned danduk82 Apr 29, 2019
@danduk82
Copy link
Contributor

@RobertoMinelli is this still an issue?

@RobertoMinelli
Copy link
Author

Yes, @danduk82. When I assemble a terrain obtained by triangulating 3D points obtained using the Height Service the result is always what is in the first picture. Moreover, If I move uniformly the buildings to touch the terrain, when the building with the lowest Z-coordinate touches the ground, buildings on mountains fly. Do you have any workaround for that?

@danduk82
Copy link
Contributor

danduk82 commented May 15, 2019

@RobertoMinelli, you should convert your colladata altitudes to LN02.

As @procrastinatio told here above, in our data, the Z coordinate is not reprojected on the WGS84 ellipsoid, but for "consistency with the original dataset reasons" we keep the Z coordinates that we get in the original LV95 datasets. Which is in LN02...

@RobertoMinelli
Copy link
Author

Grazie @danduk82. Any hint on how to read and convert Z-coordinates from COLLADA models? As of now I was only converting COLLADA to .stl in order to merge it with the terrain (obtained bu querying your Height Service.

I am just wondering then... why are the altitudes in the swissBUILDINGS3D dataset in WGS84? Because of the format, i.e., COLLADA?

Thank you very much,
Rob

@davidoesch
Copy link
Contributor

davidoesch commented May 15, 2019 via email

@RobertoMinelli
Copy link
Author

Any news on this @danduk82? It would be amazing if there was a way to have a match between the two height models... Moreover, as you can see in the screenshots below, if I manually align one of the buildings to the ground, other buildings are "flying". As of now, my terrains have a resolution of 25 meters (i.e., I query the Height Service every 25 meters in a swipe fashion then I triangulate points to get the surface).

original
Situation right after the import

shift-z
Situation after shifting up all the buildings and aligning the one with lowest z-coordinate to the ground

flying
As you can see, other buildings are flying 😢

I also attach the two .stl models of terrain and buildings.

STL_models.zip

Thanks,
Roberto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants