blankblank blank


Archive for September, 2007 Page 2 of 3



Embedding And Extracting Worldfile Data With The TatukGIS Viewer

Some image formats, like JPG and BMP, don’t support embedding of georeferencing data, so they require a worldfile to georeference them in GIS software. It can be inconvenient to move and keep track of two files instead of one, so it’s often useful to convert the original image into a format that supports embedded geodata, and then use the worldfile data to embed the appropriate georeferencing data into it. The TatukGIS Viewer is able to do that; it can open a raster image file in several different formats (JPG, BMP, PNG, TIF, ECW, SID, JP2), use the worldfile to georeference it, and then export it to the GeoTiff format with the georeferencing data embedded in it.

1. Open the image with the worldfile in the TatukGIS Viewer program (the Add Layer command)

2. Choose File => Export Image from the menu

3. Select Tag Image File Format (*.tif) as the desired export format, and enter the filename to save under

4. In the Export to TIF window that comes up, you can modify the bit depth of the image to reduce the colors/filesize of the image; you can also change the image size as well, and choose whether to export the whole image or just what’s visible on screen. TatukGIS will stamp a label on the bottom of the image, something to keep in mind when exporting part of the image.

Capture8-14-2007-1.31.17 PM8-14-2007-10.47.04 PM9-10-2007-9.13.07 PM

When you click the “Save” button, the image will be saved as a GeoTiff, with the coordinate georeferencing data embedded in it. Worldfiles don’t contain coordinate system or datum information, so that isn’t included in the georeferencing data embedded in the GeoTiff file. Also written is a *.tfw worldfile for the newly-created TIFF image, useful if the GIS program you’re using doesn’t read embedded GeoTiff coordinate data.

You can also go in the opposite direction: open an image file with embedded georeferencing data (e.g.GeoTiff, MRSid or ECW file), then convert it into a image format that doesn’t support embedded data (JPG, BMP and PNG), along with a worldfile that can used by other programs to georeference the image.

The TatukGIS Viewer is easy to use, flexible in export options like resolution and bit depth, and accepts a wide variety of raster images for export in georeferenced format. The biggest drawbacks are the label it stamps on the bottom of every exported image (which can be cropped off), and its inability to add coordinate system/datum information to the file. The next post in this series will talk about a program that’s less flexible and not quite as easy to use, but which doesn’t have a watermark, and has a limited ability to embed coordinate and datum information into the GeoTiff header.




Worldfile Basics

I’ll be doing a bunch of upcoming posts on free software for working with image worldfiles, so I thought I’d spend one post reviewing their basics. A worldfile is a simple text file that contains the information necessary to assign geographic coordinates to a raster image, to georeference it for use in a GIS program. For example, suppose I have a image like the one below (downsized by a factor of two from its original pixel dimensions of 1448 x 942 pixels):

Google Earth image with worldfile

The worldfile for the original image is:

0.000067897543
0.0000000
0.0000000
-0.0000554613012
-111.743323868834
35.1254392635083

The bottom two numbers are the longitude and latitude of the pixel in the upper-left-hand corner. The top number is the horizontal size of a pixel in coordinate units (longitude degrees in this case); the third number from the bottom is the comparable vertical pixel size in latitude degrees, negative because latitude decreases as you go from top to bottom in the image. The two other lines are rotation/compression factors for left/right and top/bottom, and are rarely used. Using the worldfile data, and the pixel dimensions of the image, a GIS can calculate the corresponding geographic position for every pixel in the image.

Worldfiles have an extension that depends on what kind of image file they’re associated with. Typically, it’s the first and last letters of the image extension, with a “w” at the end, but the full image extension with “w” at the end is also sometimes used. For example:

JPG image: worldfile has .jgw or jpgw extension.

BMP image: worldfile has .bpw or .bmpw

TIFF image: .tfw or .tifw

The extension .wld is supposedly acceptable as a general worldfile extension, but I’ve never seen it in the wild.

Worldfiles are plain text, and don’t contain any embedded information in them about the coordinate system. In the example above, it’s pretty obvious that the worldfile is in geographic coordinates, latitude/longitude. But the GIS program you open the image in won’t necessarily know that, and you’ll have to take care that the image’s coordinate system matches up with that of the other data you’re adding to the view. If your image is in geographic coordinates, and your shapefile data is in UTM, the GIS may not be able to convert the coordinates of them “on-the-fly” to match each other.

And there’s also the datum to keep in mind, since worldfiles don’t contain datum information, either. If the image is in the WGS84 datum, and your other data is in NAD27, there can be a distance discrepancy of hundreds of meters between the depicted position and the true position. Some programs can create another text file with the “.PRJ” extension that will contain information about the coordinate system and datum for a worldfile, but some free GIS programs can’t read that PRJ data.

Many image formats, like BMP and JPG, require a worldfile to georeference the image for use in a GIS. Other formats, like TIFF and MRSid, can use worldfiles, but can also have the georeferencing information embedded in the image file itself, optionally with coordinate system and datum information. For TIFF-format files, these are commonly referred to as GeoTiffs. Many GIS programs can open these files and extract the georeferencing data from them automatically, though a few can’t. And while you can open a GeoTiff file in an image editing program like Photoshop, if you save the image that georeferencing data is lost.

