I have some nice data from research aircrafts that I put into kml-files like the example below. If you check the elevation profile, you find the
extended Data plotted nicely.
My problem: my data contains missing values. If I try an empty in place of the missing data, the extended data doesn't appear
more in the profile frame (you can delete one of the floats in the gx-value pair to see).
My question to you: Is there any hack to make GoogleEarth draw the profile without the missing values (i.e. interrupted)?
Or do you know a way to give the GE developers a feedback?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
<Document id="feat_1">
<Style id="stylesel_0">
<LineStyle>
<color>ff0000ff</color>
<colorMode>normal</colorMode>
<width>4</width>
</LineStyle>
</Style>
<visibility>1</visibility>
<Schema id="schema_1" name="Flight Track">
<gx:SimpleArrayField name="bb" type="int">
<displayName>Flight Track</displayName>
</gx:SimpleArrayField>
</Schema>
<Placemark id="feat_2">
<name>example</name>
<styleUrl>#stylesel_0</styleUrl>
<gx:Track>
<gx:coord>-140.0 10.0 0.0</gx:coord>
<gx:coord>-133.572123903 7.66044443119 4131.75911167</gx:coord>
<gx:coord>-130.15192247 1.73648177667 9698.46310393</gx:coord>
<gx:coord>-131.339745962 -5.0 7500.0</gx:coord>
<gx:coord>-136.579798567 -9.39692620786 1169.77778441</gx:coord>
<gx:coord>-143.420201433 -9.39692620786 1169.77778441</gx:coord>
<gx:coord>-148.660254038 -5.0 7500.0</gx:coord>
<gx:coord>-149.84807753 1.73648177667 9698.46310393</gx:coord>
<gx:coord>-146.427876097 7.66044443119 4131.75911167</gx:coord>
<gx:coord>-140.0 10.0 5.99864288729e-28</gx:coord>
<altitudeMode>absolute</altitudeMode>
<ExtendedData>
<SchemaData schemaUrl="#schema_1">
<gx:SimpleArrayData name="ext">
<gx:value>0.00217237382056</gx:value>
<gx:value>0.107224360838</gx:value>
<gx:value>1.99669920652</gx:value>
<gx:value>14.0278818114</gx:value>
<gx:value>37.1819210687</gx:value>
<gx:value>37.1819210687</gx:value>
<gx:value>14.0278818114</gx:value>
<gx:value>1.99669920652</gx:value>
<gx:value>0.107224360838</gx:value>
<gx:value>0.00217237382056</gx:value>
</gx:SimpleArrayData>
</SchemaData>
</ExtendedData>
</gx:Track>
</Placemark>
</Document>
</kml>
This does look like a bug.
I have created an issue at http://code.google.com/p/earth-issues/issues/detail?id=1399
If you star it then you will be notified of any updates.
Meanwhile you may wish to preprocess your KML data and place interpolated values where you have missing ExtendedData.
Related
I'm using this KML file (lets call it load.kml)
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<NetworkLink>
<refreshVisibility>1</refreshVisibility>
<flyToView>1</flyToView>
<Link> <href>C:\\Users\\bridenstinek\\workspace\\AlertServlet\\resources\\outboundKML\\test.kml</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>20</refreshInterval>
</Link>
</NetworkLink>
</Document>
</kml>
To point Google Earth to a kml file (lets call it test.kml). When I load test.kml regularly (without using load.kml) the range I set works correctly (the zoom level is how I set it).
But when test.kml gets loaded using load.kml the range is incorrect. The placemark zooms in really far and ignores the range I set in the test.kml file.
Is there something overriding the range inside load.kml?
Example of test.kml:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:location="http://example.com">
<Document>
<name>Example</name>
<Style id="alertKMLStyle">
<BalloonStyle>
<text><![CDATA[<center>
<b><font color="#CC0000" size="+8">$[name]</font></b>
<br/></center><br/>
<font size="+2">$[description]</font>
<br/><br/>
]]></text>
</BalloonStyle>
</Style>
<Placemark>
<name>Example Name</name>
<description>Example Description</description>
<LookAt>
<location:coordinates>800</location:coordinates>
<longitude>2.294</longitude>
<latitude>48.858</latitude>
<altitude>0.5</altitude>
<heading>12.23742976490019</heading>
<tilt>0</tilt>
<range>115718.4889366544</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<styleUrl>#alertKMLStyle</styleUrl>
<gx:balloonVisibility>1</gx:balloonVisibility>
<Point>
<gx:drawOrder>1</gx:drawOrder>
<coordinates>2.294,48.858,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
There are a few undocumented differences when you load KML directly as opposed to via a NetworkLink.
When you load the KML via the NetworLink it looks for a LookAt or Camera in the outermost element which is the Document in test.kml file.
You can either 1) copy/move the <LookAt> from the Placemark to the parent Document element in test.kml or 2) copy the <LookAt> and insert into the NetworkLink in load.kml and make flyToView=0.
If the target KML has timestamps then the behavior via Networklinks is different then loading it directly. See related issue.
I am using Google Earth 5.0 Client. I would like to update a KML file (loaded by a NetworkLink) by clicking on a hyperlink in the description/balloonStyle tag of one of its placemarks.
Here is an example:
A.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml>
<NetworkLink>
<Link>
<href>http://www.example.com/B.kml</href>
</Link>
</NetworkLink>
</kml>
B.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml>
<Document>
<Folder id="entities">
<Folder id="en1_folder">
<Placemark id = "en1_point">
<description>
<a href="http://www.example.com/getConnections.php?en=id1"
type="application/vnd.google-earth.kml+xml"> Get connections </a>
</description>
<Point>
<coordinates>...</coordinates>
</Point>
</Placemark>
</Folder>
There are about 500 such folders, each with its corresponding en# point
containing a description hyperlink.
</Folder>
</Document>
</kml>
If a user clicks on a hyperlink, I want to generate a set of LineStrings connecting that point to one or more other points.
For example, getConnections.php?en=id1 could generate a response like this:
<?xml version="1.0" encoding="UTF-8"?>
<kml>
<Update targetHref="http://www.example.com/B.kml">
<Change>
<Folder targetId="en1_folder">
<Placemark id="en1_connections">
<LineString>
<Coordinates>
(en1_coords), (en5_coords), (en7_coords)
</Coordinates>
</LineString>
</Placemark>
</Folder>
</Change>
</Update>
</kml>
This doesn't work in GE 5.0. I understand that Update is a child of NetworkLinkControl which in turn must be requested by a NetworkLink from the same domain as the KML that contains it.
I know there are several workarounds using one or more NetworkLinks, however I am curious to know if there still exists a way to directly update the same KML file by clicking on the description hyperlink.
Any thoughts appreciated.
Thanks,
Max
I'm trying to create a map of the Stockholm's subway lines in Fusional Tables.
In the Fusion Tables I created a map with geo each station:
https://www.google.com/fusiontables/DataSource?docid=1K7F2DMY5JBA6ZQOH8a1a4dQjwxoksRDMJ3-wPEg#map:id=3
I want to connect them to the polyline.
Options to create polylines and way in the tables there, or they are very well hidden.
So I created this KML file and loaded into tables:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Stockholms T-bana</name>
<description>Karta över röda linjen i Stockholms T-bana</description>
<Style id="redLine">
<LineStyle>
<color>FF0000</color>
<width>2</width>
</LineStyle>
</Style>
<Placemark>
<name>Röda linje</name>
<description>T-bana linje</description>
<styleUrl>#redLine</styleUrl>
<LineString>
<tessellate>1</tessellate>
<altitudeMode>absolute</altitudeMode>
<coordinates>59.330947,18.059263,2357
59.335258,18.074055,2357
59.343169,18.081243,2357
59.345826,18.071712,2357
59.365568,18.054891,2357
59.381508,18.036516,2357
59.392019,18.041697,2357
59.398709,18.03622,2357
59.338683,18.091242,2357
59.347202,18.098793,2357
59.357298,18.102218,2357
59.32316,18.06762,2357
59.319309,18.072295,2357
59.316958,18.063308,2357
59.317778,18.050152,2357
59.316057,18.033714,2357</coordinates>
</LineString>
</Placemark>
</Document>
</kml>
Maps created in the table stubbornly opened in the Arabian Sea but not in Stockholm.
https://www.google.com/fusiontables/data?docid=1trp44L7vNDqPVDmTr1yXmGUpBvS7_U6R0MnBsS4#map:id=3
What is my fault? Is there some other way create polylines in tables between objects?
You have the coordinates backwards. KML coordinates are longitude,latitude,altitude.
Sweden:
https://maps.google.com/maps?q=59,18&hl=en&sll=18,59&sspn=61.939621,78.046875&t=m&z=16
Arabian Sea:
https://maps.google.com/maps?q=18,59&hl=en&sll=18,59&sspn=61.939621,78.046875&t=m&z=16
Your KML with the coordinates corrected
The jurisdiction I live in published data using a Google globe. The kml file they point to contains
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:gx="http://www.google.com/kml/ext/2.2">
<gx:GoogleMapsEngineLink>
<href>http://globe.information.qld.gov.au/qldglobe</href>
</gx:GoogleMapsEngineLink>
</kml>
I can't find any reference to the gx:GoogleMapsEngineLink in any public documentation and I am having trouble using that with other standard kml, for example a Place. I'd like a kml that pens this government globe and also adds a Place.
I'd like to be able to add this Place to the Above kml (ie. one kml file)
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns="http://www.opengis.net/kml/2.2"
<Placemark>
<description>Some nice place</description>
<Point>
<coordinates>153.0064595002,-27.4811714996,0</coordinates>
</Point>
<Style>
<LabelStyle>
<color>ff7fffff</color>
</LabelStyle>
</Style>
</Placemark>
</kml>
The Google KML extensions can be found in Google's KML documentation:
https://developers.google.com/kml/documentation/kmlreference#kmlextensions
The complete XML schema for elements in this extension namespace is located at http://developers.google.com/kml/schema/kml22gx.xsd.
gx:GoogleMapsEngineLink is not a documented part of the Google KML extensions as defined in the namespace http://www.google.com/kml/ext/2.2.
Why don't you create a KMZ file with a root KML file and the gx:GoogleMapsEngineLink loaded in a KML embedded in the KMZ file as an auxiliary file.
Root KML file doc.kml:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<NetworkLink>
<Link>
<href>engine.kml</href>
</Link>
</NetworkLink>
<Placemark>
<description>Some nice place</description>
<Point>
<coordinates>153.0064595002,-27.4811714996,0</coordinates>
</Point>
<Style>
<LabelStyle>
<color>ff7fffff</color>
</LabelStyle>
</Style>
</Placemark>
</Document>
</kml>
And the google engine KML (engine.kml) like this:
engine.kml:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<gx:GoogleMapsEngineLink>
<href>http://globe.information.qld.gov.au/qldglobe</href>
</gx:GoogleMapsEngineLink>
</kml>
Update: Since the <gx:GoogleMapsEngineLink> is special and undocumented it doesn't work as would other KML elements so it cannot appear as child to <Document> element or as target to <NetworkLink>. Likewise, if this element appears at the root level with a Document or Placemark following those Features are ignored.
Google announced it will discontinue the Google Maps Engine product in January 2016.
I could not get my KML to Validate as valid XML because my KML includes a gx (Google Extension) tag (<gx:Tour> for example), and www.google.com/kml/ext/2.2/ is a 404 error.
Here is what I finally got to validate after an hour of trial and error:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:gx="http://www.google.com/kml/ext/2.2"
xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/kml/ext/2.2 http://developers.google.com/kml/schema/kml22gx.xsd">
I don't really know what I'm doing exactly, so I can't make any claims this is a kosher or legitimate fix, or whether that's all necessary. But it's the only way I could get it to validate.
I have just started to learn how to manipulate the KML files. here is a problem that I do not know how to overcome.... I created a polygon and added a description to be shown as a balloon, but it appears as soon as Google Earth starts working before the polygon can be seen. what I want is to show the balloon from a specific distance where the polygon appears(for example in the range distance of LookAt element).
anybody knows how to manage that?
my code follows:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" mlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<LookAt>
<longitude>17.99514610290434</longitude>
<latitude>59.36293893395309</latitude>
<altitude>0</altitude>
<range>597.51212259908</range>
<tilt>52.34415598649959</tilt>
<heading>105.3974737169693</heading>
</LookAt>
<Placemark>
<name>Stadium</name>
<description>
<![CDATA[
this is <b><i>Råsunda soccer stadium</i></b>
]]>
</description>
<gx:balloonVisibility>1</gx:balloonVisibility>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>absolute</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>
17.99514610290434,59.36293893395309,100 17.99651951950199,59.36209399425741,100 17.99752330705672,59.36252751885282,100 17.99613146514916,59.36335387902954,100 17.99514610290434,59.36293893395309,100
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
Normally you can skip rendering the polygon until you get "close" enough to it as defined by a Region element which is determined by calculating when a given area maps to a min or max # of pixels.
Also, the <gx:balloonVisibility> tag forces the description balloon to appear when the KML is loaded regardless of whether Region is active. Adding a Region direct in the KML still shows the popup balloon.
To do what you want to do, you must wrap the KML file with a second KML file with a NetworkLink with a Region that loads the seconds KML only when the region is active (aka close enough) at which time the description is displayed along with the polygon.
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<LookAt>
<longitude>17.99514610290434</longitude>
<latitude>59.36293893395309</latitude>
<altitude>0</altitude>
<heading>105.3974737169693</heading>
<tilt>52.34415598649959</tilt>
<range>597.51212259908</range>
</LookAt>
<NetworkLink>
<Region>
<LatLonAltBox>
<north>59.363792</north>
<south>59.361556</south>
<east>17.998029</east>
<west>17.994443</west>
</LatLonAltBox>
<Lod>
<minLodPixels>128</minLodPixels>
<maxLodPixels>-1</maxLodPixels>
</Lod>
</Region>
<Link>
<href>target.kml</href>
</Link>
</NetworkLink>
</Document>
</kml>
And target.kml file contains the original KML you gave:
<?xml version="1.0" encoding="ISO-8859-1"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Stadium</name>
...
</Placemark>
</kml>
You can change the distance the feature + balloon appears by adjusting the minLodPixels value and/or the size of the region. At present the feature will display when the region defined by area surrounding the polygon is at least 128 pixels on the screen. Change to 32 or 64 and/or make the region area larger to make it appear quicker.
Note Google Earth client doesn't give you a tool to edit or even see the Region bounding boxes on the map so debugging this is tricky. You can paste your KML into this tool to generate KML making the Region bounding area visible. This helps to debug Regions more easily.