Begin by downloading that file to view the examples in Google Earth. The KML 2. The simplest kind of KML documents are those that can be authored directly in Google Earth—that is, you don't need to edit or create any KML in a text editor.
Placemarks, ground overlays, paths, and polygons can all be authored directly in Google Earth. A Placemark is one of the most commonly used features in Google Earth. It marks a position on the Earth's surface, using a yellow pushpin as the icon.
You can specify a name and a custom icon for the Placemark, and you can also add other geometry elements to it. This folder includes three different types of placemark: simple , floating , and extruded. The KML code for the simple placemark looks like this:. If you were wondering where the Placemark is, it's right over Google's Building 41, where we developed Google Earth! By default, the icon is the familiar yellow pushpin. The Point is used to place the icon, but there is no graphical representation of the Point itself.
You can add links, font sizes, styles, and colors, and specify text alignment and tables. Google Earth 4. 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. Most importantly is the Altitude tab. Be sure to set it to Relative to ground as shown in the image. With polygon, you can create overlays on the map that denotes an area i. Similar to adding placemarks, zoom in to the area where you want to overlay a polygon and click the Add Polygon button on the Google Earth toolbar.
Click on the map to add multiple points that will form the polygon. Right click to remove points. The Style, Color tab allows you to change the color of the polygon overlay. Be sure to adjust the opacity so that it is semi-transparent. Be sure to set it to Relative to ground. Paths are just lines. Similar to Placemarks and Polygons, you can also add description, change style and color.
Click on the map to place multiple points that will form the path, and right click to remove points. A KML file is a file that represent the locations and shapes of places on our planet Earth. Businesses and researchers use them to track points of interest, from potential store locations to the outlines of geographical features, such as Census tracts or U. You can create one in Google Maps or on the desktop program Google Earth, and they can be imported and displayed by a lot of geographical software.
It's often useful to be able to share and store geographical data, such as the latitudes and longitudes of certain addresses, the outlines of geographical features like cities or counties or the outline of a route from one place to another. As with other types of electronic data, computer programs need to have standardized formats in order to share geographical data without distortion. One relatively common format for geographical data is the KML file, most famously used by the desktop program Google Earth.
It stores points and places in a format based on the common XML standard for storing and sharing data. Google Maps and Google Earth can input and create a KML file, and other common geographical programs and programming languages can do so too.
Since the format is based on text-based XML, similar to the HTML programming language used for website programming, it's also human readable and editable with a text editor or with other software for parsing and displaying XML files.
0コメント