Description | Example | Return Message | Group

VO KML

Manipulate KML files in the 3D Window.

Syntax

VO <ScenarioPath> KML {KMLOption} <Parameters> [WindowID <WinNumber>]

Related Commands

Description

The VO KML command will allow the user to add and remove KML files to a 3D Window, and show or hide the features of a KML file.

Valid values for {KMLOption} are: Load, Close, ZoomTo, Visibility.

All VO KML commands can optionally include the WindowID <WinNumber> parameter. If not included, the command will be applied to the first 3d Window.

The following tables describe the additional <Parameters> for each {KMLOption}.

VO KML Load

Load the specified kml file into the globe manager.

Load <Parameters> Description
{File "<FilePath>" | KMLString <String>} The "<FilePath>" is the full file path of the KML file.

The <String> is an xml string describing a kml object. Do not include quotes around the <String>.

Note: The KMLString parameter, if entered, must be the last parameter on the command line.

VO KML Close

Close the specified file or document in the globe manager.

Close <Parameters> Description
{File "<FilePath>" | Document "<DocName>"} Enter the full file path of the KML file or the KML document name.

VO KML ZoomTo

Set the 3D Window view to the named Feature. This option will also set the Visibility of the Feature to On.

ZoomTo <Parameters> Description
{File "<FilePath>" | Document "<DocName>"} Enter the full file path of the KML file or the KML document name.

Note: The File or Document parameter must appear before the Feature parameter.

Feature "<FeatureName>" Enter the "<FeatureName>" to ZoomTo.

If a Feature level has no name enter a single space, between the delimiters, for that level. The first unnamed feature at that level will be used.

Delimiter <c> Enter a single character to be used as the delimiter between levels of the FeatureName. The default delimiter is the forward slash "/".

Note: This parameter is optional.

For more information on this parameter see "Feature Names and Delimiter" below.
ShowBalloon {On | Yes | Off | No} Specify whether the information balloon for the feature, if applicable, should be shown. The default value is On.

Note: This parameter is optional.

VO KML Visibility

Show or hide the named Feature.

Visibility <Parameters> Description
{File "<FilePath>" | Document "<DocName>"} Enter the full file path of the KML file or the KML document name.

Note: The File or Document parameter must appear before the Feature parameter.

Feature "<FeatureName>" Enter the "<FeatureName>" to show or hide.

If a Feature level has no name enter a single space, between the delimiters, for that level. The first unnamed feature at that level will be used.

Visible {On | Yes | Off | No} Turn on or off visibility.
Delimiter <c> Enter a single character to be used as the delimiter between levels of the FeatureName. The default delimiter is the forward slash "/".

Note: This parameter is optional.

For more information on this parameter see "Feature Names and Delimiter" below.

Feature Names and Delimiter

The Feature name must appear in the command as it appears in the kml file. To access a feature at a lower level within the kml, you must specify the name of each level in the hierarchy path separated by a delimiter. The default delimiter is the forward slash "/" (e.g. World/Countries/US) but the user may specify a unique character for the delimiter by using the Delimiter parameter.

For best results use the VO_RM KML command to get a list of Feature Names,

Note: The Delimiter can not be a double quote ("), or the backslash (\).

If a Feature level has no name, then enter a single space, between the delimiters, for that level. For example, the following feature has no name for the second level.

Ionops/ /ColorKey

If a Feature name contains a double quote ("), a backslash (\) or the Delimiter, then the double quote, backslash or delimiter character must be preceded by a backslash (\).

If a Feature name contains a newline, tab or other whitespace character, the character representation must be used. For newline enter "\n"; for horizontal tab enter "\t"; for vertical tab enter "\v"; for formfeed enter "\f".

Example

Examples of feature name specifications:

The Feature name contains the double quote: Glacier, Ice Shelf "Velocity"

Feature "Glacier/Ice Shelf \"Velocity\""

The Feature name contains the delimiter (/): Glacier, Ice Shelf/Velocity

Feature "Glacier/Ice Shelf\/Velocity"

The Feature name contains a newline: Glacier, Ice Shelf(newline)Velocity

Feature "Glacier/Ice Shelf\nVelocity"

Example

Load the specified file on the first 3D Window:

VO * KML Load File "C:\User\test\Documents\STK 9\kml\kmlsamples.kml"

Zoom to the specified feature, using the default delimiter:

VO * KML ZoomTo Document "KML Samples" Feature "Polygons/Extruded Polygon/The Pentagon"

Show the specified feature:

VO * KML Visibility Document "KML Samples" Visible On Feature "Polygons/Google Campus/Building 42"

Close the kml file:

VO * KML Close File "C:\User\test\Documents\STK 9\kml\kmlsamples.kml"

Load the specified file on the second 3D Window:

VO * KML Load File "C:\User\test\Documents\STK 9\kml\real_pa.kml" WindowID 2

This Feature name uses a user specified delimiter (;):

VO * KML ZoomTo File "C:\User\test\Documents\STK 9\kml\real_pa.kml" Feature "USGS streamgages : 76th-90th percentile ;<a href='http://waterdata.usgs.gov/nwis/uv?01480685'>01480685</a> Marsh Creek near Downingtown, PA</a>" Delimiter ; WindowID 2

Set the visibility for the Feature on the second 3D window:

VO * KML Visibility Visible Off Delimiter ; File "C:\User\test\Documents\STK 9\kml\real_pa.kml" Feature "USGS streamgages : 76th-90th percentile ;<a href='http://waterdata.usgs.gov/nwis/uv?01480685'>01480685</a> Marsh Creek near Downingtown, PA</a>" WindowID 2

Close the kml file on the second 3D window:

VO * KML Close File "C:\User\test\Documents\STK 9\kml\real_pa.kml" WindowID 2

To load a kml Point object from a string description:

VO * KML Load KMLString <?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.2"><Document><name>Point</name><Placemark><name>Lat122</name><Point><coordinates>-122.0,37.0,0</coordinates></Point></Placemark></Document></kml>

ReturnMessage

If activated, Connect returns an acknowledgement message.

Group Membership

This command belongs to the following group(s):

VO

VO Window

Version

9.2

STK Programming Interface 11.0.1