Search Google Earth
User Guide

Using Style Templates

Note - This feature set is available to users of the Google Earth Pro product. Visit http://earth.google.com/intl/en_GB/enterprise/earth_pro.html for more information.

Often the data that you import into Google Earth contains multiple features that are not automatically converted into a feature that is readily visible in the 3D viewer. For example, a shape file defining the population boundaries for a specific region might have a field that supplies the population number for each boundary defined in the data. Or, a CSV file might contain property listings with a field showing the square footage of each listing.

You can use style templates when importing this data in order to display fields in your data in meaningful ways.

This is accomplished by mapping or connecting specific fields in your imported data to one of four template display features:

The rest of this section covers:

Applying a Style Template

This section covers the basic steps involved in applying a style template to vector data containing fields that you want to have displayed in the 3D viewer. You can apply style templates to newly ingested data or to existing KML data. In addition, you can modify existing templates using the steps below.

Note - Style templates are quite specific to the data that you are working with. While you can use the same style template for different data with the same fields, the template settings will often have to be adjusted to represent the data properly. As your original dataset changes with new data, you might also need to adjust the template to accommodate new information.
  1. Choose the data that will have the style template applied to it. If you are importing the data for the first time, simply click the Yes button when prompted to apply a style template.
  2. If you already have this data in your Places panel, select the parent folder and click Edit > Apply Style Template. (Use this method when you want to edit a recently created style template).
  3. In the Style Template Settings dialogue box, indicate whether you are creating a new template or using an existing one.
  4. If you have an existing style template for your data, it appears in the Compatible templates list along with any other style template that is compatible with the data that you have selected. If you choose to use an existing style template, select the correct one from the list. If you simply want to apply the template to your data without changing the template itself, leave the edit selected template checkbox cleared. To edit the style template, select the checkbox.
  5. When you create a new template or edit an existing one, the Style Template Settings dialogue box appears.
  6. Choose a field from your data that you want to use as a Name or label for your data. This name appears in the 3D viewer as well as in the Places panel that lists the data points.
  7. Click the Colour tab and map an element of your data to colour styles. See Mapping Colour Styles for details.
  8. Click the Icon tab and map and element of your data to one or more icons. See Mapping Icons to Point Data for details.
  9. Click the Height tab to map a height value to a data element. See Mapping Height Values for details.
  10. Click OK when you have·finished defining your styles. The values that you defined appear in the 3D viewer.

The rest of this section discusses in detail how to apply template values to data. Finally, you can use the instructions in A Style Template Example to walk through the process of defining a style template on sample point data from a text file.

Mapping Colour Styles

You can apply colour to selected fields in your imported data. In this case, colour is applied to the feature depending on the type of data imported:

Use the colour style to colour these elements in a meaningful way depending on both the data type and the field data within the entire set. You can use three mechanisms to colour data:

The rest of this section describes how to use these colour application methods.

Using a Single Colour

If you want to use one colour for all the points or lines from your imported data, select the Use single colour option and click the coloured square next to the option. From the colour selector, choose a colour or define your own colour to be applied to the data.

Using Random Colours

To use a variety of colours that are applied randomly by Google Earth, select the Use random colours option.

Note - The line or point data will be coloured based on values supplied by Google Earth. If you are also supplying an icon for point data, the colour is added to the existing colour of the icon.

Setting Colours Based on Field Values

While applying colours to data features helps distinguish features from each other in the 3D viewer, using colours based on field values provides a way to display data about the feature set that you couldn't otherwise display easily. For example, you might want to set a short range of colours based on the square footage of property listings. Or, you might want to set a range of colours for shape files showing average household income.

