blankblank blank


Archive for September, 2007

Converting OpenStreetMap Data Into GPX Or Garmin .img Format

The OpenStreetMap project is “a free editable map of the whole world”, created by users with GPS data or by tracing over Yahoo Maps images (allowed by Yahoo) or public domain Landsat data. Data is viewable by anyone; registration assigns you a username and password that lets you contribute your own data to the project, using a multi-platform map editor like JOSM or Meerkartor. JOSM also lets you save downloaded data from OpenStreetMap, and this data can be converted to the .img format used by Garmin mapping GPS units, or converted to a GPX file for general import into GPS units.

The current OSM data in Garmin .img format is available for the UK, South Africa, and Africa at the Mkgmap wiki site, and for Germany/Netherlands and the entire world at this site. But if you want the most recent data, data subsets for different areas, or don’t want the entire dataset for the world, you can download data for a specific area from OpenStreetMap and convert it yourself to a Garmin .img file. Data coverage is still spotty, so you should check the OpenStreetMap site to see whether the area you’re interested in has data. If yes:

1. Click the “Download some data from the OSM server” link in JOSM, and specify the latitude/longitude bounds of the area you’re interested in (no more than 0.25 degrees square) (note: you’ll need to have entered your OSM username and password in the preferences section).

2. Save the downloaded data as an *.osm file if you want to convert it to Garmin format, else save it as a GPX file.

3. Use the command line Java program Mkgmap to convert the *.osm file to a Garmin img map file (always the same output filename, “63240001.img”, but you can rename it to a different 8-digit number after creation) . If your osm file is called test.osm and is in the same directory as mkgmap.jar, the command syntax is “java -jar mkgmap.jar test.osm”. Enter the appropriate data path if it’s located in a different directory, but the 63240001.img file will always be created in the directory where mkgmap.jar is located. If you’d prefer a GUI, I’ve created a simple one for Windows that you can download here; unzip it to the same directory as mkgmap.jar and run it. The *.osm file will have to be in the same directory as mkgmap.jar for this GUI to work; sorry about that.

4. Upload the .img file to your Garmin GPS using a program like sendMap, or MapUpload if you have a compatible Garmin unit. For GPX files, use the upload program of your choice (e.g. GPS TrackMaker or EasyGPS).

Thanks to David from the UK for the tip.




High-Resolution Aerial Photography And DEM Data For Utah

The state of Utah’s Automated Geographic Reference Center (AGRC) has spectacular high-resolution color aerial photography and digital elevation model (DEM) data available for the entire state, with limited areas having even higher spatial resolution.

  • 5-meter DEM data derived from aerial orthophotos is available for the entire state in ASCII ArcGrid (*.asc) format. You can use the FTP site along with statewide index shapefile to determine which files to download, or use the Interactive Map site. You may have to right-click on the file and choose “Save Link (Target) As”, otherwise the ASCII Grid files may open up as text in your browser. MicroDEM can open ASCII ArcGrid files directly (if you get an error message, zip the DEM file, then open the zipped file). Here’s a reflectance image of a 5-meter DEM of the Zion National Park area:

Continue reading ‘High-Resolution Aerial Photography And DEM Data For Utah’




Handling TIFF WorldFiles With GeoTiffExaminer

The TatukGIS Viewer and MicroDEM are handy all-purpose utilities to use for embedding and extracting worldfile data from a variety of image formats. But if you’re only working with TIFF image files and their worldfiles (*.tfw, *.tifw), GeoTiffExaminer may be a better choice:

- Small program (less than 500K installed)

- Modifies only the header, and doesn’t touch the image data. Both TatukGIS Viewer and MicroDEM rewrite the images when they save them, and sometimes you can get minor shifts in the color palettes that way

- Supports indexed color (the standard format for USGS DRG topo maps); MicroDEM doesn’t, and TatukGIS Viewer doesn’t always save the color palette on indexed colors correctly.

- Simple interface

There are two modes of operation: opening a GeoTiff, extracting the geodata and using it to create a worldfile; and opening a plain TIF file with a worldfile, and embedding the geodata from the worldfile in the TIF to create a GeoTiff.

Continue reading ‘Handling TIFF WorldFiles With GeoTiffExaminer’




Goofing Around With Pan-sharpening

Orbiting satellites often have two types of digital imaging sensors:

- Multispectral, i.e. different sensors for different colors (including IR), or different filters in front of the same sensor. Each individual band can be shown as a black-and-white image; multiple bands can each be assigned a color, and combined to form an RGB color image.

- Panchromatic, “meaning all the colors”, a single broad-spectrum sensor. This are usually displayed as a monochromatic image (i.e. black-and-white).

