Appearances can be Deceiving
April 6th, 2010
This is a brief post on ‘appearances’.
In FME terms, appearances are the symbology of 3D features; textures, colours, scaling, etc
Workbench has a number of transformers to manage appearances:
I wanted to mention these because - this being new technology - it took me a while to figure out how they work, and I assume that users would have similar problems. Also this is a good time to get user feedback as we finalize updates to these transformers for 2011.
General
In general the process for creating appearances is this:
- Create an appearance with the AppearanceStyler
- Add the appearance to features with the AppearanceAdder
It helps to think of an appearance as a feature in its own right. You create that appearance feature then merge it onto any number of 3D surface features. You don’t - as I thought - add an appearance then alter its style.
AppearanceStyler
How you create an appearance depends on whether you want to apply an image or just a plain colour.
To apply an image as an appearance/texture you read that image using a raster Reader (of whatever format) and route it into the AppearanceStyler. Parameters let you define various options for the pattern of that image.
To apply a simple colour as an appearance you need a single null geometry feature. You can create one simply enough using a Creator transformer. Feed this into the AppearanceStyler and set the Diffuse Color parameter to define what colour to use.
Any other input to the AppearanceStyler will be ignored!
AppearanceAdder
So the output from the AppearanceStyler is a feature carrying appearance info (in essence an ‘appearance feature’). This can be routed into the FRONT and/or BACK input ports on the AppearanceAdder transformer.
Then any feature entering the SURFACE input port gets the incoming appearance applied to it.
Example
Let’s take the surface features created in a previous post’s example, and try to give them an appearance.
Here (below) is where we need to set the surface colour - just before the completed feature is sent back to the workspace.
Now (below) I create an appearance and set diffuse color in the AppearanceStyler parameters to set the color of the output surface.
If I want to use an image instead - say overlay a raster map backdrop - then it becomes slightly more complicated. I have to read the raster outside the custom transformer, feed it in, and then clip it to the extents of the surface (below). Also, the AppearanceAdder ‘Mapping Type’ parameter needs to be ‘From Top View’.
But it does give rather a good visualization in the output PDF (below)
Now I can see where (or where not) there are clusters of heritage buildings in Vancouver.
One Step Beyond
One follow-up to the ClusterModeller transformer was a tweet from Lassi Tani in Finland:
“@FMEEvangelist That looks cool! Could you have colors also?
Like, the color changes depending on the height.”
Well Lassi, yes, although the solution is a bit more hard coded than I’d like. Here’s what that would look like (below):
The first SurfaceModeller now only creates contours, and I turn these into area features and give them an ID. Now a second SurfaceModeller creates surfaces, but with a group-by ID. That way I get separate surfaces for each contour level.
The colouring is complicated. I have to create an appearance for each surface level, and give it a colour. This is where the hard coding comes in. Now I match the appearance to the appropriate surface. The result is this (below):
If anyone would like the workspace - or just more info on 3D and appearances - then just email using the address below. And if you’ve already used these transformers, please let me know how you think they might be improved.
Entry Filed under: 3D, Data Transformation, FME Desktop, GIS, Miscellaneous









Trackback this post