Coder Social home page Coder Social logo

tum-gis / citygml2objv2 Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 2.0 7.35 MB

Command line converter of CityGML (.gml) to OBJ (.obj) files, while maintaining the semantics

License: MIT License

Python 100.00%
citygml citygml-parsing obj citygml2obj semantic-3d-city-models

citygml2objv2's People

Contributors

oloocki avatar thomasfroech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

citygml2objv2's Issues

glob() finds gml-files twice

On my Windows machine with Python 3.10 I found that gml-files of the input directory are processed twice since the glob() function does not appear to be case in-sensitive and identifies identical gml-files twice when checking first on "*.gml" and then on "*.GML":

types = ('*.gml', '*.GML', '*.xml', '*.XML')
files_found = []
for files in types:
files_found.extend(glob.glob(files))

CityDoctor link in Readme returns 404

The link to CityDoctor in the Readme file returns a 404. Perhaps it should point to https://transfer.hft-stuttgart.de/gitlab/citydoctor/citydoctor2--might do a PR on it later.

OSError: Error reading file

Hi,
First I want to thank you for keeping up the development of this tool!

I have the folowing Setup:

Windows 10

(env) PS D:\XXX\XXX\citygml2obj-2.0> python --version
Python 3.10.0
(env) PS D:\XXX\XXX\citygml2obj-2.0> pip list
Package         Version
--------------- --------
contourpy       1.0.7
cycler          0.11.0
fonttools       4.39.4
kiwisolver      1.4.4
lxml            4.9.2
matplotlib      3.7.1
numpy           1.24.3
packaging       23.1
Pillow          9.5.0
pip             23.1.2
PyDecimal       1.0
pyparsing       3.0.9
python-dateutil 2.8.2
setuptools      67.7.2
shapely         2.0.1
six             1.16.0
triangle        20220202
wheel           0.40.0

I basically installed all packages that are listed in the requirements and used python 3.10.0. For "Decimal" I have used "PyDecimal" which should be fine.

I am trying to convert the following file:

https://geoportal.bayern.de/bayernatlas/?lang=de&topic=ba&bgLayer=atkis&catalogNodes=11&layers=WMS%7C%7COpendata_Auswahl_LoD2%7C%7Chttps:%2F%2Fgeoservices.bayern.de%2Fwms%2Fv1%2Fopendatagrid%7C%7Clod2%7C%7C1.1.1&E=689460.10&N=5337199.11&zoom=14

https://download1.bayernwolke.de/a/lod2/citygml/688_5336.gml

I am experiencing the following issue:

(env) PS D:\XXX\XXX\citygml2obj-2.0> python .\CityGML2OBJs.py -i .\conv_files -o .\result_files
CityGML2OBJ. Searching for CityGML files...
Traceback (most recent call last):
  File "D:\XXX\XXX\citygml2obj-2.0\CityGML2OBJs.py", line 357, in <module>
    CITYGML = etree.parse(FULLPATH)
  File "src\lxml\etree.pyx", line 3541, in lxml.etree.parse
  File "src\lxml\parser.pxi", line 1879, in lxml.etree._parseDocument
  File "src\lxml\parser.pxi", line 1905, in lxml.etree._parseDocumentFromURL
  File "src\lxml\parser.pxi", line 1808, in lxml.etree._parseDocFromFile
  File "src\lxml\parser.pxi", line 1180, in lxml.etree._BaseParser._parseDocFromFile
  File "src\lxml\parser.pxi", line 618, in lxml.etree._ParserContext._handleParseResultDoc
  File "src\lxml\parser.pxi", line 728, in lxml.etree._handleParseResult
  File "src\lxml\parser.pxi", line 655, in lxml.etree._raiseParseError
OSError: Error reading file '.\conv_files\688_5336.gml': failed to load external entity "./conv_files/688_5336.gml"

I have tried the following to resolve it:

added -v 1 and -p 1 flags

(env) PS D:\XXX\XXX\citygml2obj-2.0> python .\CityGML2OBJs.py -i .\conv_files -o .\result_files -v 1 -p 1
CityGML2OBJ. Searching for CityGML files...
Traceback (most recent call last):
  File "D:\XXX\XXXcitygml2obj-2.0\CityGML2OBJs.py", line 357, in <module>
    CITYGML = etree.parse(FULLPATH)
  File "src\lxml\etree.pyx", line 3541, in lxml.etree.parse
  File "src\lxml\parser.pxi", line 1879, in lxml.etree._parseDocument
  File "src\lxml\parser.pxi", line 1905, in lxml.etree._parseDocumentFromURL
  File "src\lxml\parser.pxi", line 1808, in lxml.etree._parseDocFromFile
  File "src\lxml\parser.pxi", line 1180, in lxml.etree._BaseParser._parseDocFromFile
  File "src\lxml\parser.pxi", line 618, in lxml.etree._ParserContext._handleParseResultDoc
  File "src\lxml\parser.pxi", line 728, in lxml.etree._handleParseResult
  File "src\lxml\parser.pxi", line 655, in lxml.etree._raiseParseError
OSError: Error reading file '.\conv_files\688_5336.gml': failed to load external entity "./conv_files/688_5336.gml"

checked with CityDoctor 2.2.1

The tool didn't show anything in the GUI but gave this error in the console:

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Unknown Source)
        at java.lang.String.<init>(Unknown Source)
        at de.hft.stuttgart.citydoctor.gui.validation.d.f(Unknown Source)
        at de.hft.stuttgart.citydoctor.gui.validation.j.actionPerformed(Unknown Source)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)

I hope I have added all necessary information.

Geometric Distortions

When using the triangulation, we observe strong geometric distortions for some data sets. This is particularly the case with official LOD2 datasets. These distortions can usually be avoided by skipping the triangulation.
The following graphic gives an example of these distortions
Error_Picture



Experiments have shown that a translation of the CityGML data set can lead to an improvement of the results. However this is not the case for all data sets with this issue.
An examination of the CityGML data sets has shown that the error occurs with data sets in which the coordinates only have 2-3 decimal places.

Any plans to extend it to CityGML v.3?

Hello,

First to all, thank you all for your excellent and useful work.

I am unaware of the proper GitHub etiquette regarding these questions, but without wanting to sound demanding or ungrateful, are there any plans to include/develop exporting to the new CityGML 3.0 standard? I've tried using this program to export a few 3.0 gmls but the following error is raised:

There is a problem with this file: no cityObjects have been found. Please check if the file complies to CityGML.

While this is understandable--it is clearly specified in the repo documentation--perhaps it would be useful to develop this capability.

I've seen that some projects enable exporting to CityJSON, but there is an argument to be made for the necessity to export to obj file directly.

In any case, thanks for your good work, and if help is needed on this feature I'd be happy to collaborate!

Readme: pdf link to paper not working

Hello, just wanted to give you a thumbs up for such a great work while pointing out a very minor thing; apparently the link to the paper in pdf format in the Credits section (http://filipbiljecki.com/publications/Biljecki2015vk.pdf) is not working. At a quick glance it seems it should point to another path in the author's website (https://filipbiljecki.com/publications/2015_udmv_citygml_obj.pdf)--might do a PR late to fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.