Convert a Google Earth kml to a Google maps kml - Using image overlays - kml

I have created a kml file with Google Earth that creates an overlay using an external image. It works well, and I would like to find a reasonably convenient way of converting the kml so that Google Maps can read it and display it in a similar fashion.
Google Maps cannot process Google Earth coordinates, so I attempted to convert them myself. For instance I replaced the Earth Coordinates:
<gx:LatLonQuad>
<coordinates>
-80.34344837780532,33.1105864538138,0
-80.31934785561177,33.09410014458361,0
-80.30034967982111,33.11373571527255,0
-80.32473786478347,33.13044135685429,0
</coordinates>
</gx:LatLonQuad>
with the equivalent Maps coordinates:
<LatLonBox>
<north>33.13044135685429</north>
<south>33.11373571527255</south>
<east>-80.31934785561177</east>
<west>-80.34344837780532</west>
</LatLonBox>
Unfortunately, the are not exactly "equivalent". The Maps overlay is slightly off and rotated incorrectly.
Here are the images from the two:
Earth Example
Maps Example
I can see why it doesn't work, but I'm at a loss as to another solution. Anyone know of a simple way to convert a Google Earth kml to a Google Maps kml when an image overlay is involved?

Per the KML reference a <LatLonBox> also has a rotation. Not sure if that is supported for Google Maps, but it should address the issue you are having. The <gx:LatLonQuad> allows you do specify a rotated box (which is what you are doing), this is what that specifies:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/GoogleEarthPolygon.kml
According to the KML reference for Google Maps, LatLonBox is supported, rotation is not:
KML Element Supported in Google Maps?
<LatLonBox> yes
<rotation> no
therefore you need to make your overlay align on north/south east/west boundaries (a non-rotated LatLonBox) to work on Google Maps.
You have a problem with your computed LatLonBox (the small blue box), you want the green box:
http://www.geocodezip.com/v3_GoogleEx_layer-kml_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/GoogleEarthPolygonA.kml
I think the only way to fix this is to take your original image rotate it and save an image aligned on north/south east/west boundaries that fits in the bigger box.
Either that or make a custom overlay that supports rotation somehow.

Related

Self intersecting polygons after import into Google Earth

There are some unexpected artifacts when importing the merged polygons ("dissolve all" function in QGIS) into Google Earth as KML or SHP.
I also tried merging the polygons using the C# Clipper library, but exactly the same result.
Polygons before "dissolve all"
Result in QGIS:
This is how it looks in Google Earth:
It seems like the problem in Google Earth is caused by self-intersecting polygons.
Update: When I ran "Geometry Tools > Simplify Geometries" in QGIS it fixed the self-intersecting polygons somehow. In the results it said it simplified from 78319 points to 76322, but it is still unclear what it actually changed.
Looking at your images it appears you haven't transformed the projection of your data. (the circles are more perfect in google earth and is more elliptical in your QGIS image). Try to re project your data to WGS84

Visible zoom level for GroundOverlay in KML?

First off, I apologize if this is a novice question and/or if it has been asked already. I'm new to KML and so far, searching for 'GroundOverlay' and 'zoom' hasn't helped me.
I have created a KMZ file from an ESRI ArcGIS Layer. The KMZ includes a GroundOverlay (which is a PNG image). The KMZ opens and works fine in Google Earth, but now I would like to limit its visibility. My data is for the continental 48 US States and is meant to be viewed as such. So, zooming in to a 500-mile eye alt in Google Earth doesn't do the user any good. Is there a setting for GroundOverlay that turns its visibility off when the user is zoomed in to a specific level in Google Earth?
Thanks!
Making features visible in Google Earth when you're zoomed in/out can be controlled by adding a Region to your GroundOverlay. Same concept works for any KML Feature (i.e., Document, Folder, Placemark, GroundOverlay, NetworkLink, etc.)
You can simply add a Region to your GroundOverlay with maxLodPixels value to make it disappear when you're zoomed in. A more advanced setup could have smaller region-sized image overlays rather than a singe continent-sized overlay where each GroundOverlay has a Region for when when that overlay is visible. The visibility of the Region is defined when the bounds of the region (via LatLonAltBox) with respect to a minimum or maximum pixel size.
Note, however, that Google Earth won't let you create or edit a Region on a GroundOverlay directly so you'll need to add that to your KML outside of Google Earth. This and other limitations in Google Earth are listed here.
To get a feel for pixel sizes on the screen and create appropriate minimum pixel size (minLodPixels) and maximum size (maxLodPixels) you can measure the "screen" pixels dimensions with the KML screen ruler. Click "Raw" link to view raw KML then save locally and launch in Google Earth.

Using writekml in stata to create maps in google earth

I'm trying to use writekml in stata to create a kml map that can open in Google earth. I have the exact geographic coordinates of the places I need to map and they're stored under variable headers "latitude" and "longitude." The command I run is:
writekml, filename(xyzmap) plcategory(village_types)
The file is exporting but its showing up blank and and none of the markers are showing in google earth.
Note:
I've created maps using shapefiles but i want the ones in Google maps because of the greater detail
I've been able to manually convert an xls file containing the latitudes and longitudes to kml and then opening it with Google earth so I definitely know the coordinates are fine.

Stop dimming / color change of overlapping placemarks on Google Earth

I'm using Google Earth to display point data as placemarks. The data is on a color-coded scale, and so it's pretty important that they keep their colors (which are set via a series of differently colored icons)
However, Google Earth seems to have a 'feature' whereby it dims some placemarks if they overlap. I can find no reference to this feature, nor any way to avoid it, turn it off, using KML or otherwise.
The question was originally asked here:
https://groups.google.com/a/googleproductforums.com/forum/#!topic/earth/DTl6yGLvPvw
Where there are also screenshots of the problem.
Thanks!

Question concerning google earth placemark balloons

Does anybody know a way of styling a google earth placemark balloon differently than the original one looks like? i am not talking about the kml data i put into the balloon. i know how to style this. I am talking about the bubble itself, I would like to have it lesser rounded and with a far lesser padding. Also, i'd like to have it closer to the placemark icon. how can i realize this?
Unfortunately, no - the basic style of the balloon is determined by the application and there is no exposed way to alter it. However, you could use image based screen overlays rather than balloons if stylistic concerns are your priority.

Resources