The panchromatic sensors usually have a higher spatial resolution than the multispectral. For example, on the Landsat 7 spacecraft, the 6 multispectral bands have a spatial resolution of roughly 30 meters (a seventh has 60 meters), while the panchromatic sensor has a resolution of about 15 meters. Here’s an example of an image created from three of the Landsat multispectral bands (data from the Global Land Cover Facility):

Continue reading ‘Goofing Around With Pan-sharpening’




Google Earth Index For US Army Map Service Topographic And City Maps

In a previous post on large-format downloadable historical maps, I noted that the Perry-Castaneda Map Library has an interesting digital collection of Army Map Service topographic maps dating from the 1940s and 1950s, covering large areas of Asia and Africa, along with city maps for Japan, China, Korea and Taiwan (Formosa). Over on the Google Earth Community, “PriceCollins” has been creating a KMZ index file for these maps. So far, he has indexed all 435 city maps:

asiacity

And 413 1:250K maps covering most of India, Pakistan and Southeast Asia:

seasiamaps

Each city and rectangle placemark contains a direct download link to the map image at the Perry-Castaneda Library. From the post, it sounds like eventually all the maps will be indexed in this fashion, so it’s worth bookmarking the site and checking it regularly for updates.




"Fair Use" And Google Earth Imagery

I’ve gotten a few comments on my post about importing georeferenced Google Earth imagery into a GIS, talking about the legality of using the imagery in a business context, and pointing out restrictions contained in the Google Earth user license and the general Google Terms Of Service. While my post mentions that the restrictions of the Google Earth license and “fair use” need to be followed when using this imagery, at least one person equated the use of Google Earth imagery in this manner with theft, dismissing both the concept and legal precedents of “fair use”. So I’ll add some additional thoughts on when it’s appropriate to use Google Earth imagery, based both on a layman’s reading of the user license and the principles of “fair use”. I’d welcome further input from anyone who is an expert on issues of copyright and fair use, and also from anyone from Google who wants to give their take on the issue.

By the terms of the recent revision of the license, the Google Earth software can be use both for “personal, non-commercial uses according to these Terms of Service and the Software documentation“, and for businesses, “the Software may be used by you and your employees for internal use according to these Terms of Service and the Software documentation“. The software comes with the ability to export the satellite imagery on-screen, and the Google Earth API comes with the ability to provide the bounds of the onscreen image, so the actual act of creating an georeferenced Google Earth image is not a violation of either the license or the Digital Millennium Copyright Act. In addition, the license states that, “You agree not to use the Software for any bulk printing or downloading of imagery, data or other content“, indicating that limited printing, downloads of imagery and data are acceptable. The ability to create such imagery directly from the Google Earth application using its built-in print and export functions confirms this interpretation, else Google would not have included this functionality.

Addendum (9/18/07): I should add that any use of the imagery requires you to maintain the Google logo and all the copyright notices embedded in the exported image to maintain proper attribution for the source.

The real question of “fair use” here comes down to how the imagery is used. In the general Google Terms of Service, under the “Content in the Services” section, it says:

