海拔高度座標會以右上升 (RA) 和衰減的方式描述。右上升點 (對應經度):代表太陽與天空中交界的赤道之間的距離。右側測量是從 0 到 24 小時進行測量,一個小時的 RA 等於一小時小時內,在地球表面的指定點上旋轉的量。新招攬 RA 的時數為 1 分,也就是即日起往來點,而 RA 從 Y 開始往東方增加。
當您在 Google 地球中處於天空模式,然後儲存檔案時,Google 地球會假設您想將檔案儲存為天空檔案,並自動將 hint 屬性加到 <KML> 元素。
範例
下方範例說明如何建立 KML 檔案,以顯示「Google 地球」中的「蟹餅星雲」:
<kml xmlns="http://www.opengis.net/kml/2.2" hint="target=sky"> <Document> <Style id="CrabNebula"> <BalloonStyle> <text><center><b>$[name]</b></center><br/>$[description]</text> </BalloonStyle> </Style>
<Placemark> <name>Crab Nebula</name> <description> <![CDATA[ This is the Crab Nebula. It is the remnant of a supernovae that was observed on Earth in 1054 CE. You can find out more about the Crab Nebula by looking at the information in the default layers, specifically: <ul> <li> <b>Backyard Astronomy</b> <li> <b>Hubble Showcase</b> <li> <b>Life of a Star</b> </ul> Enjoy exploring Sky! ]]> </description> <LookAt> <longitude>-96.366783</longitude> <latitude>22.014467</latitude> <altitude>0</altitude> <range>10000</range> <tilt>0</tilt> <heading>0</heading> </LookAt> <styleUrl>#CrabNebula</styleUrl> <Point> <coordinates>-96.366783,22.014467,0</coordinates> </Point>
</Placemark> </Document> </kml>
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2022-12-20 (世界標準時間)。"],[[["\u003cp\u003eCreate KML files to display celestial objects like stars, constellations, and planets in Google Sky by adding a specific hint attribute and converting coordinates.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Earth's Sky mode offers a view of the sky from Earth's center, allowing exploration of the celestial sphere.\u003c/p\u003e\n"],["\u003cp\u003eCelestial coordinates use right ascension (like longitude) and declination (like latitude) for positioning objects.\u003c/p\u003e\n"],["\u003cp\u003eKML elements such as Placemark, Ground Overlay, LineString, and Polygon are supported for creating celestial features in Google Sky.\u003c/p\u003e\n"],["\u003cp\u003eConverting right ascension to degrees and calculating the appropriate range for the LookAt element are crucial for accurate display of sky objects.\u003c/p\u003e\n"]]],[],null,["# Sky Data in KML\n\nYou can now create KML files that display objects in the sky, such as stars, constellations, planets, the Earth's moon, and galaxies. This page explains how to create a KML file to display celestial data in Google Sky. Specifically, you'll need to do the following:\n\n- Add a *hint* attribute to the \\\u003ckml\\\u003e element at the beginning of your KML file that indicates the file contains sky data, not Earth data\n- Convert celestial coordinates to Earth-based KML coordinates\n\nSky Mode\n========\n\nThe Google Earth user can control when to switch to Sky mode, using the View \\\u003e Switch to Sky menu option or the Sky button in the user interface. When the user switches to Sky mode, Google Earth transitions to show images of the sky photographed from telescopes around the world and inouter space. The view of the sky is as if the user is standing at the center of the Earth, looking outward toward the heavens. This model allows users to explore the sky above their heads as well as parts of the celestial sphere that would normally be seen only from the other side of the Earth.\n\nCoordinates\n-----------\n\nCelestial coordinates are described in terms of *right ascension (RA)* and *declination* . *Right ascension*, which corresponds to longitude, represents a distance from the point in the sky where the sun crosses the celestial equator at the vernal equinox. Right ascension is measured from 0 to 24 hours, with one hour of RA equal to the amount the sky rotates above a given point on the Earth's surface in one hour of time. Zero hours of RA is at the point of the vernal equinox, with RA increasing eastward from that point.\n\n*Declination* is analogous to latitude, with 0 degrees declination located at the celestial equator. Declination values range from −90° directly above the South Pole to +90° directly above the North Pole.\n\nThe following figure shows Google Sky with grid lines for right ascension and declination turned on:\n\nSupported Elements\n------------------\n\nThe following elements are supported in Google Earth 4.2, Sky mode:\n\n- Placemark\n- Ground Overlay\n- LineString\n- Polygon\n- MultiGeometry\n- LinearRing\n- Point\n- Style elements\n- Container elements\n\nNote, however, that \\\u003ctilt\\\u003e and \\\u003croll\\\u003e are currently ignored in these elements.\n\nThe *hint* attribute\n====================\n\nIf your KML file contains Sky data, be sure to add the hint attribute to the \\\u003ckml\\\u003e element at the beginning of the file: \n\n```\n\u003ckml xmlns=\"http://www.opengis.net/kml/2.2\" hint=\"target=sky\"\u003e\n```\n\nWhen a file with the `\"target=sky\"` hint is loaded, Google Earth prompts the user to switch to Sky view if it is not already in this mode.\n\nConverting Celestial Coordinates for Display in Google Earth\n============================================================\n\nYou'll need to perform some simple calculations to convert *right ascension* coordinates (Hours/Minutes/Seconds) into degrees of longitude so that the data displays correctly in Google Earth (Sky mode).\n\nConvert Right Ascension Coordinates\n-----------------------------------\n\nTo convert right ascension coordinates from values in a range from 0 to 24 to values in the range from −180 ° to +180 °, use this formula, where *hour* , *minute* , and *second* are the original right ascension values of the data: \n\n```\n(hour + minute/60 + second/3600)*15 − 180\n```\n\nConvert Declination Coordinates\n-------------------------------\n\nDeclination coordinates correspond directly to latitude values, ranging from −90° south of the celestial equator to +90° north of the celestial equator.\n\nCalculating Range for the LookAt Element\n========================================\n\nWhen you use the \\\u003cLookAt\\\u003e element with sky data, you will need to perform the following calculations to determine the *range*. The basic formula is as follows: \n\n```\nr = R*(k*sin(β/2) - cos(β/2) + 1)\n```\n\nwhere\n\nr\n: is the *range*, specified in the \\\u003cLookAt\\\u003e element\n\n*R*\n: is the radius of the celestial sphere (or, in this case, the Earth, since we're effectively inside it looking out at the sky), which is equal to 6.378 x 10^6^\n\nk\n: is equal to 1/tan(α/2), or 1.1917536\n\nα\n: is the angular extent of the view in Google Earth when the camera is pulled back to the center of the celestial sphere (Earth)\n\nβ\n: is the desired arc seconds of your sky image\n\n**Note:** The [Google Calculator](http://www.google.com/help/calculator.html) is a handy tool for making such calculations.\n\nHere are some sample ranges:\n\n- Large spiral galaxy (Sunflower Galaxy): 20-30 km\n- Large globular cluster (M15): 20-30 km\n- Andromeda Galaxy: 200 km\n- Planetary Nebula (Owl Nebula): 5-10 km\n- Large Nebula (Trifid Nebula): 10-30 km\n- Single Hubble Pointing (Seyfert's Sextet): 2-5 km\n- Open star cluster (Praesepe): 30-60 km\n- Smaller spiral galaxy: 5-10 km\n- Large Magellanic Cloud: 400-500 km\n\nSaving Files in Google Earth\n============================\n\nIn Google Earth, if you are in Sky mode and you save a file, Google Earth assumes you want to save the file as a Sky file, so it adds the *hint* attribute to the \\\u003ckml\\\u003e element automatically.\n\nExample\n=======\n\nHere is an example of creating a KML file that shows the Crab Nebula in Google Earth: \n\n```\n\u003ckml xmlns=\"http://www.opengis.net/kml/2.2\" hint=\"target=sky\"\u003e\n\u003cDocument\u003e\n \u003cStyle id=\"CrabNebula\"\u003e\n \u003cBalloonStyle\u003e\n \u003ctext\u003e\u003ccenter\u003e\u003cb\u003e$[name]\u003c/b\u003e\u003c/center\u003e\u003cbr/\u003e$[description]\u003c/text\u003e\n \u003c/BalloonStyle\u003e\n \u003c/Style\u003e\n \u003cPlacemark\u003e\n \u003cname\u003eCrab Nebula\u003c/name\u003e\n \u003cdescription\u003e\n \u003c![CDATA[\n This is the Crab Nebula. It is the remnant of a supernovae that was\n observed on Earth in 1054 CE. You can find out more about the Crab\n Nebula by looking at the information in the default layers, specifically:\n \u003cul\u003e\n \u003cli\u003e \u003cb\u003eBackyard Astronomy\u003c/b\u003e\n \u003cli\u003e \u003cb\u003eHubble Showcase\u003c/b\u003e\n \u003cli\u003e \u003cb\u003eLife of a Star\u003c/b\u003e\n \u003c/ul\u003e\n Enjoy exploring Sky!\n ]]\u003e\n \u003c/description\u003e\n \u003cLookAt\u003e\n \u003clongitude\u003e-96.366783\u003c/longitude\u003e\n \u003clatitude\u003e22.014467\u003c/latitude\u003e\n \u003caltitude\u003e0\u003c/altitude\u003e\n \u003crange\u003e10000\u003c/range\u003e\n \u003ctilt\u003e0\u003c/tilt\u003e\n \u003cheading\u003e0\u003c/heading\u003e\n \u003c/LookAt\u003e\n \u003cstyleUrl\u003e#CrabNebula\u003c/styleUrl\u003e\n \u003cPoint\u003e\n \u003ccoordinates\u003e-96.366783,22.014467,0\u003c/coordinates\u003e\n \u003c/Point\u003e\n \u003c/Placemark\u003e\n\u003c/Document\u003e\n\u003c/kml\u003e \n```\n\nHere is how this file appears in Google Earth:"]]