blankblank blank


Archive for the 'KML' Category Page 10 of 16



Beta Version Of DNRGarmin

One of the first posts on this blog was about the 5.1.1 stable version of DNRGarmin. Long story short, if you work with GIS and you use Garmin units for your data acquisition, this program is a must-have. It can upload/download data in text, DBF and shapefile formats to/from Garmin GPS units, and also comes with an extension for direct interfacing with ArcGIS software. Version 5.1.1 had some utility for non-Garmin GPS units and applications, but version 5.2, currently in beta, has some new features that make it a worthwhile installation for anyone with a GPS.

DNRGarmin has actually been in beta for a while, and I’d been waiting to see if it would come out of beta; the date on the last release is 5/18/07. The webpage indicates in big bold letters that in the beta, “THE ERROR RELATED TO USB CONNECTIVITY AND LOGIN RIGHTS HAS NOT YET BEEN RESOLVED“. But I’ve installed it successfully on 3 different computers without encountering this problem, so there’s a decent chance it should work on yours as well.

New features in version 5.2 include:

  • Load data in KML and GPX (in addition to the previous options of text, DBF and shapefile formats)
  • Load data directly from the “My Place” pane in Google Earth
  • Save data in KML and GPX (along with the previous options of projected/unprojected shapefiles, text and DBF)
  • Convert between the different formats
  • Collects waypoint time data from supported units

Note: The new version’s ArcGIS extension no longer works with ArcGIS 8.x, only 9.x. If that’s important to you, you should stick with version 8.1.1, still available on the web page. But the new version works fine in stand-alone mode.




Using The KML Time Embedder, Concluded

Continuing on from the last post about the KML Time Embedder (download just the executable here, or the full install here), a utility to embed time data into a KML file:

fullscreen

Correct for local time zone: The default time zone for Google Earth times is UTC (aka Greenwich Mean Time), so a day runs from 00:00 to 23:59 UTC; you can set the time for your local time zone, but you have to know where to go in the time options to do this. For longer periods of time, the offset between local time and UTC might not make a difference. But if the time period is short, and the exact start and end of the day need to occur for the data’s local time zone, then check this box, and select the offset from UTC from the dropdown; this specifies the timezone for which the data is valid:

timezone

Embed Time Information: Once you’ve set the input and output filenames, this control is enabled, but you’ll get an error message if you haven’t set a beginning or end time for TimeSpan, or a single time for TimeStamp. If you have, then the time data will be embedded after the first feature tag found in the file. Feature tags are:

  • <Folder>
  • <Document>
  • <Placemark>
  • <GroundOverlay>
  • <ScreenOverlay>
  • <PhotoOverlay>
  • <NetworkLink>

You’ll get a message window when the file is created, but that’s no guarantee that it’s valid.

Reset All: Resets everything.

Reset Dates: Leaves the filenames and UTC checkbox alone, but resets all the date settings.

Help: Opens the first post about this utility on this website (the poor man’s help file)

Exit: Quits the program.

Despite all the caveats I’ve given, the alpha testers have yet to report a serious problem with this utility in its current form, so hopefully you shouldn’t have any major problems. If you do find any bugs, drop me a line with the specifics, and the problem KML file if possible, and I’ll try to fix it. The usual disclaimers: use at your own risk, not responsible for any damage, etc.. Given that it doesn’t re-write the original file under any circumstance, and only writes text files to your hard drive, the worst thing it could probably do is not work.

This program is useful not just for assigning specific times to KML features, but also generic times that let you create animations, like animated GIFs, or showing the effects of a rising sea level on Manhattan, where the KML features are associated with a time only to create an animated effect.

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.




Using The KML Time Embedder To Stamp Time Data Into A Google Earth File

Since Google Earth currently doesn’t let you add time data to a KML file, you have to use an alternate approach like manually editing the KML file, or using one of several different spreadsheet-oriented methods. I’ve put together a third option, a “simple” Windows utility called “KML Time Embedder” that will let you specify the time information in a GUI, and embed it automatically into a KML file. There are a few limitations on its use:

1. KML files only, not KMZ (but if you have a KMZ file, you can open it in Google Earth and then save it as a KML file)

2. Only simple unstyled feature tags will work, e.g. <Document> will work while the valid <Document id=”Yourstyle”> won’t; if this turns out to be a problem for a lot of people, I might fix it. But then again, if you’re adding style IDs to KML, you’re probably wouldn’t use this utility anyway.

3. Only the first feature tag will have time data embedded after it; if this is a problem, you can always save individual KML files for every separate feature using Google Earth. Feature tags are:

  • <Folder>
  • <Document>
  • <Placemark>
  • <GroundOverlay>
  • <ScreenOverlay>
  • <PhotoOverlay>
  • <NetworkLink>

4. If a document already has time data embedded in it, it will be rejected.