“You should be aware that Content presented to you as part of the Services, including but not limited to advertisements in the Services and sponsored Content within the Services may be protected by intellectual property rights which are owned by the sponsors or advertisers who provide that Content to Google (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this Content (either in whole or in part) unless you have been specifically told that you may do so by Google or by the owners of that Content, in a separate agreement.”

The restrictions in any such Terms Of Service don’t preempt the use of any material that falls within the bounds of “fair use”, as numerous court cases have determined. Unfortunately, those bounds can be hard to define. I highly recommend the Wikipedia article on fair use and its references for more information on the topic, especially if you’re not familiar with the concept of “fair use”, since some of its implications may surprise you. Generally speaking, copyrighted material like the Google Earth images may be usable by others without explicit permission of the content creators based on the answers to number of questions:

- What is the purpose or character of the use? Does it enrich the public by adding something new, or is it merely intended to supersede the original content for profit without adding value? The first falls under fair use, the second doesn’t. Works derivative of other copyrighted material have been ruled to fall within the bounds of “fair use” as long as they don’t supersede the original and provide added value, even when the derivative works are sold commercially.

- What is the nature of the copied work? Factual information can’t be copyrighted, but expressions of factual data can be. Even here, it’s not a hard restriction. The Zapruder Kennedy assassination film was copyrighted by Time Magazine, but when they sued the publishers of a book for publishing stills from the film, they lost; publication of this material was held to be in the greater public interest than upholding the copyright.

- Is the amount of copyrighted material used significant and substantial? Reproducing a copyrighted work in its entirety is illegal, as in the case of the of the open source Google Earth clone Gaia that planned to use Google Earth imagery, or MP3 music files. Reproducing limited excerpts of copyrighted material is allowable under fair use if appropriate for the context, e.g. the use of Google Earth screenshots found on many websites and blogs, or excerpts of MP3 files when used in music review.

- Does use of the copyrighted material significantly impact the work’s value? If you use the imagery to undercut the value of the original copyrighted material, that’s an issue; if you use it in a fashion that doesn’t, that may fall under the provisions of fair use. The classic case concerning this was the Sony Betamax case, where the Supreme Court ruled that videotaping copyrighted material didn’t have such a negative impact, and thus fell under the protection of “fair use”. And this was even despite the broadcaster’s argument that this technology could be used to break the copyright law. The Supremes ruled that if a technology had legal uses, it couldn’t be outlawed just because it might be used in an illegal fashion; you had to prove that its principal use was to foster illegal use of copyrighted material (that’s why Napster got shut down).

No answer to any one of these question precludes use of the material under fair use; conversely, you might think you have a reasonable “fair use” right under all four questions, but a court might disagree. The way I interpret these “fair use” factors relating to Google Earth imagery (and I’m not a copyright lawyer, so this is a layman’s opinion):

- Use of limited amounts of Google Earth imagery for personal or non-commercial GIS usage when not distributed publicly very likely falls within the bounds of “fair use”.

- Use of Google Earth imagery for personal or non-commercial use for public distribution would seem to fall under the rubric of “fair use” when it is of a limited nature, some transformative value is added (e.g. plotting additional data on top of it, or using it as a basis for further explanatory information), and when it doesn’t impact the value of the original imagery. So, for example, plotting shapefile data on top of a Google Earth image in a GIS, and then distributing the resulting image publicly, may fall within the bounds of fair use when it’s not done for profit. Creating a large-area, high-resolution georeferenced mosaic of just the imagery alone, and then posting it for download on your website, even if you don’t charge for it, will in all likelihood earn you a cease-and-desist letter from Google, and for good cause.

- The legality of internal use of Google Earth imagery in a GIS for commercial purposes conceivably could depend on the usage, but this is a gray area shading towards black. Talk to your legal department, and be prepared for them to legitimately say “no” to any such use.

- Public use of Google Earth imagery in commercial settings likely falls under “fair use” in some cases, e.g. screenshots of Google Earth imagery for illustrative or informative purposes on a website or blog that earns revenue from displaying ads. Google has acknowledged and featured the work of several blogs that exhibit such screenshots along with ads. Beyond that, though, the legality of public use of Google Earth imagery in a commercial setting will depend on the answers to the “fair use” question above, which lies within the domain of copyright law. My guess would be that more often than not it doesn’t qualify as “fair use”, and even if you think it does, it probably doesn’t. Talk to your lawyers. I might add that if you really want to use satellite imagery for public commercial purposes, you’d be better off looking at using Google Maps instead, since the license and TOS allow for some commercial use of essentially the same satellite imagery you’ll find in Google Earth.




Importing Google Earth Imagery Into A GIS

This post has gotten a very strong reaction from many people, mostly negative. They say use of Google Earth imagery in the manner outlined here is inappropriate, an illegal violation of the Google Earth EULA/TOS. More specifically, words like “theft”, “stealing” and “dirty” have been used to describe this. I feel that this use of Google Earth imagery for personal and non-commercial uses falls under the guidelines of “fair use”, and I explain why here. “Fair use” is not theft. But I acknowledge that I could very well be wrong about this falling under the umbrella of “fair use” protection, in which case it would be illegal. I’d welcome opinions from those knowledgeable about the rights and limitations of “fair use”, and will pull the post if an expert on these issues says that using Google Earth imagery as described below doesn’t constitute “fair use”.

You can save the displayed view in Google Earth by using the File=> Save => Save Image command (Ctrl-Alt-S is the shortcut), which saves the contents of the view window as a JPG file. But in order to use this image in a GIS program, it has to be georeferenced, i.e. coordinates assigned to the pixels. There are free image georeferencing options out there, and I’ll cover some of those soon, but that’s not necessary in this case – there’s a simpler way to get the georeferencing data for an image exported from Google Earth.

You will need to have installed Google Earth (of course), the free GIS program MapWindow, and the Shape2Earth plugin for MapWindow. Shape2Earth’s main function is converting shapefiles to Google Earth KML files, and while the full version costs $29.95, it will work in unregistered demo mode for up to 500 shapefile vertices, and here for georeferencing Google Earth imagery.

1. Open Google Earth, and zoom in to the area of interest.

2. Double-click on the “N” in the compass at the upper right to orient north to the top of the screen. Also double-click on the “0 tilt” icon (the box with the “X” in it on the left in the tilt adjustor) to set the tilt angle to zero.

3. Open MapWindow; if you haven’t already activated the Shape2Earth plugin, do so from the plugins menu.

4. From the Shape2Earth menu in MapWindow, select “Get Image from GE”, and click on the “Capture Image” button. If you haven’t already oriented the image with north at the top and zero tilt, you will be prompted to do so.

5. Save the image with the desired name as a JPG file. This will save a black-and-white jpg image of the current view in the Google Earth window, along with a worldfile (*.jpgw) containing the georeferencing information.

6. Go back to Google Earth, and without moving or changing the view in any way, save the current view (File => Save => Save Image) with the same name and location as the image in step 5,. This overwrites the previous black-and-white image with a color one of exactly the same area.

You now have the Google Earth image with the georeferencing data contained in the worldfile (geographic coordinates, WGS84 datum), which most GIS programs can open and read successfully. If there’s a problem, try changing the extension of the worldfile from *.jpgw to *.jgw.

Limitations of this approach:

  • The view in Google Earth is orthographic, i.e. you’re looking at a sphere from above. For views that are zoomed to view a relatively small area, the area is essentially a flat plane, and the georeferenced image shouldn’t have a large deviation from the true coordinates. The larger the area covered, the greater the deviation between the true and georeferenced coordinates.
  • Coordinates in Google Earth can be off from the true coordinates even for small areas; see this post for more info. This process doesn’t correct for any such deviation.
  • Imagery in Google Earth is copyrighted, and using it for any other purpose than viewing in Google Earth falls under the restrictions of copyright law and fair use. In particular, you have to leave the Google logo and copyright notices unaltered to maintain proper attribution.



Embedding And Extracting Worldfiles With MicroDEM

As described in a previous post, the TatukGIS Viewer has the ability to open image files along with their associated worldfiles, and then convert the image to a GeoTiff with the worldfile georeferencing data embedded it. It can also open a georeferenced image file like a GeoTiff or MRSid, and then save it in JPG, PNG, BMP or TIF formats while creating an associated worldfile. The two biggest drawbacks are that it stamps every exported image at the bottom with the message “Exported with the TatukGIS Viewer www.TatukGIS.com” in yellow-accented letters, and it can’t embed coordinate system and datum data in the GeoTiff (e.g. UTM, WGS84). MicroDEM can’t do everything that the TatukGIS viewer can, and isn’t as easy to use. But it has the ability to convert image files with worldfiles into GeoTiffs, and export image files with worldfiles, but without the stamped message at the bottom. It also has a limited ability to embed coordinate/datum data into the GeoTiffs along with the georeferencing data.

To convert an image file with a worldfile:

1. From the File=>Open menu, choose either “Open image” or “Open scanned map”

2. From the “Files of type” dropdown, choose “Imagery with world files”

3. Select the worldfile for the image you want to open (e.g. *.tfw, *.jgw, etc.)

4. The “Pick Projection Parameters” window will open. Here you can select the datum for the data, and the UTM zone for UTM coordinates. If the worldfile is in geographic coordinates (lat/long), the UTM Zone setting is irrelevant.

Capture8-14-2007-1.31.17 PM8-14-2007-10.47.04 PM9-11-2007-7.24.32 PM

5. Click OK, and the image will open onscreen, fully georeferenced. If you only want to export part of the image, you can select it with the subset and zoom button on the toolbar:

subsetandzoom

6. MicroDEM saves images in the screen resolution; to save in the full native resolution, you’ll have to zoom to 1:1; to do that, click on the “No zoom (1:1)” toolbar button:

zoom1to1

7. Choose File => Save map as image => GEOTIFF, screen scale. This will save the image as a GeoTiff, with the georeferencing data embedded, and with the coordinate system and WGS84 datum information also embedded. And no watermark stamp.

Limitations:

- JPG, BMP, GIF and PNG supported natively; MRSid is supported with add-ons, but isn’t easy to work with. Search the help file for “MRSid” for more info on how to set this up in MicroDEM.

- The only coordinate systems supported are geographic and UTM; no Lambert, SPCS, etc..

- The only datum data is exported in is WGS84, regardless of what datum the original data was in, and which datum you specified in step 4 above.

- GeoTiffs are exported in 24-bit color; 8-bit or indexed color is not supported.

If you want to go the other direction, converting a GeoTiff or MRSid file with embedded geodata into an image format with worldfile:

1. Open the GeoTiff/MRSid in MicroDEM

2. Select File => Save map as image => With worldfile

3. Select the desired image format (BMP, PNG or JPG), and save the file. The worldfile will be created automatically in the same directory.