blankblank blank


Archive for the 'Google Earth' Category Page 11 of 25



Text Editor With KML Validation

Google has a video tutorial on how to set up the free Java text editor jEdit so that it will automatically validate KML as you type it in. Given how picky KML is about cases (capital letters) compared to HTML, this is a nice capability to have for both creating and debugging KML files. Now if someone would only create a KML plugin for jEdit …

The Google Outreach page has other great Google Earth tutorials:




Creating GPS Routes And Tracks In Google Earth

EarthNC has a new Google Earth tool for taking points, paths, and polygons created in Google Earth, and either converting them to GPX or uploading them directly to a Garmin GPS (Windows only for the latter). Points are converted to points, paths to routes, and polygons to tracks. The downloadable KML file, full text instructions, and a demonstration video, are available at the website. They also have a simple online tool for converting KML files directly to GPX format by copying the KML file into the online text box and clicking a conversion button.

Via Ogle Earth.




Creating Google Earth Screen Overlays With EarthPaint

Last week, I covered my KML Screen Overlay Maker utility, which simplifies the job of converting graphics into Google Earth screen overlays. It occurred to me that this utility could be used in conjunction with the free utility EarthPaint to create screen overlays. I’ve covered EarthPaint before – it’s a useful tool for creating Google Earth ground overlay files using vector-graphic-like drawing tools (lines, circles, ellipses, polygons, text, etc.). But the graphic file it generates can be used along with the KML Screen Overlay Maker to create a screen overlay instead of a ground overlay.

1. Start up EarthPaint; Google Earth will start up at the same time.

2. You’ll be given the option to either use the current location in Google Earth, or set a new one. Doesn’t matter which one you choose, since you’ll be creating a fixed screen overlay.

3. EarthPaint will load in a black-and-white image of the current view in Google Earth. Use this image as a guide as you draw the elements you want in your screen overlay, with the edges of the image defining the limits of the screen overlay graphic. There’s more info on this in my original EarthPaint post.

4. When done, click on Create => Send to Google Earth. You’ll be asked to enter a name for the overlay graphic; after clicking OK, the graphic image you created in step 3 will be opened in Google Earth as a ground overlay. It’s a GIF file with transparency, which makes it perfect for creating a screen overlay.

