Specific lat lng in KML can't be shown - kml

I am trying to show the following coordinates in kml but it can't be shown correctly with Google Maps:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>Invercargill Rocks!</name>
<description>Go there and see!</description>
<Point>
<coordinates>43.006687,144.391647</coordinates>
</Point>
</Placemark>
</kml>
I use the following site to check if the kml works:
http://display-kml.appspot.com/
It works with the following coordinates but doesn't work with mine.
(works) 168.34693908691406,-46.416322245553296
(doesn't work) 43.006687,144.391647
Could you somebody tell me why?

As geocodezip mentioned, the correct order has to be lng and lat.

Related

Google Earth places placemarks at wrong location [duplicate]

This question already has an answer here:
After importing KML to Google Maps, point is showing in Antartica
(1 answer)
Closed 7 years ago.
I have been trying to locate the place marks of the data I logged.
I used the following KML code to locate my points as Placemarks.Unfortunately and Surprisingly the points are placed at wrong location.I am just wondering if there is any error in my KML code.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns = "http://earth.google.com/kml/2.1">
<Document>
<Style id="icon_id">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/kml/paddle/blu-blank.png</href>
<scale>1.0</scale>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name>04-02-2015</name>
<description>Points</description>
<styleUrl>#icon_id</styleUrl>
<Point>
<coordinates>39.6495820075,-79.96055352125</coordinates>
</Point>
</Placemark>
<Placemark>
<name>04-02-2015</name>
<description>Points</description>
<styleUrl>#icon_id</styleUrl>
<Point>
<coordinates>39.649492665,-79.96053303</coordinates>
</Point>
</Placemark>
</Document>
</kml>
I also tried locating the points manually on Google Earth and they show the location perfectly.But when I try running the KML code it screws me.
p.s. The points are supposed to be in WV,US while Google Earth Places it at some place in Antarctica.
I used Android LocationManager API to log my latitude and longitude values.
Yes its a map Projection.
I went through the following link https://support.google.com/earth/answer/148110?hl=en and as suggested used a tool available at http://www.earthpoint.us/Convert.aspx to convert my coordinates and worked.
The change made was writing in the order <coordinates>longitude,latitude</coordinates> instead of
<coordinates>latitude, longitude</coordinates> from the (latitude,longitude) pair generated by Android Location Manager API.

Create KML route

I am trying to create a route based off lon & lat's. This is what i have so far, but it doesn't seem to be working correctly.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<PlaceMark>
<name>test</name>
<description>test Desc</description>
<Point>
<coordinates>-80.54400115,43.4250264</coordinates>
<coordinates>-80.52674314,43.43127701</coordinates>
...
</Point>
</PlaceMark>
</Document>
<kml>
Is the syntax correct? When i load it up in my maps app, it doesn't show the route.
Please see the KML reference
KML is XML which is case sensitive (PlaceMark is not the same as Placemark)
a <Point> is a single location
a line is a <LineString>
Your XML needs to be valid (</kml> is needed to close the opening <kml>).
example
KML from example above on Google Maps
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2"> <Document>
<Placemark><name>test</name>
<description>test Desc</description>
<LineString>
<coordinates>
-80.54400115,43.4250264
-80.52674314,43.43127701
-80.5274517,43.43458707
-80.53223781,43.43876923
-80.54385782,43.44993036
-80.53949137,43.45723788
-80.53950793,43.46780893
-80.53352615,43.4730443
-80.53491389,43.47816267
-80.54136061,43.48417145
-80.54163034,43.48439869
</coordinates>
</LineString>
</Placemark></Document>
</kml>

kml google extensions not in schema

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.

delaying balloon component in a KML code

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.

Google Earth elevation profile and the missing values

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.

Resources