blankblank blank


Archive for November, 2007 Page 2 of 2



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’




World Digital Magnetic Anomaly Map (WDMAM) Released

The BBC has an article on the release of the first worldwide map of magnetic anomalies, deviations in the earth’s magnetic field due to effects from magnetized crustal rocks. Nice views of the magnetic striping on either side of the Mid-Atlantic Ridge resulting from ocean-floor spreading (the driver of continental drift) and prehistoric reverses in the direction of the earth’s magnetic field:

magnetic

From the Commission for the Geological Map of the World, which has links to this and other small-scale world geology maps for sale; the BBC article has a link to a free high-resolution PDF map of the magnetic anomaly map.




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.