Use the following steps to define colour values by a data field.

  1. Select the Set colour from field option in the Colour tab.
  2. Choose the field that you want to apply colour data to from the Set colour field drop-down list. Here, you can choose either numeric fields or text fields from your data. See Choosing Field Types for Style Mapping.
  3. Choose the start and end colour (optional) for your colour mapping. By default, the style template "colour buckets" are created from blue and mapped through the spectrum to red. If you want to change the colour range, you can click each colour block and set the start and end colours as desired. Google Earth automatically calculates the colour range between the two chosen values.
  1. Use the Number of buckets selector to indicate how to group the range of field values. This option is only available for fields with numeric data. The ranges for each bucket are computed automatically, but can be adjusted manually. See Customising the Value Range for Numeric Data for details. To learn how buckets behave for string and numeric fields, see Using Buckets for Field Data.
  2. Make any further desired adjustments.
    • Subfolders - You can create subfolders for each colour bucket so that the Places listing displays the data elements grouped by colour in their respective folders. This makes it easier for you to show or hide the display of colour groups simply by selecting or removing the checkbox next to the folder. Once you select the subfolder option, you must provide a name for your subfolder in order for the data to be properly grouped in the Places listing. Note that you can only define a single subfolder option for either colour or icon display.
      Data elements grouped by colour in their respective folders
    • Colour display order - You can click the Reverse order button to reverse the display order of the colour range. So, if you have a range of colours starting with blue for the first element and ending with red for the last one, reversing the order will apply red to the first element and blue to the last.
    • Colour adjustments to single buckets - You can modify each colour element individually by clicking it and adjusting the colour for that particular value or value range. In addition, you can modify the settings for numeric buckets to adjust the spread of the data to your preference. See Customising the Value Range for Numeric Data to learn how to adjust the numeric ranges once you choose the number of buckets for a range of numbers.
  3. Click the OK button to apply and view your changes. - Save the style template. You can always edit the template to apply icon and height styles or to make additional colour adjustments. Do this by following the instructions in Applying a Style Template.

Mapping Icons to Point Data

As with colour, you can apply icons to fields in your data. However, icons can only be mapped to point data, so if you are importing line or shape data, the Icon style tab will be unavailable. You can use two mechanisms for mapping icons to points:

Setting Icons Based on Fields

These steps describe the basic process of mapping icons to fields in your data. The following steps describe the basic process for defining colour values by a data field.

  1. Select the Set icon from field option in the Icon tab.
  2. Choose the field that you want to apply icon labels to from the Set icon from field drop-down list. Here, you can choose either numeric fields or text fields from your data. See Choosing Field Types for Style Mapping.
  3. Use the Number of buckets selector to indicate how you want to group the range of field values. This option is only available for fields with numeric data. The ranges for each bucket are computed automatically, but can be adjusted manually. See Customising the Value Range for Numeric Data for details. To learn how buckets behave for string and numeric fields, see Using Buckets for Field Data.
  4. For each bucket defined, select an icon from the list.
  5. Make any further desired adjustments:
    • Subfolders - You can create subfolders for each icon bucket so that the Places listing displays the data elements grouped by the folder label in their respective folders. This makes it easier for you to show or hide the display of icon groups simply by selecting or removing the checkbox next to the folder. Once you select the subfolder option, you must provide a name for your subfolder in order for the data to be grouped properly in the Places listing.
      Subfolders for each icon bucket
    Note: You can only define a single subfolder option for either colour or icon display.
    • Icon adjustments to single buckets - You can modify each icon element individually by clicking it and adjusting the icon for that particular value or value range.
    • In addition, you can modify the settings for numeric buckets to adjust the spread of the data to your preference. See Customising the Value Range for Numeric Data to learn how to adjust the numeric ranges once you choose the number of buckets for a range of numbers.
  6. Click OK to apply and view your changes.
  7. Save the style template. You can always edit the template to apply icon and height styles or to make additional colour adjustments. Do this by following the instructions in Applying a Style Template.

Mapping Height Values

By default, no height values are defined initially in the Height tab. Use the Height tab in the Style Template Settings dialogue box to set height values from a selected field. Once height values are activated, points, lines or shapes are extruded from ground level to the height defined for each data element. If you map height to lines or shapes, the values that you define work in combination with the colours defined in the Colour tab.

On the other hand, if you map height to point data, those points are extruded using a single pixel coloured line to connect the icon from its elevated position to the ground. You can use style settings to modify the width and colour of those lines if you wish.

The rest of this section covers details for using height values effectively, including:

Height Values for Text Fields

