Sample google earth kml file
With the file open in Google Earth, highlight the Folder that contains the Placemarks. Then click the Start Tour button. Note that the tour visits the Placemarks in order from south to north with an oblique view of each. San Andreas Fault Tour. Following is some of the KML from the file, showing only the first three and last Placemarks. They are listed in order from south to north. Note that each Placemark element contains a LookAt element.
This controls the characteristics of the User's initial viewPoint of the location during the tour. The longitude and latitude do not always match the ones in the coordinates element but are generally close.
In these Placemarks, the tilt is oblique. A 90 degree tilt would be straight down, but the oblique view affords a better look along the length of the fault. Moore in America. Two portions of the KML code are shown below. The StyleMap Pairs the two styles together in preparation for one style to apply to the Placemark icons on the map while they are not highlighted and the other style to apply when one is highlighted by a mouseover.
Within each portion of the Pair, these roles are specified by the key element. Within the description element, a url for an image of a sculpture is specified, surrounded by a hyperlink to its photo page on Flickr. Lower Manhattan. This post has a KMZ attachment that displays Points and Paths on the map to represent several streets.
Within the LineString element are a tesselate and a coordinates element. With the value of the tessellate element set to 1, the Path will be fit to the curvature of the Earth, so that parts of it do not become hidden below ground.
The coordinates element specifies the vertices of the Path, with each vertex represented by a set of three comma-delimited values, called a tuple. These values are longitude, latitude, and altitude respectively. As is the default, the latitude, which is zero in all these tuples, is given relative to ground level. Long Island Pine Barrens. Part of the KML for one of the Polygons is shown below. This Polygon has a hole in it, so it has both an outer boundary and an inner boundary.
The outerBoundaryIs and innerBoundaryIs elements each contain LinearRing elements, which in turn contain coordinates elements that list the vertices of the respective boundaries. It is possible to change the base map , which is a map placed under a thematic map to give geographic context to the features. In this case, the information on the default base map makes the map a bit cluttered, and the light political or mono city base maps make the features stand out a bit more clearly.
Get a link to the map from the Link to Share box at the top of the sharing dialogue. You can then share the map by texting or e-mailing this link. If you want to embed this map in a web page, you can get HTML iframe code by clicking on the top ellipsis and selecting Embed on my site. KML files also allow you to save files as documents, which you can then use to easily recreate old maps. Google Maps automatically saves changes as you make them, so when you are done with your map, you can just close the window.
Ground overlays enable you to "drape" an image onto the Earth's terrain. Notice that the file begins with the same two lines as the first example: the XML header and KML namespace declaration. This example uses a Folder titled "Ground Overlays" as a mechanism to group and label its contents.
Bounding values are given for the north and south latitudes, and east and west longitudes. In addition, rotation values are given for images whose y -axis doesn't coincide with grid north.
This example uses a JPEG image for the overlay. Many different types of paths can be created in Google Earth, and it is easy to be very creative with your data. Take a look at the "Absolute Extruded" example in the Paths folder and you can see how the shape has been generated by the following code:. Notice how it is really just one line drawn at altitude above the ground.
You can use Polygons to create simple buildings and other shapes. The Pentagon example is generated by drawing simple inner and outer shells and then extruding them down to the ground. Here is the code :. This section describes some of the KML elements that must be authored using a text editor, such as shared styles for geometry, highlighted icons for Placemarks, and screen overlays.
Authoring KML "by hand" is a bit more advanced than using the Google Earth interface to create and modify features, but with a small amount of practice, most users are comfortable editing KML files to add these effects.
Once you've created features within Google Earth and examined the KML code Google Earth generates, you'll notice how styles are an important part of how your data is displayed.
Power users will want to learn how to define their own styles. Because more than one element can use the same Style, styles defined and used in this way are referred to as shared styles. If the Style definition is within the same file, precede the Style ID with a sign. Note that it's easiest if your IDs are descriptive strings so that you can easily tell what their effect is.
Here's an example of a style "transBluePoly" that defines a transparent blue color for the polygon faces and a line width of 1. This style is used by Building 41 in the Google Campus example in the Polygons folder :. The Document defines two styles, one for the "normalPlacemark" and one for the "highlightPlacemark" shown when the cursor rolls over the Icon.
There are two icon states: normal and highlight. Screen overlays cannot be authored directly within Google Earth and are thus more difficult to create than ground overlays. As an example, enable the "Absolute Positioning: Top left" folder in the KML Samples file and you will see a screen overlay at the top left of the view window. This was created with the following KML code:. In this case, the top-left corner of the image 0,1 has been made coincident with the same point on the screen.
Check the other examples in the folder to see how it is possible to obtain other fixed positions, and to create images that size dynamically with screen size. Note that xunits and yunits can also be specified as "pixels" for precision control. For further detail, see the KML 2.
The specified file can be either a local file or a file on a remote server. In their simplest form, network links are a useful way to split one large KML file into smaller, more manageable files on the same computer. So far, all of our examples have required that the KML code be delivered to Google Earth from the local machine.
Network links give you the power to serve content from a remote location and are commonly used to distribute data to large numbers of users.
0コメント