Solved

Texturing a citygml file using a mosaic image with appearance setter.

  • 22 August 2022
  • 1 reply
  • 46 views

Hi everyone,

I need to retexture a citygml file using one (mosaic)image file. But I am facing an issue in the last steps using the Appearance Setter. I started with the WallSurfaces and managed to calculate the (row,column) coordinates of each wall-vertex on the new single image (derived from the previous textured model that used multiple images for one building in the appearance folder). The position of a (sample) wall3D projected on the mosaic-image looks correct, attached a screenshot from QGIS. I rescaled the row column coordinates to a 0,1 scale, with (0,0) representing the lower left corner of the image, and stored them as list-attributes for each wallsurface. I used these lists to set the u,v texture coordinates with the measuresetter transformer as explained in this useful post on texturing citygml :

https://community.safe.com/s/question/0D54Q000080heXzSAI/3dcitydb-texture-coordinates

Afterwards I used the appearance setter, connecting the imagemosaic to the appearance input, the wallsurface with texturecoordinates to the geometry, not changing the standard settings of this transformer. The textures don't come out as expected. I am not familiar with this last transformer and its settings. My question is whether retexturing a citygml file from scratch using this approach is possible ? And whether some setting of the appearancesetter may be the cause of the issue or perhaps the image itself. The imagemosaic is rather large in dimensions : I put the single images next to eachother resulting in a raster with more than 30000 columns, though the mosaicimage is only 14MB in size.

3DTexturedBuilding3Dwall_proj_on_mosaic

icon

Best answer by timdecraeckerav 23 August 2022, 21:31

View original

1 reply

In the end I found the solution to my texture issue. I was writing .shp files to project the wallsurfaces on the uv-texture map. This writer however reversed the orientation of the projected polygons, while the texture coordinates were still in a list in the original order causing a mismatch between the final texture coordinates and the wallsurfaces. Fixing the order of the vertices corrected the orientation issues of the texturing.

Reply