Upcoming posts in the series will deal with software that can do various things related to worldfiles, like:

- Combine a worldfile for an image format that doesn’t allow embedding coordinate data inside of it, and save it in a format that does support embedding;

- Extracting worldfile data from embedded coordinate data in an image, and re-embed it without modifying the image data

- Modifying an image file in Photoshop, and then re-embedding the coordinate data using a worldfile

- Creating worldfiles for map images that don’t have them, so that they can be used in a GIS

- Saving and embedding coordinate system / datum information in image formats that support it




Downloadable Cartograms From Worldmapper

A cartogram is a map where the area depicted depends on the value of a variable instead of the actual geographic size within the boundaries of the area. Worldmapper has a large collection of cartograms (366, with more added all the time). Here’s a cartogram of number of plant species by country:

271c

In addition to the graphic image, which can be downloaded by right-clicking on it and choosing “Save Image”, you can also download the data used to create the maps in Excel format and OpenDoc format. Some maps include animations of the map morphing from a standard map to a cartogram, and/or can be downloaded in PDF poster format (missing for some of the newer maps).

More info about cartograms is available at Cartogram Central.

Via BlinkGeo.




Geographically-Linked Video With VeoGeo

Javier writes (and Mapperz posts) about VeoGeo, a new website that lets you post videos, link them to a GPX file, and have the position where the video was taken be plotted in Google Maps. If your position changes during the video, the position plotted on the map will move as well. The process is fairly straightforward:

1. Register (for free) at VeoGeo. You’ll also need to be able to upload video files at any online site that allows embeddable video content (e.g. YouTube, Revver, MetaCafe, etc.)

2. Upload the GPX file to VeoGeo; this will have to be a continuous track file with the timestamps intact.

3. Upload the video file to the site of your choice, and copy the video link into the appropriate box at VeoGeo

4. Use VeoGeo to sync up the GPX track with the video.

You’re ready to go; the page for your “tour” will have the video window at upper-left, an altitude profile at lower left, and the Google Maps display at the right. Click on the video “play” button, and as the video plays, the marker on the map will reflect the position at the time the video was shot.

It’s a fun and clever concept, and has great promise for creating geographically-linked video tours. But there is some room for improvement:

- There’s no ability currently to edit the files to only show sections of a video; you have to upload (and watch) the whole thing. Most of the trips I take would have seconds of interesting footage interspersed with minutes (or hours) of boring footage of getting to that area.

- Initial Google Maps zoom level is too high; there’s no imagery initially visible on some pages. Zoom out a bit, and it should appear.

- There aren’t a large number of videos posted yet, but from the ones currently up, it’s clear that the most successful videos have the video shot with a camera firmly mounted so that there’s minimal shake. Walking and biking videos are less successful; without good image stabilization, they can be unwatchable for more than a short period of time.

- No help section yet (but they are in Beta)

- Small number of videos, so their current method of browsing for videos isn’t a problem (markers on a Google Map). But as the number of videos increases, they’re going to have to come up with a better browsing interface.

This site is a great match for Pict’Earth, and I hope the Pict’Earth people post some of their videos up on the VeoGeo site soon (hint, hint).




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.




Google Maps Line Tool Now Supports Distance Measurement

The official Google LatLong blog has announced that the Google Maps line tool in MyMaps now displays the total line length as you draw it, and also adds the line length to the pop-up info box for that line:

Google Maps line tool shows distance
The latest version of Google Earth still doesn’t do that, but I have to believe that capability will be added at some point. Until then, try one of these tools for measuring path lengths in Google Earth.




The Best Gadgets Blog

Slightly, but not completely, off-topic: I used to subscribe to the feeds for Engadget and Gizmodo, two blogs devoted to the latest and greatest in high-tech gizmos. But I dropped those feeds because:

  • I was getting inundated with dozens of posts every day, most on items I had no interest in
  • Too much “gadget porn”: drooling and obsessing over the latest and greatest in gimmickry without asking the questions, “Do we really need this?”, and “Is it really worth it?”

So now I’m down to one gadget blog, and the one I highly recommend: Cool Tools from Kevin Kelly, one of the creators of Wired Magazine.  Why do I like it?

  • Usually no more than one post a day.
  • Talks about tools that actually do something useful or interesting.
  • Not just the latest and greatest, but brings existing but obscure tools to your attention.
  • Posts are thorough and thoughtful reviews, not just rehashed publicity releases.
  • Not just computers or electronics, but a wide variety of topics: Aural, Autonomous Motion, Backpacking, Big Systems, Clothing, Communications, Community,Computers, Consumptivity, Craft, Culture, Design, Destinations, Dwelling, Edibles, Family, Gardens, General Purpose Tools, Health, Homestead, Inner Space, Kitchen, Learning, Life on Earth, Livelihood, Living on the Road, Materials, Media Tools, Paper World, Photography, Play, Science Method, Somatics, Source Wanted, Tips, Vehicles, Visual Media, Workplace. It’s fun just browsing through the different categories to see what you’ll stumble upon. No geography-related categories, but a search for “maps” or”GPS” will bring up a bunch of posts.

Give Cool Tools a look; I think you’ll like it.

I’m also keeping my eye on a newcomer, BoingBoing Gadgets; perhaps a bit too techy for my tastes, but does branch out beyond the standard electronics stuff.




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.