span8
span4
span8
span4
Extrude 2D CAD building outlines to create a simple 3D model.The results can be displayed in Google Earth after writing to KML.This illustrates a typical approach for making a basic 3D city model.The source is Building_outlines.dwg,a CAD dataset of building footprints.First the building height information is merged into the dwg,then this value is used to extrude the footprints into 3D buildings.Finally the buildings are reprojected to the LL84 coordinate system so that they can be written to KML.
Learn how to quickly extrude 2D CAD building outlines to 3D.We'll use AutoCAD DWG data with height information from a CSV table as the source,merge the data,extrude to 3D,then write out to Google Earth KML.
building_outlines.dwg displayed in the Data Inspector
Read in the building outline geometries from the building_outlines.dwg AutoCAD source file with the DWG/DXF reader.Under Parameters,set the ‘Group entities by' selection to‘Attribute Schema'in the reader parameters to expose extended entity data of the dwg file.
Load the outline_heights.csv using a CSV reader for the height attribute information.In the parameters,change the 'Attribute Definition' to'Manual',and change the mean_height attribute 'Type' toreal64.Both data sets share an attribute which stores an identifier for every building.We will use this information to join the height of the buildings with their outlines.
Use a FeatureMerger to join the building outline geometries to the csv table containing heights for each building.To preserve the geometry of the building outlines,the building outlines (DWG) are connected as requesters and the outline heights (CSV) as suppliers.The attribute to join on is a unique identifier of the outlines called‘outline_id'.In the 'Merge Parameters',set Feature Merge Type: to‘Attributes Only',since the DWG outlines will be receiving the mean height attributes from the CSV.The result is a mean height attribute on each footprint feature.If you decide to test your workspace,right click on the output port to connect an inspector to preview the 332 merged features.
Extrusion is defined as the extension of an object by an additional dimension.The 2D outline polygons become 3D solids based on the height values of the building.Extrude the outlines features from the FeatureMerger MERGED output port in theVerticaldirection by a Distance of the attribute,mean_height.
To write data to a KML file,it needs to have a coordinate system.The KML writer will automatically reproject features to LL84 if they are tagged with a coordinate system.If there is no coordinate system set,it is necessary to set it and reproject the data manually.
In our case,we know our source data's coordinate system: UTM83-10.In the CsmapReprojector parameters,set the Source Coordinate System toUTM83-10,the Destination Coordinate System toLL84,and the Transformation to
Note:Alternatively,we could have set the Coordinate Systems of each source dataset in the reader parameters.Then,we wouldn't require the CsmapReprojector since the KML Writer would handle the reprojection.
Add the Google KML writer to your workspace.Specify the file path and name for the output,and make sure that the 'Feature Type Definition' is set to'Copy from Reader'. Connect the output of the Reprojector to it,and run the workspace.Double click on the KML output to view it in Google Earth.
Completed workspace
Output displayed in Google Earth
The data used here originates from open data made available by theCity of Vancouver,British Columbia.It contains information licensed under the Open Government License - Vancouver.
Use input points to place 3D COLLADA models in KML
Convert Autodesk FBX (Filmbox) to KML
Add Appearances to a 3D City Model
Climbing Sydney Harbour Bridge with KMLTourBuilder
Preserving Textures and Georeferencing
Visualize Building Usage in Google Earth
© 2019 亚搏在线Safe Software Inc |Legal