5. Go to the program directory for EarthPaint (default is C:\Program Files\EarthPlot Software\EarthPaint. Open the “Cache” subdirectory, and look for a GIF file that has the name assigned in step 4. Copy this GIF file to another location.

6. Start up the KML Screen Overlay Maker, and select the GIF graphic file from step 5.

7. Leave the Overlay Size units, x and y, as fraction, and enter “1” for the value of both of those. This will automatically resize the overlay graphic to fit to the edges of the view in Google Earth. Leave everything else as is.

8. Save the file, and then open it up in Google Earth (with the Network Link option in KML Screen Overlay Maker if you want). You should now see the graphic image created in step 3 as a screen overlay that doesn’t move as you change the view in Google Earth.




KML Circle Generator

Site appears to be down; try theĀ GE Path program as an alternative.

KML-Circles is an online app that creates open or filled polygons around a specified center point. With the default number of 60 vertices, you essentially create circles, but by selecting a small number, you can create other polygons (e.g. 3 for a triangle, 4 for a square), but with no control over their orientation. It operates in two different styles:

Continue reading ‘KML Circle Generator’




KML Screen Overlay Maker Utility, Concluded

Continuing on from yesterday’s post about my utility to create Google Earth screen overlays …

ScreenOverlay

Rotation: Sets the rotation angle and axis. The angle needs to be between -180 and +180, and counter-intuitively clockwise is negative, counterclockwise is positive. Default (and blank) is no rotation. The “x” and “y” sets the position of the rotation axis for the image relative to the lower-left-hand corner of the image. Leaving this blank sets the rotation axis in the center of the image. Units, selected by the dropdown, are:

  • fraction – The fraction across the image screen where you want the reference point, e.g. 0.5 is halfway across the image. Can be greater than 1 or negative, which sets the rotation axis outside of the image.
  • pixels – The pixel position for the origin measured from the lower left-hand corner of the screen. Can be larger than the image size, or negative, which sets the rotation axis outside of the image.
  • insetPixels – Similar to pixels, but measures from the upper-right-hand corner of the screen. Can be larger than the image size, or negative, which sets the rotation axis outside of the image.

Auto-Refresh: See the Save/Refresh section below for info on this

Overlay size: This sets the size of the overlay image on the Google Earth screen. The default, with the data blank, uses the native pixel size for the image. The top dropdown sets the units, either fraction of the Google Earth screen size or pixels. In the bottom dropdown, you can enter the desired fraction or pixel size, but you also have two dropdown choices:

  • Maintain native size: Keeps that dimension at its original size in pixels, regardless of the units set above;
  • Maintain aspect ratio: As you change the other dimension, this dimension will be scaled up to maintain the image’s aspect ratio. This will keep the image from getting grossly distorted in one direction as you increase or decrease its size in the other direction.

Set Transparency: Sets the overlay transparency from fully transparent (invisible) at the left slider position to fully opaque at the right.

Save As: Lets you select the screen overlay KML filename and save it; filename is displayed in the yellow box above the button. Once you’ve saved a file once, the next two buttons are enabled.

Create Network Link And Open In Google Earth: Clicking this button creates a network link to the KML screen overlay file, and loads it in Google Earth (if Google Earth is not installed in its default location, you’ll be prompted to specify where the Google Earth executable is located). This will display the last saved version of the overlay in Google Earth, and update that view every second. So if you change any of the parameters, and then click the Save/Refresh button, one second later the modified screen overlay will show up in Google Earth, letting you see the effects of the change immediately.

Save/Refresh: If you change any of the parameters and want to save them under the same filename, click this button. If you have created a network link using the above button, the screen overlay in Google Earth will also be refreshed/updated with this button. If you have the Auto-Refresh box checked, the overlay will be saved automatically under the current filename any time you change a parameter, and you won’t have to keep clicking the Save/Refresh button to update the overlay in Google Earth. This can be useful in the final stages of tweaking the results, but you might want to have this turned off in the early stages lest it drive you nuts.

New Program Window: If you want to put multiple graphic elements into Google Earth at once to see how they’ll look relative to each other, clicking this button will open up another program window so that you can create multiple screen overlays at the same time. Once you’ve created the individual screen overlay KML files, you can open them all and put them into a single Google Earth folder to keep them together.

Help: Brings you to the posts on this blog (the lazy programmer’s help page)

Exit: Guess …

Don’t forget that the KML screen overlay file you’ve created references the graphic to its location on your hard drive. If you want to create a portable screen overlay file that you can send to someone else, you should save it in KMZ format from Google Earth.

That’s it. Download the small executable file here, or the much larger full install file here. As usual, use at your own risk, and report bugs/quirks to me. The alpha testers didn’t indicate any serious problems, and the program doesn’t alter any of your original data, so problems should be minimal.

Other free utilities can be found on the Utilities page. If you find this or any of my other utilities particularly useful and would like to show your appreciation, donations of any amount are gratefully accepted via PayPal.




The KML Screen Overlay Maker Utility

Yesterday’s post dealt with the basics of what a Google Earth screen overlay is, and some of its possible applications. But you can’t create or edit a screen overlay in Google Earth, so until now you’d have to create it in KML with a text editor or stand-alone KML editor. I’ve written a small utility for Google Earth that lets you create a screen overlay from a graphic file for Google Earth with a GUI, and also lets you modify the parameters and see the changes in the screen overlay immediately in Google Earth.

You can download the small executable file here, and it will probably work fine as is. If you get error messages about missing files, or if you want the full install with a Start Menu item, you can download the full install package. Here’s the program interface:

ScreenOverlay

The unusual aspect ratio (taller than it is wide) is so you can drag it to the left side over the Google Earth view, where it will block less of the globe and overlay view. This may help you better see the effects of modifying screen overlay parameters.

The various option sections, from top to bottom:

Select graphic overlay file: Click on the button to choose the single graphic file to use as an overlay (if you want multiple graphic images in your Google Earth screen, you can create multiple screen overlay files and load them all into Google Earth). Supported graphic formats are TIF, BMP, JPG, GIF, PNG, TGA, PGM, DDS and PPM; transparency is supported for GIF and PNG files. As soon as you select a graphic file, the “Save As” button will be enabled; saving the screen overlay without changing any of the parameters will place the graphic image in the center of the Google Earth screen at its original pixel dimensions. The full filename (with path) will be displayed in the yellow box.

Overlay title: This is the title that will be associated with the overlay in the Google Earth Places pane at left.

Preset positions: Enters preset parameters to position the graphic image at the specified location on the screen, at its original pixel size.

Overlay dimensions (for reference only): When positioning the graphic and setting some of the parameters, it can be useful to know the native pixel dimensions of the overlay image. You don’t need them for creating an overlay, so they’re there just there for reference. When you open GIF, JPG and BMP images, the pixel dimensions will be entered automatically; for other image types, you can enter those manually after determining them some other ways (like right-clicking on a graphic file and choosing Properties).

Screen Parameters: Sets the “point relative to the screen origin that the overlay image is mapped to”, where the screen origin (x=0, y=0) is in the lower left corner. There are three options for units, set by the dropdown:

  • fraction – The fraction across the image screen where you want the reference point, e.g. 0.5 is halfway across the screen. I’d recommend using the fraction unit option instead of the next two pixel-based options because the overlay will behave better across a wider range of screen resolutions. Can be greater than 1 or negative, but for some screen parameters this can position the overlay out of sight.
  • pixels – The pixel position for the origin measured from the lower left-hand corner of the screen. Can be larger than the screen size, or negative, but this may also position overlay out of sight.
  • insetPixels – Similar to pixels, but measures from the upper-right-hand corner of the screen.

Default value is fraction; if you don’t enter values below the units, the default is the center of the screen.

Overlay Parameters: Similar to Screen Parameters, sets the reference point for the overlay image. Same units (and caveats as above).

For example, if you set the units and parameters for both the screen and overlay to fraction (0.5,0.5), you’ll position the image directly in the middle of the screen for all screen resolutions and sizes. Change the screen to (0,1), and the overlay will be positioned in the upper left corner with only the lower-right-quadrant visible; change overlay to (0,1) as well, and the entire overlay will be visible in that corner.

Draw Order: An integer that sets the draw order if you have multiple overlays; overlays with higher draw order numbers will go on top of ones with lower numbers. For example, an overlay with a draw number of 3 will be drawn on top of an overlay with draw number 1. If this is blank, the default is 0.

The rest tomorrow …

Other free utilities can be found on the Utilities page. If you find this or any of my other utilities particularly useful and would like to show your appreciation, donations of any amount are gratefully accepted via PayPal.




Screen Overlays In Google Earth

Many people are familiar with ground overlays in Google Earth, which drapes a graphic image (like a map) over the terrain in Google Earth. I’d guess that fewer people are familiar with screen overlays, since unlike ground overlays you can’t create and edit them directly in Google Earth, but have to create and edit them in the KML file. A screen overlay is a graphic that’s “embedded” in the viewing screen, so that it doesn’t change as you move around the globe, or change the viewing angle. If I display a screen overlay at one viewing angle and height:

Continue reading ‘Screen Overlays In Google Earth’




KML Time Code Utility

Frank at Google Earth Blog links to a new Google article on the nuts-and-bolts of KML time coding, which goes into far greater detail than my own simple post. Not too long ago, I created a simple utility for embedding time data into a KML file after the first feature tag, and which doesn’t require you to fiddle with the KML code. It has the limitation that it only embeds basic time data after the first KML feature tag; if you have multiple feature tags in a KML file, and want to embed separate time data for each of them, my utility won’t help. And if you read the Google article and want to get more creative with time coding, you’ll have to manually write the KML time code yourself and put it into the KML file within the corresponding feature section.

I’ve created a stripped-down version of that KML time utility called “KML Time Code Creator” that lets you set the TimeSpan or TimeStamp with a GUI, and then creates the properly formatted KML time code to copy and paste into your own KML file. Download the executable file here; if you get error message about missing files, download and install the full version of the KML Time Embedder Utility, which installs the required files.

KMLTimeCode

Setting time parameters is done the same as in my KML Time Embedder utility, so I’ll refer you to those posts for details. Once you’ve set and verified the time parameters, click on the “Create KML Time Code” button at upper left, and the KML time code will be generated and displayed in the white text box. You can copy the text in this box to the clipboard with the appropriate button at left, and then paste it into your own KML file. Nothing fancy, but it does the job.

Other free utilities can be found on the Utilities page. If you find this or any of my other utilities particularly useful and would like to show your appreciation, donations of any amount are gratefully accepted via PayPal.