The height map settings for text fields differ from those for numeric fields. If the field that you choose to map contains text data, the first 8 unique fields are each defined in their own container or bucket. For this reason, it makes sense to only map height values to a field that has 8 or fewer unique values. See Choosing Field Types for Style Mapping for more details.

When you map height values to a text field, the following settings are available:

Height Values for Numeric Fields

When you map height values to a numeric field in your data, you can choose from two types of mapping methods: continuous or split into buckets.

Using Continuous Mapping

The continuous mapping method uses the minimum and maximum values of your selected field to determine a minimum and maximum height display for the entire set. It then maps all data within the set in a way that best corresponds to each individual field. In the example, the Square_footage field is used to map height values, with the minimum value of 2000 and a maximum value of 6234. Each of the 9 elements in the set is displayed at a slightly different height value that most accurately displays its relationship to the other points. This particular method is useful in smaller datasets where individual distinctions between points or shapes are easily visualised.

With the continuous mapping method, you can use the Scaling factor slider and the Height units selector as described above in Height Values for Text Fields. In addition, you can enter the desired height that you want for the start and end ranges of your data. For example, you might want houses starting at 2000 feet to be displayed in the 3D viewer at a height of 100 metres and houses at the end range to be displayed at a height of 5000 metres.

In the 3D viewer, the visual distinction between individual elements using this method is affected by both the height range that you set and by the number of elements in the data. For example, a range of 100 - 5000 metres for a set containing only 9 elements creates a visually distinct height for each point.

If you decrease the range or increase the number of elements in the set, the distinction between each element diminishes.

Splitting Values into Buckets

Use the Split into buckets mapping method to create up to 8 height groupings for your data. This method works well for large datasets where continuously mapped heights are not easily visualised in the 3D viewer. For example, if your dataset contains over 1000 housing listings clustered around a small region, it might be difficult to see the actual difference between houses in different height categories. By using the Split into buckets option, you can create more meaningful categories and define visually distinct gaps in their display. For example, you might have all listings between 2000 - 3000 square feet display at a height of 500 metres, all listings between 3000 - 4000 square feet display at a height of 1500 metres and so on. While this method will not distinguish a house at 3000 square feet from one at 3200 square feet, it will allow a more immediate visual grasp of the categories that you have defined.

As with colour and icon styles, the maximum value for each bucket is computed automatically, but can be adjusted manually. Use the Scaling factor slider and the Height units selector for this method as described above in Height Values for Text Fields. As you set the number of buckets and define the maximum value for each bucket, the Style Template wizard displays the count of items for each bucket. For more details, see Using Buckets for Field Data.

Using Style Settings to Modify Point Display

The colour values that you set for point data are applied to the icon that you map to points as well as to the line that is extruded from the point on the Earth for the height of the line, as shown in the property listing example above. However, in some cases it might not be easy to visualise a single-pixel line in the 3D viewer against the Earth imagery.

In that case, you can edit the style settings for each point in order to modify the line thickness.

  1. Right-click (CTRL-click on the Mac) the point that you want to modify and select Properties from the pop-up menu.
  2. In the Edit Placemark dialogue box, in the Style, Colour tab, modify the point's appearance as required.
  3. Click OK.

Since this process is not practical for large datasets, you might consider applying changes to entire folders or subfolders. Note that if you do this, any individually defined styles will be lost. In this case, use the subfolder feature of the Style Template wizard to group similarly styled data into subfolders. Make sure that each created folder has similar colour and icon data. Then, apply the height value to your data and save the style template. Later, use the steps above to create shared styles for each subfolder that you set up. As long as all of the data within each folder has the same colour value and the same icon value, changes to the line thickness will not impact those settings.

Using Buckets for Field Data

When using colour, icon or height mapping for specific fields in your dataset, you typically define a number of buckets, or containers, to distinguish different ranges of data. The sections that follow describe how different field types are interpreted by style templates, as well as how you can adjust the range of values when mapping numeric data.

Choosing Field Types for Style Mapping

