I've draw a path in Google Earth and then tried to export it as a kml file. I've done the trick with copy paste and it worked. I could create a kml file with all coordinates on it, unfortunately the altitude of each is coordinates is always set to 0. I have tried every altitude modes, from absolute, relativeToGround, relativeToSeaFloor, clampToGround and clampToSeaFloor and still got 0 on each.
<LineString>
<tessellate>1</tessellate>
<gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>
<coordinates>
-0.03577057649673097,43.76757757633825,0
-0.03574088790371616,43.76768808940936,0
-0.03575433162010139,43.7677802270933,0
-0.03582561152308676,43.76788089757672,0
</coordinates>
</LineString>
The strange is, the elevation profile of the path on Google Earth is correct. I must do something wrong when i export to the kml file.
Can anyone tell me, how i can export the path that i have draw with the correct altitude values to a kml file ?
Its working absolutely correct. You specify 'clampto(sea)floor' - so get a line that hugs terrain.
If you want heights for your file - you have to get it from another source.
I made a tool for it: http://www.nearby.org.uk/elevation-kml.php
Related
I am trying to get the path data points from an SVG file I am creating for an image-map. The code should look like the below after I save to an SVG file:
<svg height="210" width="400">
<path d="M150 0 L75 200 L225 200 Z" />
</svg>
However, when saving and/or exporting the file, I am getting a bunch of gibberish instead of data points and it looks like the below:
<image id="image4125" opacity=".5" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAAEUCAYAAAAskArpAAAACXBIWXMAABYlAAAWJQFJUiTwAAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAJYNJREFUeNrsnQd8FNX2x6dsb9nN 7qb3SrqU0ATpIcEnIA9QKRZEUB/6pINYEFFqDH8bwkOeFJGm0t5LqIbewZBAIKQXAtlNdtO37z83...
I have tried using both Adobe Illustrator CC and Inkscape. Any idea how to extract the correct data points using either of these programs, or why I am getting gibberish instead of the data points? I have followed multiple instructions on different websites (including this thread on StackOverflow).
Right now I can get data points to make a rectangle of each area, but the rectangular data points overlap and conflict with other. I am trying to create a polygon path and extract the data points so each shape is unique. Any help is much appreciated.
After a week of research and many tears shed, I finally found the solution. To create SVG images with the path data included when using Adobe Photoshop and Illustrator CC, follow these instructions:
Cut up your image using Photoshop with layers of the image. Save the file as .psd.
Open .psd file in Illustrator. You will then be able to select the different images you cut up in Photoshop.
Select a single image. Open up image trace and trace the image using the Silhouettes preset option.
Click on the Expand button (you will notice the silhouette of your image now has points around the edges; these are your data points).
Open up the color palette. Make the top color white with a red line through it (this removes the fill of the silhouette). Then make the bottom color black (this traces over the trace line between the points).
Finally, on the Attributes panel, you will want to set the image map to Polygon (you can add a new to the attribute below if wanted).
After you repeat these steps over each image layer, you will then save the file as an .svg file with the following settings:
• SVG Profiles: SVG 1.1
• Subsetting: None
• Image location: Link
• Preserve Illustrator Editing Capabilities: unchecked (this will reduce the size of your file for better performance.
• CSS Properties: Style Elements
• Output fewer tspan elements: checked
• Use textPath elements for the text on path: checked
• Responsive: checked
After the file is saved with these options, you will then be able to open the .svg in Sublime, WebStorm, TextEdit, etc., and the path data will be included in the HTML. It is a beautiful sight! Hope this helps whoever is seeking the answer to my same problem!
There is a KML file that I created by exporting a layer from ArcGIS10.0. The file shows some placemarks that I need to be labeled. However, I want the labels (and the points themselves) to be visible in Google Earth only at or below a certain altitude. I know that using the <Region> tag is the way to do this, but, with a triple-digit number of placemarks, typing in the tag and all the rest of the code for every single placemark does not seem very practical.
The points are all located in one folder, and I wonder if I can use <Region> at the folder level. However, placing <Region> and the rest of the code after the <folder> tag and </Region> just before </folder> did not work. If I am to modify the behavior of the labels at the folder level, where should I place the tags?
Also, how do I edit KML code? I know that I can right-click a file in Google Earth, copy it, and paste the code into a text editor, but how do I get the edited code back into the file?
Sorry for such trivial questions, I'm as new to KML as can be.
By the sound of it, you've tried this:
<folder>
<region>
<placemark></placemark>
<placemark></placemark>
<placemark></placemark>
...
</region>
</folder>
From the KML documentation:
Also, within the KML file, notice that the Region is a sibling of the
image (or geometry) whose visibility it affects.
Therefore what you want to do is this:
<folder>
<region>
[scale limits go here]
</region>
<placemark></placemark>
<placemark></placemark>
<placemark></placemark>
...
</folder>
In terms of editing the KML file - just open it directly in your text editor, don't copy it out of Google Earth.
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.
I think I have found an error in GE V7.0.1.8244. I create a KML route file and display it with setAltitudeMode set to ALTITUDE_CLAMP_TO_GROUND. In GE V6.2.2.6613 it displays correctly but in V7.0.1.8244 (currently beta) it does not. Same program source, same data. See attached image here:
.
Any ideas anybody other than installing an other version of GE?
This is clearly a bug in GE 7.0. A few of the elements in the KML test file are out of order but nothing to cause this problem. Even if you drop the altitude values and change altitudeMode to relativeToGround it gets worse not better. Neither DirectX or OpenGL mode makes a difference.
You can report the issue here to get any updates on the problem:
http://code.google.com/p/earth-issues/issues/list
Might be an error in elevation data. You can also see this error in the sample line example if you zoom close to the path.
Only short-term fix is reverting back to GE 6.2.2 if want to view this KML correctly, otherwise, wait for a fix.
UPDATE: Issue in Google Earth issue tracker can be found here.
It does look like a bug, rather than down grading though you could look to use one of the Google Earth extensions - specifically the gx:altitudeOffset element. From the docs...
A KML extension, in the Google extension namespace, that modifies how
the altitude values are rendered. This offset allows you to move an
entire LinearRing up or down as a unit without modifying all the
individual coordinate values that make up the LinearRing. (Although
the LinearRing is displayed using the altitude offset value, the
original altitude values are preserved in the KML file.) Units are in
meters.
This should allow you to raise the path by a meter so that the clipping doesn't occur.
It is also worth noting that...
In Google Earth, a Polygon with an of clampToGround
follows lines of constant bearing; however, a LinearRing (by itself)
with an of clampToGround follows great circle lines.
So perhaps you need to adjust your path to account for this discrepancy?
i am working on SVG, problem i am facing is that i want to read the path and after reading it i want to draw the circles through tag used in svg, on that path, kindly help me out any help will be awesome...Thanks in Advance :)
The information you have provided still does not make sense to me. Here's a guess at what you might be looking for.
If you have a <path> element and you want to place circles along the path, you can use the getPointAtLength() method to find the location at an arbitrary distance along the path.
Then you can create <circle> elements (or <use> elements that reference a circle) and place them at this location.
Here is a demo that uses this technique (and also happens to create a <polygon> of the result):
http://phrogz.net/svg/convert_path_to_polygon.xhtml