GeoTools V14 introduces a new command called GT_DWG2KML to convert CAD data to Google KML
GeoTools V14 introduces a new command called GT_DWG2KML to convert CAD data to Google KML files. For those of you new to KML files, here is a short introduction. The KML (Keyhole Markup Language) format is an ASCII (as well as binary [KMZ]) format in which vector data about geographic features on the surface of this earth can be represented. KML is a variant of the XML format and is the native format used by Google Earth and Google Maps to superimpose user-data on its maps. Vector data from CAD and other GIS software can be super-imposed on the satellite imagery in Google Earth providing a meaningful interpretation of the underlying terrain data. You can also attach attributes and terrestrial images (photos) to features which can be displayed on a popup window.
The GT_DWG2KML main dialog
The GT_DWG2KML Data Setting dialog
The GT_DWG2KML tool is available under a new section in GeoTools called Geographic. There are three variants of this tool:
- GT_DWG2KML – fully dialog box driven.
- GT_DWG2KML_BATCHMULTF – Multiple feature class export tool, designed for batch processing.
- GT_DWG2KML_BATCH1F – Single feature class export tool, designed for batch processing.
GT_DWG2KML allows export of points, blocks, lines and polylines into the KML file. Data attached to these objects (either Xdata, AutoCAD Map Object Data or block attributes) can also be exported into the KML file. Such data will be attached to the KML record as an record as well as displayed in a popup window table in Google Earth. You can now use this tool to export all the feature attribute data from CAD into KML and have users view in Google Earth it without the need for a CAD platform. Schema and folder data also can be exported into the KML file.
GT_DWG2KML also allows export of the binary version of the KML file, which has an extension of KMZ. The binary version is useful to embed any attached image data you may have in your CAD data. For example, if you have taken pictures of ground features, geo-tagged and inserted them in your drawing, you can export those pictures into the KMZ file as well. Clicking on the KMZ file will open the file in Google Earth and shown the attached pictures in the same popup box as the attributes. Our clients use this as a verification tool where the field surveyors access the file on a hand-held device running Google Earth to perform field checks, verification and action-taking. To enable embedded images in KMZ, you will need to specify the location of the image as an attached data. The image path must be available as a block attributes, xdata field, object data or as a hyperlinked attachment.
Other extras, GT_DWG2KML also allows export of standard CAD properties like layer, handle and object type into the KML file.
Typical KML files produced by commerical software is more complex and supports multiple feature classes in one KML. For the power user, we have provided a tool called GT_DWG2KML_BATCHMULTF which allows multiple feature export in one operation, defined by schema and folder-based classification. This tool is suitable to be run in batch mode by supplying all the required parameters in a script file.
The KML file can be created with any coordinates but Google Earth will display it only if it contains geographic coordinates (Latitude and Longitude). It is important that you convert your CAD data into geographic coordinates before you run GT_DWG2KML. GeoTools V14 provides another new tool called GT_COORDTRAN for performing coordinate conversions.
The GT_DWG2KML tool has scope for improvement and additional features, but we hope that what we have produced today is already useful to CAD users. The command runs identically in BricsCAD and AutoCAD. We have tried to make the command as open and flexible as possible. The nature of KML files is such that each user may have their own customized requirements. Please do let me know your feedback, wish-lists and we will be gald to continue to extend this command to make it even better during the life-cycle of GeoTools V14.
The Reverse Conversion – KML2DWG
During the life-cycle of GeoTools V14, I intend to complete the tool to do a reverse conversion from KML 2 DWG objects, including full support for attached data imports into Xdata, object data or attributes. This is in early beta now and will be completed as soon as possible.
TrackBack URL for this entry:
Listed below are links to weblogs that reference DWG2KML – Export CAD data to Google KML files (GeoTools V14):