You can choose two basic types of fields from your data when mapping colour, icon or height values:

 
Note - If you are using a spreadsheet application such as Microsoft Excel to create your data, make sure that the cell format that you choose for numeric fields has been set to numeric and not text. If you have numeric fields in your CSV saved from a spreadsheet, but the Style Template wizard is not recognising it as numeric, it might be due to incorrect formatting. To verify whether the actual field is marked as text or numeric, open the CSV file in a simple text editor and look at the field in question. If it is enclosed in double quotation marks, then it has been defined as text — even if there are numbers only within the quotations. You can remove the quotation marks manually from the file, or open your spreadsheet application and format the cells as numeric and save the CSV data again.

Customising the Value Ranges for Numeric Data

Typically, you will want to customise the numeric values to define buckets in ranges that are more meaningful for your data. For example, you might modify the ranges displayed in the example above to round figures that are typically used to describe square footage for houses. To do this, simply enter the values that you want as the maximum value for each bucket. As you do this, the number of elements contained by the new definition updates to reflect your changes.

Keep in mind the following about how to adjust numeric field values:

A Style Template Example

This tutorial is designed to help familiarise you with the basic process of defining, editing and using a style template for any data that you import into Google Earth. This example uses a text file saved in CSV (Comma-Separated Value) format showing some fictional property listings in the greater Detroit area. This tutorial covers the following:

Saving the Sample File

  1. Use the sample property listing provided to follow along with this tutorial. Click the link and save the file to your computer. If you are using Firefox, right-click (CTRL-click on the Mac) the link and select Save Link As... from the pop-up menu. You can also open and view it with a spreadsheet application if you wish. Navigate to a location on your computer's hard drive (such as My Documents or Documents) and save the file.
  2. To avoid confusion in the rest of this tutorial, keep the sample file named MetroDetroitRE.csv.
 

Use this file in the rest of this tutorial as your GIS data source. If you are curious to know what a comma-separated text file looks like, open the file using a simple text editor. If you do this, close it without saving any changes.

Importing the File

  1. Click File > Import. Navigate to the place on your computer's hard drive where you saved the file in the steps above. Select the MetroDetroitRE.csv file and click Open. Click Yes when asked if you want to apply a style template.
  2. In the Style Template Options dialogue box, verify that Create new template is selected and click OK.

You are now ready to create and view the style template.

Creating Style Template Name and Colour Settings

In this section, you will supply a name label to the property listings and colour code the listings based on the Square_footage field. After that, you will save the template and view your settings.

  1. With the Style Template Options dialogue box open, make sure that the Name tab is active.
  2. Click the black arrow next to the Set name field selector.
  3. Choose the first field in the list, Address.

    Note how the preview table shows the Address column as selected. You can also click the column heading of any column in the preview table to change your choice. When you have·finished, make sure that the Address column is the selected element for the Name field.
  4. Click the Colour tab. Note how the default setting here is to use a single colour for the point data and that the colour is set to white.
  5. Select the Set colour from field option.
  6. From the Select colour field selector, choose Square_footage as the field. Again, you can see how the Square_footage column is selected as the chosen field in the data preview table.
  7. Adjust the colour range to your preference. For instance, suppose you want graduations of a single red colour from light to dark. Click the colour square next to Palette start colour and choose white in the colour picker dialogue box. Since the default end colour is already red, you can leave that square as it is. The colour range gradient will update to reflect your new choice.
    Adjust the colour range to your preference
  8. This tutorial will use the default colour palette range of blue to red. To change it back, simply click the white colour box and choose a blue colour from the colour picker.
  9. In the Number of buckets selector, set the number to 3 if it is not already.
  10. Select the create subfolders for each bucket checkbox.
  11. In the Bucket options area, set the Maximum value fields from lowest to highest as follows:
    • 3000
    • 4000
    Note the slight adjustment in the count fields.
  12. Provide meaningful folder names for each bucket. For example:
    • 2000 - 3000 Square Feet
    • 2000 - 3000 Square Feet
    • 4000 - 6500 Square Feet
  13. Click OK at the bottom of the Style Template Settings window.
  14. In the Save Template dialogue box, click the Save button. Note that the name of the template file corresponds to the name of your imported file.
  15. Leave this name as it is and click the Save button. The 3D viewer adjusts to encompass all of the points in the data file. Note that the number of blue icons corresponds to the count next to the blue bucket and so on for all three buckets (3 blue, 2 green, 3 red).
  16. In the Temporary Places folder within the Places panel, expand both parent folders until you see the three subfolders that you created in the steps above.

    You can turn off the display of all houses contained within a given folder simply by removing the tick next to that folder.

    You can also adjust the order of the folders by dragging the 3000 - 4000 Square Feet folder to the space between the two remaining folders, so that the order appears in sequence.

