Closed choiyoonho2 closed 4 years ago
Do you intend to use the CLI of the Importer/Exporter and call it as external process from your Spring app? Or do you want to directly use the classes of the Importer/Exporter in your code?
I want to use it in a Java class. But if it is not possible, the CLI is fine. I want to change the data after loading Citygml and insert it into 3dcityDB.
I am trying to use citygml4j 2.6.1. I added the dependency to pom.xml and then executed the SimpleReader.java code. However, an error occurs when creating CityGMLBuilder. Error message is javax.xml.bind.JAXBException: "net.opengis.citygml._2" does not contain ObjectFactory.class or jaxb.index. What's the problem?
Maybe this helps: https://github.com/citygml4j/citygml4j/issues/13
I have not forgotten your original question, and will get back soon
Thank you. I will wait for your answer.
Apologies for leaving this unanswered for such a long time. Were you able to solve the javax.xml.bind.JAXBException
from citygml4j using another ClassLoader
?
Well, if you want to directly use the classes of the Importer/Exporter in your Spring project (instead of starting the Importer/Exporter from you program as external process using its command-line interface), then for version 3.x of the software my recommendation is to install the Importer/Exporter locally and afterwards to put all JARs from the lib
folder within the installation directory onto your classpath.
We just released version 4.0 of the Importer/Exporter. With this release, we split the source code into modules which are now available as Maven artifacts from Bintray. So now you can include the modules you need using your pom.xml
.
For example, for importing and exporting CityGML datasets, you need the impexp-core
module:
<dependency>
<groupId>org.citydb</groupId>
<artifactId>impexp-core</artifactId>
<version>4.0.0</version>
<type>pom</type>
</dependency>
This will also import all dependent JARs. The only exceptions are the Oracle JARs due to Oracle license restrictions - so you still have to copy them manually if you need them (or use the Oracle Maven repo instead).
So the JARs part is quite easy now. But we currently do not have a documentation on how to use the Importer/Exporter classes (you would have to inspect the source code for this). The software was originally not designed to be used as a library (intended uses are via its GUI or CLI).
But this is something we want to change. Publishing the code as Maven artifact was just the first step. We now start working on simplifying the use of the classes, so that you could import/export a CityGML dataset with a few lines of code. But well, this work just starts now.
Hope this helps anyway...
Closing this issue. Feel free to re-open.
Hi. I would like to create a function that parses the citygml file and puts it into 3dcityDB in the Spring project. What jar files are needed? Is there a document I can refer to?