Here’s a brief interlude before I try out dynamic schema mapping! It builds on a previous post about PDF and appearances.
I’ve often heard about future city models bringing together CAD, GIS, BIM and other types of spatial data – this blog post of Dale’s uses the term convergence to explain what I mean – and have seen quite a few examples here at Safe recently. But all these examples were restricted to one type of data (either 3D or raster or vector or a DEM, etc) and I’d not really seen a good example which included a bit of everything.
In particular I’d not seen a model with 3D buildings which had GIS datasets displayed alongside, so I set out to use FME to build my own.
You can find the workspace and output of this example on the Adobe 3D PDF page on fmepedia.
The FME workspace I came up with (below) is composed of remarkably few transformers, which I ascribe to the great improvements we’ve made in handling raster data, DEMs, and 3D surfaces with appearances. So, as much as its about bringing together different types of data, this example also showcases how different parts of FME can come together to create an exciting output.
Before I explain it all in detail, here’s what the output looks like:
You can see (above) how I’ve incorporated GIS/CAD type vector data (roads, rivers and parks) onto a basic image (Raster), draped it over an elevation model (DEM) and incorporated a 3D building model (BIM) to create an integrated view of the area.
The Workspace is quite modular and can be explained as a number of separate parts (click images to enlarge):
Rasterizing vector (GIS and CAD) data and stamping it onto an existing image (Raster)
1) Setting the line and fill colors of the vector features
2) Buffering the line features to give them greater visibility when rasterized
3) Rasterizing the data onto the existing raster image with the VectorOnRasterOverlayer transformer.
Draping the raster data over a terrain model (DEM)
This is probably the most complex part, and I borrowed the core idea from Brittany’s example on fmepedia. And yes, that is “borrowed” as in “the great train borrowing”.
1) Reprojecting the raster into the correct coordinate system, and multiplying the Z value to emphasize changes in elevation
2) Clip the DEM to the extents of the raster to be overlayed. This speeds up subsequent processing.
3) Turn the DEM into a 3D Surface feature
4) Apply the raster image as an appearance (texture) to the DEM surface
Reading a 3D Collada (BIM) model
1) Simply read the data! The Offsetter is used to get it into the right position.
Writing the whole lot to 3D PDF
1) Simply write the data! The building model and the raster get separate layers.
1) In this example the DEM is a raster format of DEM, but it doesn’t need to be. A vector DEM would work equally well.
2) We emphasize the Z value because this is a relatively flat area and doesn’t show as well as I wanted without this level of exaggeration
3) The 3D model isn’t from this area (a prize to anyone who knows what the building is!) so if it doesn’t fit the area/terrain too well, that’s why!
4) You might be asking “Why not write the vector data directly to the PDF?” Well, yes I could have done that, but frankly it didn’t t look too great in the Adobe viewer. As you rotate the display the vector features disappear behind the raster at times. That’s probably because they have the same Z value. I’m sure it’s solvable, by fiddling the vector Z values, but it was easier to stamp it directly onto the raster itself. Then draping all takes place at the same time.
5) Yes, the vector area features are solid colour and would be better semi-transparent. I’ve requested that ability be added to the overlayer transformer as I think it would improve the display quite a lot.
So, there it is. I hope the one thing you’ll take from this example is FME’s ease of use. In this case the hardest part was finding suitable data! And although I’ve written this to PDF I’m sure there are other formats which could also handle this type of output.
Also, because this workspace runs in just over one minute it’s exactly the sort of thing you could envisage being made available to an end-user via FME Server. The user chooses which data they want, and it is all merged into a suitable output format for them.
Mark IrelandMark, aka iMark, is the FME Evangelist (est. 2004) and has a passion for FME Training. He likes being able to help people understand and use technology in new and interesting ways. One of his other passions is football (aka. Soccer). He likes both technology and soccer so much that he wrote an article about the two together! Who would’ve thought? (Answer: iMark)