Take some time to explore the data related to each point. You can double-click an item within a folder to zoom in to that view as well as to view the info balloon for the point. Or, click the point in the 3D viewer to view the info balloon.

Modifying the Style Template for Icon Settings

In this section, you modify the style template that you've saved to apply icons that display the number of bedrooms for each listing.

  1. Right-click (CTRL-click on the Mac) the top-most folder called MetroDetroitRE.csv and select Apply Style Template... from the pop-up menu.
  2. In the Style Template Options dialogue box, select Use existing template.
  3. Select the MetroDetroitRE template from the list if it is not already selected, and tick edit selected template.
  4. Click the OK button and in the Style Template Settings dialogue box, click the Icon tab.
  5. Choose the Set icon from field option and in the Select icon field selector, choose Bedroom from the list or click the Bedroom column in the preview table.
  6. Set the Number of buckets selector to 4. Note the count display that shows how many listings have the corresponding number of bedrooms per value.
  7. From the Icon selector next to each bucket, choose the number icon that corresponds to the maximum value for each field.
  8. Click the OK button on the Style Template Settings dialogue box.
  9. In the Save Template dialogue box, click Save and when prompted to overwrite the existing template, click Yes. In the 3D viewer, you should see the icons change to reflect your settings.

Removing Duplicate Folders

Each time you modify a style template, any folders you have created using folder options are duplicated.

Because you might have modified data manually within the parent folder (including manually created subfolders), the style template wizard avoids overwriting your data and simply creates another set of folders, removing the visibility tick from the older ones. You can choose to retain this historical data (which will increase each time you modify and save a template) or you can right-click (CTRL-click on the Mac) the folders that you no longer want and select Delete from the pop-up menu.

Adding Height Values

In this section of the tutorial, you will modify the style template to create height values based on the price of the house.

  1. Right-click (CTRL-click on the Mac) the top-most MetroDetroitRE.csv folder and select Apply Style Template... from the pop-up menu.
  2. Choose the Use existing template option, select the template and tick the edit selected template checkbox.
  3. Click the Height tab in the Style Template Settings dialogue box and choose the Set height from field option.
  4. Click the Price column in the table preview to choose the price field for height.
  5. Select Continuous as the mapping method.
  6. Leave the Scaling factor slider at 1.0 and the Height units at metres.
  7. Next to the minimum value row, replace 20.4005 with 100 as the value.
  8. Next to the maximum value row, replace 2040.05 with 5000 as the value.
  9. Click the OK button on the Style Template Settings dialogue box and save the template, replacing the previous version.
  10. If desired, remove the duplicate folders from the parent folder.
  11. Tilt the view in the 3D viewer to see the effects of your settings.

Creating a Map Legend

In this final section of the tutorial, you can view the code behind a sample KMZ file designed to create a legend for the 3D viewer so that users can readily view the meaning of the settings that you've defined in the style template. If you click the link for this KMZ file, you can open it in your Google Earth browser to view the legend for the data that you've created here. You can also save the file to your computer and open it using a text editor to see the code that is described in this section.

The diagram that follows shows the code that is used to create the KMZ file. Using the KMZ file that you opened as a model, you can create your own screen overlay for your own data as follows (these tips assume that you understand how to use basic web-oriented tools such as FTP, image editors and HTML editors):

The code used to create the KMZ file

  1. Enter the name of your screen legend between the <name></name> tags. This name appears in the Places panel. You can drag this into the parent folder of your style template.
  2. Enter the correct URL of the image that you use to create the legend. Here, the sample path is the format that you use to reference an image on your local computer. For images on a web server, use the URL to the image itself (not the web page containing the image and make sure that the image has been uploaded to the location referenced by the URL.

Updated on