Export KML toolbox utility does not bring Civil 3D points into Google Earth
Last updated: 2020-10-26
Issue
There may be situations where the Autodesk Export KML utility does not produce a file that can be imported by Google Earth Pro. The following error may appear.
The error occurs when a description table, of what appears to be attribute information, is added to the kml file. There are certain attributes within the kml description table that Civil 3D does not define correctly in the kml file.
Proposed workarounds include:
- Option 1: Use Notepad++ to remove corrupt description tables from kml file
- Option 2: Export point file using Civil 3D Point Report
-
Option 3: Export shapefile using Civil 3D 202X SHP Import/Export utility
Option 1 | Option 2 | Option 3 | |
---|---|---|---|
Civil 3D Version | 2016, 2018, 202X | 2016, 2018, 202X | 202X |
Civil 3D objects | All (also AutoCAD elements) | COGO Points | COGO Points, Feature Lines |
Additional Software Needed | Notepad++ (or equivalent) | No | No |
Available Customization | shortcuts.xml (Notepad++) | No | No |
Available WisDOT Google style template | No | No | WisDOTC3DPtsList.kst |
Access point attribute data | No | Yes | Yes |
Display point number | Yes | Yes | Yes |
Display point description | Yes | Only by selecting point | Only by selecting point |
Point appears in Google Street View | Yes | No | No |
Warning: Do not use data in Google Earth Pro for survey control or stakeout. This information is only used for visualizing project data.
Option 1: Use Notepad++ to remove corrupt description tables from kml file
There are some attributes being passed to the KML that are not defined or recognized. The coordinate data and point descriptions exported correctly. An alternative solution is to remove the bad description tables in the KML file that cause the “not well formed” error.
A program like Notepad++ that recognizes the coding format is needed to update the file. Using Notepad does not work.
NOTE: When exporting kml information, only select Export text and Export object information when specifying which drawing objects to export.
NOTE: This workflow only works with kml files and not kmz files. Export to the kml file format when using the Civil 3D Export KML utility.
Notepad++
- File > Open
- Select the xml file exported from Civil 3D
- Open
- Search > Replace...
- Find tab: < description>[\s\S]*?<\/description > (no spaces)
-
Replace tab: < description >< /description > (no spaces)
-
File > Save
A Notepad++ macro has been created to automate the process. It is included in the file linked below.
The xml file provided will replace the existing shortcuts.xml. If there are other custom macros already created, the xml code for “Clean KML” can be copied and pasted into the original shortcuts.xml.
Place file here: C:\Users\DOTS3P\AppData\Roaming\Notepad++\shortcuts.xml
To run the macro in Notepad++: Macro tab > CleanKML
Info: NotePad++ will saves the previous entries in the Find and Replace fields.
Google Earth Pro
- File > Open
- Open updated kml file
- Temporary Places > Name of kml > Model
- Double-click on point to zoom to area of interest
- Data may be saved to My Places so it is accessible during the next session of using Google Earth
- Right mouse-click and drag the imported folder or point under Temporary Places to My Places
Option 2: Export point file using Civil 3D Point Report
Civil 3D
-
Assign Coordinate System
-
App menu > Drawing Utilities > Drawing Settings > Units and Zones tab > Zone
- Categories: WisDOT
- Available coordinate systems: Appropriate county system in US Feet
-
- Toolspace palette > Toolbox tab > Miscellaneous Utilities > Reports > Point > Points Report (COGO Point Report) > Right-mouse click > Execute
- Point Selection tab
- Select Point Group or Points from Drawing
- Selected Points: click the List Points button to show selected points
- Report Settings: select point properties to include and arrange them in the desired order
- Latitude and Longitude need to be selected in order to import points into Google Earth Pro
- Save report to: browse to the desired location and save as a *.txt file
Create Report
- Point Selection tab
- The report opens in Microsoft Notepad
- Delete the report title, client information, address information.
- Delete any blank rows at the beginning or end of the file.
- The first row will then be the column headings for the point data followed by the rows of point data
- File > SaveAs
- Browse to desired location and enter file name
- Save file as Text Document (*.txt)
- Encoding: UTF-8
- Save
- Close the *.txt file
- COGO Point Report dialog box > Done
Google Earth Pro
-
File > Import > select *.txt file
- Open
- Data Import Wizard
- Specify Delimiter
- Field Type: Delimited
- Delimited: Tab
- Supported encodings: UTF-8
- Point data appears in preview pane
- Next
- Select Latitude/Longitude Fields
- Latitude field: Latitude
- Longitude field: Longitude
- Next
- Specify Field Types
- Accept default field types
- Finish
- Do you want to apply a style template to the features you ingested? Yes
- Create new template: select
- Name tab > Set name field: Point_Number
- OK
- Save
- Specify Delimiter
-
Imported data appears under Temporary Places.
-
Data may be saved to My Places so it is accessible during the next session of using Google Earth
- Right mouse-click and drag the imported folder or point under Temporary Places to My Places
Option 3: Export shapefile using Civil 3D 202X SHP Import/Export utility
Civil 3D 202X
The SHP Import/Export Utilities are available in Civil 3D 2020 and later.
-
Assign Coordinate System
-
App menu > Drawing Utilities > Drawing Settings > Units and Zones tab > Zone
- Categories: WisDOT
- Available coordinate systems: Appropriate county system in US Feet
-
-
Toolspace palette > Toolbox tab > SHP Import/Export Utilities > SHP Import/Export > Export Cogo Points to SHP > Right-mouse click > Execute
-
EXPORTSHPCOGOPOINTSURVEYDATA Select Points to export:Select points
-
EXPORTSHPCOGOPOINTSURVEYDATA Select Points to export:Enter
-
EXPORTSHPCOGOPOINTSURVEYDATA
- Enter file name and path of .shp file
-
Select attribute data that will be exported with points
- Expand and select attribute data to customize output
- OK
Windows explorer
- Open Windows explorer
- Copy/paste the following string into the address bar: %userprofile%\AppData\LocalLow\Google\GoogleEarth\My Style Templates
- Copy WisDOTC3DPtsList.kst to %userprofile%\AppData\LocalLow\Google\GoogleEarth\My Style Templates
Google Earth Pro
- File > Import
- Switch file format in dropdown to ESRI Shape (*.shp)
- Select and open shapefile exported from Civil 3D
- Do you want to apply a style template to the features you ingested? Yes
- Using a style template allows the user to specify which data field is used to label the points in Google Earth.
- Select Use existing template
- Select the WisDOTC3DPtsList
- Using the WisDOTC3DPtsList allows the user to categorize the imported points by type
- C:\Users\DOTXXX\AppData\LocalLow\Google\GoogleEarth\My Style Templates\WisDOTC3DPtsList.kst
- A new template can be created instead to customize output
- Select the WisDOTC3DPtsList
-
Data appears under Temporary Places
- Data may be saved to My Places so it is accessible during the next session of using Google Earth
- Right mouse-click and drag the imported folder or point under Temporary Places to My Places