Digital Grove Image Reprojection Tool - DGWarp How to Change a Raster Image from One Projection to Another with GDALWARP |
||
Using map data from many sources can be frustrating if coordinate systems don't match. Layers will not line up in map editors like fGIS unless they share the same coordinate system - spatial projection. Some freeware GIS programs might provide utilities to change projections for vector layers but not raster images. GDALWARP is a superb, open source image reprojection tool that can warp (reproject) images from one coordinate system to others. It's part of FWTools, developed by Frank Warmerdam. DGWarp.zip (~12MB) is a simplified adaptation of GDALWARP. The zip archive includes GDALWARP and its dependencies plus a few batch file examples with test images. You merely unzip the file to the "C:\" root directory to use it. There is no installation procedure or need to set environment variables. Batch files used to run the warp engine are relatively easy to copy and edit with Notepad compared to typing instructions at a command prompt as in the full version of FWTools. Once set up, batch files can be reused by simply changing the names of the source and target image files. To use DGWarp, download and unzip the files to the root directory "C:\". You can install it elsewhere if you wish, but you'd need to edit the paths to GDALWARP and test images in each of the example batch files. You'll find the following files with Windows Explorer (with View>Thumbnails):
The "bin" contains GDALWARP and all its parts. Three source images for the example batch files to operate on are in their own folder. "Copyright.txt" includes a disclaimer and Frank Warmerdam's credits. The five "geared" batch files are the examples. Double-click any of them, and new GeoTiff target files will be added to C:\dgwarp as GDALWARP converts the source images. Start Windows Notepad and drag tif2utm_tif.bat (or any of the other batch files) into it. Batch files are simple text giving a series of instructions to the operating system. In this example "bat" file, Notepad will look like this:
c:\dgwarp\bin\gdalwarp -t_srs "+proj=utm +zone=16 +datum=NAD83" -co INTERLEAVE=PIXEL -co TFW=YES c:\dgwarp\source_images\lake_geo.tif c:\dgwarp\lake_utm.tif In the text above:
USAPhotoMaps, by Doug Cox, is a common source of aerial photos and topographic maps downloaded from TerraServerUSA. Two of the batch files provide examples for converting the TerraServer images created by USAPhotoMaps to other coordinate systems. The file "utm_jpg2latlong_tif.bat" will convert any image in a UTM-NAD83 projection to Geographic Lat/Lon coordinates, but you'll need to adjust the zone number for the source image in the batch file. Be sure the source JPEG and its companion world file are together. The file "usapm_utm_jpg2wtm..." changes a TerraServer aerial photo to the Wisconsin Transverse Mercator projection. If you double-click it, the process takes about a minute (maybe more on slower machines) with GDALWARP showing a countdown as progress is made. That file looks like this:
In this batch file:
The full version of GDALWARP offers many options, although the simplified batch file process provided here will only produce GeoTiff files. Get the full version or documentation at: and MAPTools.ORG One more tip regarding converted images: Image rotation will create black collars in the target like the image on the left:
There is a technique in GDALWARP to specify coordinates to crop away the voids. An easier method is to open the image in fGIS and use the Image Export Tool (left) to crop and save the central portion of the target. Rather than crop the image, another option is to set the Layer>Image Transparent Zones (right) to make the black collar disappear. If you are starting with a scanned image without coordinate registration, a relatively simple method to geo-reference a scanned image is also available with freeware fGIS and FantaMorph or SmartMorph.
|
||
Mail at: digitalgrove@msn.com © Digital Grove™ |