-
Notifications
You must be signed in to change notification settings - Fork 56
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
Incorrect height in kml #232
Comments
Is the EPSG code you entered the same as the SRID given in the CityGML file (in the |
I used the NYC CityGML model in this link: https://www1.nyc.gov/site/doitt/initiatives/3d-building.page I tried to enter 'urn:ogc:def:crs,crs:EPSG::2263' for srsname and the results looks like the image above. How should I find the correct srsname 🤔? |
Hi @kam1107, use When you choose COLLADA as output format, there are still issues with the size of the buildings. The reason is that the original data uses US survey foot while the COLLADA export expects meters. @Son-HNguyen, this might be a bug that needs to be fixed. |
Hi @clausnagel, thanks for your tips! I did as you suggested: |
The steps seem to be ok. You only need to uncheck the Can you please share your CityGML dataset just to be sure that we are using the same input data? And maybe also your exported KML? If it's not the Importer/Exporter, maybe the database makes the difference? What PostGIS version are you using? @Son-HNguyen, have you also tried to export the model? Do you face the same issues or does it work for you? |
Using the bounding box and settings provided by @kam1107, this is what I could reproduce: We might indeed need to have a look at your dataset and the database info as @clausnagel said. |
Here's the link to the gml&kml file: https://drive.google.com/file/d/144pURsnqKfKjgenHrNKfOvForpCOGt5i/view?usp=sharing |
Thanks for sharing the data and the database info. I ran my tests on PostGIS 2.3.3. With PostGIS 3.1.2, I can actually reproduce your issue. For the KML geometry export, we internally transform the data to WGS84 (EPSG:4326). While PostGIS 2.3.3 adapts the height values in this transformation, PostGIS 3.1.2 does not change the heights. Here is the SQL I used for testing: select st_astext(st_transform(envelope, 4326))
from cityobject
where gmlid= 'gml_ZAWOQ5RHROA5Y2UDFRWNZV2E8QOZQ43HKINV' For PostGIS 2.3.3, the result is:
However, PostGIS 3.1.2 returns:
So, PostGIS 2.3.3 returns a height value of PostGIS bug? I don't know... |
Okay..... I also noticed there is an `affine transformation' configuration in Preferences/Import/Geometry. Does that affect the imported geometry? Actually, I tried to modify this matrix but the exported kml remains the same. |
Yes, affine transformation works. Tested with the following matrix: Alternatively, you can also use update surface_geometry
set geometry=st_scale(geometry, 1.0, 1.0, 0.3048)
where geometry is not null; update cityobject
set envelope=st_scale(envelope, 1.0, 1.0, 0.3048)
where envelope is not null; |
Yes! that works for me as well! Many thanks! |
Hi,
I am trying to convert NYC citygml model to kml format and load into google earth. However, the height of buildings are not correct.
I use EPSG=2263 but not sure how to set gml:srsName. Could you please offer some help?
Many thanks!
The text was updated successfully, but these errors were encountered: