Closed shazidhasan closed 2 months ago
Hi @shazidhasan, we unfortunately don't have code example for the texture-atlas-creator API. However, a short documentation (see the link below) is available, which explains the main concept and CLI usage of the tool. I hope it could help you in using this tool. https://github.com/3dcitydb/texture-atlas-creator/blob/master/resources/doc/TextureAtlasCreator-Documentation.pdf
Thanks a lot.
Hi @yaozhihang,
I am a newbie to java.
I have managed to build the jar file using gradle in VSCode. When I tried to use it (as described in the documentation), it says "no main manifest attribute, in tac.jar". Later I have included "TextureAtlasCreator.java" file as the main class attribute in the build.gradle file. Now it says "Main method not found in class org.citydb.textureAtlas.TextureAtlasCreator"
I have searched for the main method in each file in the source but not found. TextureAtlasCreator class has a constructor but it is taking algorithm name, width, height as input but not taking the input/output folder name as in the CLI usages described in the documentation.
I am confused whether I am missing something. Any help will be highly appreciable.
Hi @shazidhasan, It seems that the CLI support has been removed from current version of the tool, and the documentation was not updated accordingly. I'm sorry for this unintuitive situation.
I found a code snippet about the use of the API (sorry again for the poor docs about the method) https://github.com/3dcitydb/importer-exporter/blob/master/impexp-kml-collada-plugin/src/main/java/org/citydb/modules/kml/database/KmlGenericObject.java#L1172
Hello @yaozhihang, I am also looking to use this tool. I went through document, created executable jar and tried to run in cmd as per document. I am getting same issue as @shazidhasan. Can you help me how to use this tool directly without creating another java application and using this tool as API in the application? I mean, I want to use this tool directly. Do I need to create my own Main class to run this API or is there any other way to use it directly? Please help me.
Thank you.
Hi @basant256,I would like to suggest that you create your own CLI interface and main class to use the texture atlas APIs.
Thank you so much @yaozhihang, I am really pleased for your quick reply. I would like to know, can I create CLI interface and main class using maven or need to create in gradle?
Both maven and gradle can be used. They are just build automation tools. To create CLI interface you need a good CLI java library like args4j, Picocli etc. You can find tons of docs and tutorials in the Internet.
@yaozhihang Thank you so much for your guidance.
@yaozhihang , I am not able to find below path https://github.com/3dcitydb/importer-exporter/blob/master/impexp-kml-collada-plugin/src/main/java/org/citydb/modules/kml/database/KmlGenericObject.java#L1172, please let me know at which path, it has been moved.
Thank you.
That one is outdated. Here ist the new path https://github.com/3dcitydb/importer-exporter/blob/master/impexp-vis-plugin/src/main/java/org/citydb/vis/database/AbstractVisObject.java#L1130
@yaozhihang Thank you so much for your quick response.
I have one doubt about using texture-atlas-creator.
You may need to use citygml4j library for reading CityGML files. See the following link https://github.com/citygml4j/citygml4j Via the link below you can find some code examples: https://github.com/citygml4j/citygml4j/tree/master/citygml4j-samples/src/main/java/reading_citygml
@Yaozhihang, Thank you so much for your quick replies. I hope, I would be able to use successfully Texture-Atlas-Creator library.
@yaozhihang Thank you so much for your all helps. I want to pass folder (that is having gml file and images) from system, how can texture-atlas-creator tool read surface_id (seems surface id is mandatory)?
Hi @yaozhihang, I hope you are doing well, Since I have implemented cli interface and able to read files. Now, I am having confusion after passing all the required inputs (Algorithm, maxWidth, maxHeight, input(gml/images) path, output path) from command line as per documentation which method of TextureAtlasCreator.java file will take all inputs. Please help me to know the method that I have to call in my main class to pass all inputs and create TextureAtlas.
@basant256 sorry, i don't know how to help you further, since all the java source code and examples are avaliable there...
Dear
I am very enthusiastic about this tool. I couldn't find any sample example of this tool usages. It would be highly helpful to have a sample code. I am able to make the jar file but struggling to use this API
thanks