0% found this document useful (0 votes)
20 views

Export To KML Documentation

Uploaded by

arlandi.iscamen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Export To KML Documentation

Uploaded by

arlandi.iscamen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Export to KML Extension Version 2.

3
documentation

description

Export to KML is an extension developed for ArcGIS 9.x by the City of Portland, Bureau of
Planning. The extension allows ArcGIS users to export any point, line, or polygon dataset in
“keyhole markup language” [KML] format for viewing in the free Google Earth data viewer.

For more information on KML, please refer to http://earth.google.com/kml/.

One note: This is a free product and is not intended to replace the commercial KML tools
available for ArcGIS. While I will continue to maintain and improve the extension’s functionality,
there are limits to what I am able to do without a substantial investment of time and resources.
If you need more sophistication than this tool offers, I encourage you to check out one of the
commercial products.

install/uninstall

Make sure you have the latest version of Google Earth installed (Google Earth can be
downloaded from http://earth.google.com/).

Open the ‘Export_to_KML_{version number}.zip’ archive and specify a location for the files to
be extracted. Note that an ‘Export_to_KML’ folder will be created in the specified location. If
you are upgrading from an earlier version of 'Export to KML', extract the files from the
downloaded zip file containing the new version into the same directory as the old version (and
allow the old directory and files to be overwritten).

Double-click the batch file ‘ExporttoKML_INSTALL.bat’ to register exporttokml.dll and to add the
appropriate registry keys. Open ArcMap, then browse to Tools − Extensions and click on the
checkbox next to the “Export to KML” extension. Then browse to View − Toolbars and click the
“Export to KML” toolbar to make it visible.

To remove the extension, double-click the batch file ‘ExporttoKML_UNINSTALL.bat’. If you want
to be absolutely sure the extension was completely uninstalled, check to make sure all
component categories were removed using "Categories.exe" in C:\Program Files\ArcGIS\Bin.
Just manually remove any of the following entries that remain:

› prjExporttoKML.clsCustomGXFilter from 'ESRI GX Object Filters'


› prjExporttoKML.clsExporttoKML from 'ESRI Mx Commands'

1 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

› prjExporttoKML.clsExporttoKMLExtension from 'ESRI Mx Extensions'


› prjExporttoKML.clsExportToKMLToolbar from 'ESRI Mx CommandBars'

what’s new in version 2.3

› graduated marker symbols are now supported


› multi-part features are now supported; multi-part features are labeled individually
› the feature name can now be explicitly defined as one of the layer attributes (in “Labeling
and description options”); features in the output KML are sorted on this attribute
› there is now an option to include point labels as either part of the feature or as a separate
label layer
› fixed issue with commas in European operating systems
› bunch of other bug fixes, minor tweaks and improvements

what was new in version 2.2

› labels are now independent of symbology and grouping; point, line, and polygon labels can
be turned on and off via a single “Feature Labels” layer
› “information points” can be added for line and polygon features; these points can be
selected in Google Earth to display information contained in the feature description; points
can be turned on and off via a single “Information Points” layer

what was new in version 2.1

› ability to incorporate ArcMap layer symbology into the output KML


› ability to export only selected features
› you can now label line and polygon features
› improved options for describing individual features, using attribute values, HTML tags, and
hyperlinks
› separate 3D height/extrusion options
› download now includes all source code

2 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

main form controls

select layer to export

Select the point, polyline, or polygon dataset containing the features you want to export to
KML format. The layer can be in any ArcGIS format – shapefile, coverage, or GDB. The layer
must have a defined spatial reference (it will be reprojected into WGS 84 geographic
coordinates if necessary). By default, only the selected features will be exported (see
options form controls).

group and color features using the layer’s symbology

If checked, the ArcMap layer symbology is used by the output KML. Symbology can be
“single symbol”, “unique values”, “graduated colors” or “graduated symbols” (multiple
unique value fields and class normalization are not currently supported, and the symbol field
cannot be in a “joined” table.) If using a unique value or graduated symbology, the output
KML will be “grouped” by the symbol attribute. Each symbol category will have its own
folder, name, and symbology. For example, a building polygon dataset could be grouped on
an attribute identifying the building use (residential, commercial, etc.). Note that because
Google Earth does not currently support hatching and other complex symbology, only the
colors and line widths of symbols are used by the output KML.

select an attribute for labeling features (optional)

An attribute in the GIS layer that will be used to create feature labels in the output KML. If
features are being labeled, this is also the field that will be used to name the individual the
features in Google Earth.

select an attribute that represents the height (optional)

Specifies an attribute to use for setting each feature’s vertical height. The height of true 3D
features, such as 3D shapefiles, can be set using their z-value. Height attributes must be
numeric.

3 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

height attribute units (optional – only enabled if an height attribute is selected)

The linear units of the height attributes, either feet or meters. This ensures that the height
or elevation values are in the correct format for Google Earth, which uses meters.

extrude features based on the height (optional – only enabled if an height attribute
is selected)

Extrudes features based on their height. All feature types can be extruded in Google Earth –
points, polylines, and polygons. By default, features are extruded using the KML altitude
mode “relative to ground”, meaning the extrusion value is added to the feature’s surface
elevation if terrain is being used, or added to 0 if no terrain is being used (the altitude mode
can be changed on the “options” form). For example, a building polygon dataset could be
extruded using a field that contains the height the building. The output KML will extrude
each building from the ground to its specified height, making them appear 3-dimensional
when the view is tilted.

name and location of the output KML

Shows the file name and directory location of the KML file that will be created by the export.
The user must browse to the desired directory using the “browse” button, and specify a file
name (the .kml extension will be added automatically). Existing KML files can be
overwritten.

options form controls

export options

export only the selected features

If checked, only the selected features are exported. If no features are selected, all
features are exported. Checked by default.

4 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

output KML layer name

The name of the layer that will be displayed when the KML is opened in Google Earth.
Same as output file name by default.

KML layer description

The description of the layer that will be displayed when the KML is opened in Google
Earth.

KML layer transparency

The percent transparency of the output KML layer. 0% by default.

labeling and feature description options

apply feature colors to labels

If checked, the feature labels will be the same color as the feature they label. If
unchecked, all labels will be white.

label features with empty or <Null> values

If checked, features with empty or “Null” label attribute values will be labeled as “-Null-
“. If unchecked, these features will not be labeled. The default is unchecked.

export labels as a separate KML layer (optional for point features only)

If checked, point feature labels will be exported as a separate KML layer (or “folder”),
meaning the labels are independent of the features and can be turned on and off. The
default is checked

5 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

select an attribute for naming the features

An attribute in the GIS layer that will be used to name the features in the output KML.
By default, the same attribute used to symbolize the layer in ArcMap will be used to
create the feature names (or the label attribute if no categorical symbology is being
applied to the output KML). The KML features will be sorted on the feature name
attribute in ascending order.

feature description

The feature description option allows users to build a “description expression” that will
be used to describe each of the output KML features. This description can include
attribute values, HTML tags, and hyperlinks. Each of these items is described briefly
below:

› Create "information points" for retrieving and displaying the feature description
(lines and polygons only) – creates points in the output KML that sit on top of
each feature. These points can be selected (“clicked”) in Google Earth to display
the feature description.

› attribute values in the description – double-click the attribute name in the “layer
attributes” box to add and attribute value to the description. The “Add ALL
Attributes” button will add all of the feature attributes to the description.

› using HTML tags – some common HTML tags are provided. The buttons above the
description box will add tags for bold, italic and underlined text (text should be
inserted between the two tags). Other tags can be added manually.

› adding hyperlinks – hyperlinks can be added to the description without tags; any
valid URL string is automatically converted to a hyperlink to that URL (e.g.
http://www.google.com).

3D options

altitude mode

6 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

Determines the KML altitude mode if specifying feature heights. “Relative to ground”
sets the altitude of the element feature to the actual ground elevation of particular
location. If, for example, a feature with a height of 9 meters is set over a location where
the ground elevation is 10 meters above sea level, the elevation of the feature is 19
meters. “Absolute” sets the altitude of the element exactly above sea level, regardless of
the actual elevation of the terrain beneath the feature. For example, if the height of a
feature is 10 meters, and the terrain below is 5 meters above sea level, the feature will
appear elevated above the terrain by 5 meters.

surface offset attribute

If extruding features, a surface offset can be specified. Note that the offset will still be
extruded if the extrusion option is selected.

about “export to kml”

check for updates

Opens the ArcScripts homepage for ExporttoKML. The latest version of the script can be
downloaded and installed from here. I recommend that users check the website
regularly (once every couple of weeks, more often when a new version is first released).

known issues

› joined table attributes are not currently available to the extension; this issue will be
addressed in the next version
› there are some issues with converting GIS data that is in certain projections that causes the
resulting KML to display incorrectly in Google Earth. This is a glitch with ArcObjects “on-the-
fly” reprojection functionality. If you are having issues, reproject you data manually (in
ArcToolbox) to the Google Earth coordinate system before exporting. Google Earth uses
latitude/longitude coordinates based on the WGS84 datum (in ArcGIS, this is known as
“geographic coordinate system”, or GCS, WGS1984 datum).

7 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

bug fixes

version 2.3

date summary description


5/10/07 Circles and curves not “Densified” true circles and Bezier curves into
exporting from individual segments for export to KML
geodatabses
3/27/07 Output KMLs not Removed unnecessary leading commas before
displaying correctly in line and polygon coordinates
Google Maps API
9/7/06 Major error introduced at Apologies to everyone who had to deal with the
version 2.3.2 was confusion this one caused; fixed error in code
corrected – extruded to correctly extrude features
height values were bogus
8/14/06 “information points” all Fixed error in code to correctly export
describe the last feature individual feature descriptions
exported
8/8/06 export failure with Modified code to clean polygon topology on
topologically-incorrect export using IPolygon4.SimplifyEx
polygons
8/8/06 European operating modified code to correctly extrude 3D features
systems 3D issue on European (comma-based) operating
systems

version 2.2

date summary description


2/27/06 Fixed “subscript” error Modified code to export polygons without
that resulted if the input exterior rings as simple geometry collections
layer had funky topology (instead of a collection of interior and exterior
rings)
2/27/06 “No color” outlines and Modified code to add KML tags necessary for
fills were not displaying correctly displaying outlines and fills
correctly

8 City of Portland
Bureau of Planning
Export to KML Extension Version 2.3
documentation

3/15/06 Features with empty Modified code to skip over any features with
geometries (such as empty geometries
unmatched address
points) were causing a
crash
3/21/2006 “Null” values in the layer Modified code to correctly handle and display
symbolization attribute “Null” value labels
caused a crash when the
features were being
labeled

disclaimers

This extension is offered freely to the community, but is provided "as is". Any express or
implied warranties, including the implied warranties of merchantability and fitness for a
particular purpose are disclaimed. In no event shall myself or the City of Portland or
contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential
damages (including, but not limited to, procurement of substitute goods or services; loss of
use, data, or profits; or business interruption) sustained by you or a third party, however
caused and on any theory of liability, whether in contract, strict liability, or tort arising in any
way out of the use of this extension, even if advised of the possibility of such damage.

As always with ArcGIS, SAVE OFTEN.

contact

Please feel free to contact me to report bugs or bug fixes, request additional functionality,
suggest improvements, or with any other questions. The download now includes the source
code. Please keep me in the loop on any improvements or fixes you make. Enjoy!

kevin martin | gis analyst | city of portland | bureau of planning


[email protected]

9 City of Portland
Bureau of Planning

You might also like