5. There is some error-checking, but I suspect it’s not complete, so I’ve added a “verify” function that lets you manually inspect the time information before embedding it into the file.

6. This version only embeds date time, not hour/minute/second time; if enough people ask, I might add that capability. Done! Visit this post for the details.

I’ve posted two zip files with the program. The first one is just the executable (21 kB zipped) and requires some VB6 files that are probably already installed on your computer (especially if you’re running Windows XP SP2). If it doesn’t work, or if you want the full bells-and-whistles installation with a Start Menu item, try the full install package (2 MB zipped).

When the program runs, you’ll get the following extra-fancy interface:

fullscreen

The functions are:

Open Input KML File: Selects the KML file you want to embed time data into. If it finds time data already present, it will reject the file (see #4 above). If it can’t find an acceptable “feature” tag, it gets rejected as well (see #2 above).

Enter Output KML File: Select the name of the output file. It will check to make sure you’re not specifying the input filename as the output file, and also prompt you if you select an existing filename to make sure you want to overwrite it.

Auto Output File: After you’ve enter the time data, pressing this button will create an output filename by appending the time data to the end of the input filename.

KML Time Info Mode: Specifies the type of time data to be embedded.

– TimeSpan is for data that is associated with a starting and ending time. If the time runs from a start time to the present, just leave the end TimeSpan blank.

– TimeStamp is for data associated with a single specific time; selecting this disables the “end TimeSpan” input.

Enter beginning/end of TimeSpan, or TimeStamp data: After you select the input file, you can enter the beginning time and/or end time if appropriate, or just a TimeStamp (in TimeStamp mode, only one set of input boxes will be visible). Type the year directly into the box, and use negative numbers for BC. The program will check for valid numbers, and will reject the year 0 as invalid (because it *is* invalid; there is no year zero in the Western BC/AD year system). If you want the TimeSpan to run from a time in the past to the indefinite present, or are doing a TimeStamp, just leave the end TimeSpan section blank. Conversely, if you want the TimeSpan to run from the indefinite past and end at a specific date, leave the beginning TimeSpan section blank.

Verify Dates: Once you’ve entered your beginning date (and end date if desired), clicking on Verify Dates will display the time data at the bottom, and do a basic check to make sure that the beginning date is before the end date. If you specify month or day for one time, but not the other, that will be brought to your attention; while it’s probably best to make sure that both dates have the same sets of data entered (year-month-day), it doesn’t appear to be mandatory in KML. There are probably bugs in my validation routines, so you should make sure the dates are correct; if you find a case where the program says the dates are valid, and they’re not, please let me know.

Concluded 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.




Putting Time Data Into A KML File

Last year, Google added the capability to embed time data into a KML file, allowing you to create animated time-based data displays and animations (like the examples on this blog on sea level rise animation, or converting animated GIF files into Google Earth animated images). Oddly enough, almost a year later you still can’t add time data to a KML file in Google Earth itself, but have to add it manually using a text editor, or in some limited ways when creating the file. But it’s not a particularly-complicated process, involving adding a few lines of KML code after Feature element tags; examples of Features are:

  • <Folder>
  • <Document>
  • <Placemark>
  • <GroundOverlay>
  • <ScreenOverlay>
  • <PhotoOverlay>
  • <NetworkLink>

The two time-related KML elements are TimeSpan and TimeStamp.

TimeSpan: For a set of data that encompasses a specific interval between two times, you would use the <TimeSpan> KML tag. For example, for a period spanning from August 1, 2000 to September 1, 2003, associating the time data with a <Document> tag would look like this:

<Document>

<TimeSpan>

<begin>2000-08-01</begin>

<end>2003-09-01></end>

</TimeSpan>

The rest of your Document data, followed by the </Document> tag to close it …

For a time period running from a specific start time to the present, you’d just need the <begin>…</begin> part, and leave out the <end>…</end> section; similarly, for a time period running from the indefinite past to a specific time, keep the <end>…</end> section and leave out the <begin>…</begin>.

TimeStamp: For a set of data associated with a specific time, you would use the <TimeStamp> KML tag. If the data in your KML folder is valid for June 6, 1944 at 6 AM:

<Folder>

<TimeStamp>

<when>1944-06-06T06:00:00></when>

</TimeStamp>

The rest of your Folder data, followed by the </Folder> tag to close it …

All of the details for these two time-related KML tags can be found at Google’s KML 2.2 Reference Page, including the proper formatting for date, time, and timezones.

Time data is easy enough to add to a KML file, I suppose, but it would be nice to be able to assign them to a feature directly in Google Earth, for those who don’t want to deal with editing KML files. I suspect that will be added to Google Earth sometime in the future, especially now that ArcGIS Explorer has come out with superior time-handling features, but until then I’ve created another option. In upcoming posts, I’ll describe a simple utility I’ve written that lets you add time data to a Google Earth KML file without having to know any KML.




Convert TIGER Polygons To KML Files

Bruce Ralston, author of the free TIGER to shapefile conversion utility tgr2shp, has a new program called tgr2kml that converts US Census TIGER file polygons (but not points or lines) into KML files. It works on TIGER files from 1994 to 2006 Second Edition (future TIGER data will be issued directly in shapefile and web formats).

First select the TIGER files you want to process (they can be in zipped format):

Continue reading ‘Convert TIGER Polygons To KML Files’




Geographic Time Animations

While I was writing the previous post on xls2kml, which has the ability to add time data to point placemarks in a Google Earth KML file, I got an email from someone who was looking for ways to create time-animated geographic displays. Digging through my brain and bookmarks, I came up with the following:

– If you have ArcGIS 9.2, there’s a free extension called TimeSlider from Applied Science Associates that lets you animated multiple data series that have associated dates or times. Haven’t tried it myself (I’m still stuck with 8.2).

– TimeMap, from the University of Sydney’s Archaeological Computing Laboratory, creates time-based web mapping displays. From the “About” page:

“TimeMap TMJava is a novel mapping applet which generates complete interactive maps with a few simple lines of html. It provides a way of easily enriching web pages with historical or contemporary information that goes far beyond static jpg map images. It’s easy for beginners, yet provides completely customizable power and distributed backend database connectivity for the expert. It’s free for personal use.

TimeMap’s unique time-handling provides an engaging and intuitive method of delivering historical, community, government, research and business information. Combining mapping and the time dimension gives new ways of visualizing urban growth, the spread of empires, heritage sites, environmental change, weather patterns, traffic flow, earthquakes, mobile network faults, and much more ? ranging in time scale from millions of years to seconds.

TimeMap time-filters and animates maps on the fly, connects to datasets anywhere on the web and can search for and load thousands of local maps dynamically as you zoom and pan. TimeMap can filter huge datasets server-side and download only the data needed, or work standalone off a CD. It adapts legends dynamically as scale changes and generates hyperlinks on-the-fly between objects on the map and web pages, and is completely customizable with XML. Yet the applet weighs in at only 350K! ”

The TimeMap website has downloads, documentation, and sample applications. An open source version is on the way. Haven’t tried it this one yet either, but may post on it at greater depth in the future.

– Google Earth, of course, has added time-related coding to KML. But you still can’t add time information to data using the Google Earth application itself. Options for adding time coding are:

  • Add the time data manually to the KML file, as I did in my earlier sea level rise animations; this is currently the only option I know of for animating image overlays, and path/polygon KML files.
  • Use xls2kml to timecode point locations
  • Create a Google KML network link using Google Spreadsheets with timecoding added to point placemarks; Google has a tutorial page describing how to do this.
  • Create a KML network link to an EditGrid spreadsheet; OgleEarth has more info.
  • And I’m working on another way to create animated Google Earth KML files; more on this when it’s ready …

9/25/2007: Added info on EditGrid spreadsheets.




XLS2KML – Another Excel To KML Converter, With A Few Extras

Note: Original website seems to have disappeared; I’ve uploaded a copy of the spreadsheet here.

I’ve posted before on several programs and websites that will convert spreadsheet point coordinate data (CSV or XLS) to Google Earth’s KML format (here and here). XLS2KML is another option, but it does a few things the others don’t:

– You can have additional data fields automatically appended to the Description section in the KML file

– You can automatically put points into folders and subfolders

– Columns labeled with case-insensitive KML descriptors (like Altitude, Range, Tilt, Heading, Icon, Time Start and End (for Timespan), etc. will have their data properly encoded in the proper KML format for that descriptor

– There are additional options for drawing paths, polygons and grids from this Excel spreadsheet, but they’re not well-documented with recently-added documentation. Still, you’d probably be better off converting line and polygon shapefiles into KML for the first two, or using GE-Path to create paths, polygons and grids, rather than doing it point by point with this method.

xls2kml

Download the spreadsheet from this site (see the link at the bottom). Click on the “Important” button near the top of the spreadsheet to get what little “Help” information come with this Excel macro-enabled spreadsheet.




Determining Google Earth Path Lengths

One of the quirks of Google Earth is that while you can draw a path between points as a feature using the “Add Path” toolbar button, or measure the individual and combined distances between points using the ruler (click on the “Show Ruler” button, then the “Path” tab), there’s no automatic way in Google Earth to determine the length of a path drawn using the “Add Path” button, short of tracing over it with the ruler. But there are several utilities that can take the KML file of a path and convert it into a distance. Two of them require you to to copy the KML path data into the clipboard (right-click on the path, and choose “Copy”), then paste it into the application. The third will accept data that way, but can also open a saved KML file to do the calculation.

Continue reading ‘Determining Google Earth Path Lengths’