Hi @milovanovstevan,
I took a look at your workflow and data and you are right - there seems to be a problem with the TIN output. While the textures are created in a folder they are not reference in the CityGML file...This looks like a bug. Perhaps @DaveAtSafe can confirm?
As for getting the appearances on the roofs, you will need to convert the roofs into surface geometries before using the Appearence Setter. I would suggest using the roof polygons (before they are surfaces) to clip the Geotiff - one for each roof surface.
You will need to use the Group-By in the Appearance Setter - You can create an id for each surface/polygone and pass this id to the clipped geotiff as part of the clipping process.
If done correctly you should have some nice looking roofs.
Good luck
Hi @milovanovstevan,
In CityGML, textures can only be applied to gml:AbstractSurfaceType or gml:MultiSurface geometry objects, or descendants. The TINRelief object is a descendant of gml:AbstractReliefComponentType instead, and so cannot have a texture. You may wish to convert the TINSurface from a mesh to a composite surface using the GeometryCoercer, then write to CityGML as LandUse or Vegetation instead.
In order to texture the roofs, you can use a feature in the latest version of the AppearanceSetter. If you connect the mosaicked orthophoto to the Appearance port, and set Texture Coordinate Generation Parameters - Texture Mapping Type to Top Down Georeferenced, the orthophoto will be used to texture the roofs with properly aligned imagery.
For more information on the 3D texture capabilities, please see our 3D webinar, at https://www.safe.com/webinars/3d-fme/
Hi @milovanovstevan,
In CityGML, textures can only be applied to gml:AbstractSurfaceType or gml:MultiSurface geometry objects, or descendants. The TINRelief object is a descendant of gml:AbstractReliefComponentType instead, and so cannot have a texture. You may wish to convert the TINSurface from a mesh to a composite surface using the GeometryCoercer, then write to CityGML as LandUse or Vegetation instead.
In order to texture the roofs, you can use a feature in the latest version of the AppearanceSetter. If you connect the mosaicked orthophoto to the Appearance port, and set Texture Coordinate Generation Parameters - Texture Mapping Type to Top Down Georeferenced, the orthophoto will be used to texture the roofs with properly aligned imagery.
For more information on the 3D texture capabilities, please see our 3D webinar, at https://www.safe.com/webinars/3d-fme/
Ah yes, @milovanovstevan, you will need to upgrade your Appearance Setter to the new version to access the new 'Top Down Georeferenced' function.
As for the TINRelief not supporting textures, that isn't quite right - The image/texture can be linked to the gml:TriangulatedSurface (as opposed to the gml:triagle).
The texture coordiantes are then linked to the gml:LinearRing as per usual. Example attached here (fake data so it looks weird, and it links to an image which was to big to upload here) - but it works.
TIN_withTexture.zip
Ah yes, @milovanovstevan, you will need to upgrade your Appearance Setter to the new version to access the new 'Top Down Georeferenced' function.
As for the TINRelief not supporting textures, that isn't quite right - The image/texture can be linked to the gml:TriangulatedSurface (as opposed to the gml:triagle).
The texture coordiantes are then linked to the gml:LinearRing as per usual. Example attached here (fake data so it looks weird, and it links to an image which was to big to upload here) - but it works.
TIN_withTexture.zip
One thing I forgot to add is that a textured TIN is not supported in the 3D-City-Database. So even if you do manage to get it textured then it will not import.
What is needed if you want to have a textured terrain is to use a GeoreferenceTexture - you can read about it here:
https://portal.opengeospatial.org/files/?artifact_id=47842
check out page 57 of the pdf.
I'm not actually sure about how you'd create this with FME. I haven't personally tested it yet.
but this GeoreferencedTexture is supported by the 3DCityDB.
Hi @milovanovstevan,
I apologize for giving you the wrong information. Matt is correct, and FME 2019 agrees with him. If you download and install the FME 2019.0 beta from https://www.safe.com/support/support-resources/fme-downloads/beta/, you can write textures to the TINRelief correctly.
I am attaching a modified workspace that will texture both the roofs and the TIN for you.
m_final.fmw
Hi @milovanovstevan,
I apologize for giving you the wrong information. Matt is correct, and FME 2019 agrees with him. If you download and install the FME 2019.0 beta from https://www.safe.com/support/support-resources/fme-downloads/beta/, you can write textures to the TINRelief correctly.
I am attaching a modified workspace that will texture both the roofs and the TIN for you.
m_final.fmw
@DaveAtSafe,@virtualcitymatt
First of all thank you for all your effort so far, i really appreciate that. I have managed to make following progress:
I made rooftops with textures from TIFF image and I can see that when i open the data (i did this on 4 buildings just for the test). However, the problem that I encountered is in this: 3DcityDB Importer/Exporter exports the data into .gltf in next structure: each exported building is exported in a separate folder in a gltf format, with addition of original TIFF used in the beginning (to sum it up i have over 1000 subfolders that have same TIFF alongside the real model of the exact building). This creates next issue, the whole file is just too big to be used - over 50GB for about 1k buildings. (Structure of the data is in the added picture.I tried to use .ecw but will go back to tiff, it's the same issue)
Is there any way to avoid same file copying into each subfolder, instead use just the part that's needed for the particular roof?