Sign in to follow this  
Gridley

Finally - a free reprojection utility for background im...

Recommended Posts

Hi all,I decided to re-post Derek's post in a separate thread because I believe this is a significant discovery for anyone looking for a free utility that re-projects images and GIS data form UTM (or many other projections and datums) to the FS-native lat/long WGS84. "Hi Guys,ERDAS ViewFinder is a freeware image analysis package that allows raster reprojection. It will handle GeoTIFF and .img files, but you can also download a plugin from ER-MAPPER that will allow you to read an .ecw that you can then save as one of the other formats which you can reproject from. Follow the link then go to free downloads...http://gis.leica-geosystems.com/erdascentral/Cheers,Derek"-------------I just downloaded the utility (of course, yet another user registration required) and it runs fine on my Windows98, even though it indicates being for NT/XP only. I haven't done a full round of testing yet but I loaded one of the satellite image bands I've been using - http://glcf.umiacs.umd.edu/index.shtml - and saved it as geographic/WGS84 projection in tif format. I then loaded the same image I had reprojected earlier with my commercial GIS and the output seems to be identical - hooray!http://forums.avsim.net/user_files/78502.jpgUnless I'm missing something, ViewFinder doesn't allow to crop the image so you'd have to do that in Photoshop or PSP or whatever you use and use the information in the .tfw file, along with columns & rows, to calculate the extent of your image (see below). The satellite images are available for the entire planet and a great source for setting up background bitmaps for Ground2K4 or other scenery design software. The ETM+ data have a 15-m greyscale band (Band 8) or you can download any three of the 30-m bands and combine them in your image editor into a RGB color image. For example, Band 1 as Blue, Band 2 as Green, Band 3 as Red, will yield a true-color image.---Here's a summary of the required steps (there might be other options):1. Go to http://glcf.umiacs.umd.edu/index.shtml , then "Download Data", then "Map Search", then check the "ETM+" box, then select the Lat/Long tab. Enter the bounding coordinates of your area and click on "Update map". "Preview and Download" will bring up all available image sets and you can check the previews to pick one or more. Make sure that the image Attributes are "Ortho, GeoCover" and the Type "GeoTiff". Click on download. The individual bands are named *nn*0.tif.gz - e.g., Band 1 is *nn10.tif.gz. Usable for scenery work are Bands 1-5, 7, and 8. The choice is yours. More information about the content of the bands is available here: http://rst.gsfc.nasa.gov/Sect1/Sect1_3.html2. Once you have one or more bands and/or images downloaded, unzip them and load and save/reproject each one with ERDAS ViewFinder.3. Use your image processing software (Photoshop, PSP, Gimp, etc.) to crop each band to the same size and combine them as color RGB, if desired. Important: write down the start and end column and row of the area you're subsetting. Then save the subset as bmp. Note that your area should not be bigger than approx. 4000x4000 (double that for Band8, if saved as 8-bit greyscale), otherwise Ground2K4 will have difficulties handling the large file size.4. Calculate the upper left and lower right corner coordinates for calibrating the image in Ground2K4. Open the ViewFinder .tfw file of your reprojected image in Wordpad or Notepad and use the X/Y resolution (the first line) and longitude and latitude (the two bottom lines) of the original image to calculate the subset image's corner coordinates as follows: N(subset) = N(original) - (Yres * Nrow) W(subset) = W(original) + (Xres * Wcolumn) S(subset) = N(original) - (Yres * Srow) E(subset) = W(original) + (Xres * Ecolumn)(use negative lat/long values for western longitudes and southern latitudes)5. Start Ground2K4 and initiate your new project.Hope this helps. Cheers, Holger

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Holger, thanks for reviving this thread. I'm struggling with providing viewfinder with data that presents the initial georeferencing needed to allow the reprojection to take place. Say I start with a terraserver raster image. Can you advise the steps to take?Bob B

Share this post


Link to post
Share on other sites

Hi Bob,I realized yesterday after typing this post that TerraServer doesn't allow saving an image in GeoTiff; didn't think, though, that my untested assumption would get tested this quickly ;-)While ViewFinder will read a .jpg file created with BigJpg.exe (of the USAPhotoMaps TerraServer image "grabber") it doesn't seem to allow for changing the UTM projection into something else.Fortunately, other people have had the need before us for a freeware solution to turning TerraServer output into GeoTiff format and Google helped me to track them down. Go to this website - http://www.digitalgrove.net/Toolbox_mappers.htm - and scroll down to "Zoner Draw 3" - there's a description about how to do this and whith what tools; as usual, freeware work-arounds involve about 25 tools at once ;-) Once you have a fully georeferenced GeoTiff TerraServer image you should (!) be able to use ViewFinder for the reprojection to lat/long.I won't have the time to test this procedure right away but if you're giving it a try please let us know if and how it works out.Good luck!Cheers, Holger

Share this post


Link to post
Share on other sites

Thanks Holger...times a tad short for me as well, but my interest is high. I will report once I've got something to say...others should jump in here also....no glory for getting there first!Bob B

Share this post


Link to post
Share on other sites

The instructions via the digital grove website is:<<1. Use Zoner Viewer to open a JPEG aerial photo made by USAPhotoMaps-BigJPEG. Tune up the contrast-brightness-sharpness to suit your needs. (If you wish, you can also add text, lines or symbols in Zoner Draw.)2. Convert the image to a TIFF format file with Zoner Viewer's "Convert" tool. 3. Use Properties Plus to rename the image's "jgw" world coordinate file so it has a "tfw" extension. 4. Use another free utility called GeoTIFF Examiner to change the paired TIFF and "tfw" files into a single GeoTIFF file. GeoTIFF Examiner will write the world coordinate calibration into the header of the TIFF file. (Note: Do not create the GeoTIFF file until you are done making adjustments with Zoner.)>>I'm working on step 3....looks like I must download a "jgw" world coordinate file from terraserver. B

Share this post


Link to post
Share on other sites

Hi Bob,the .jgw file contains the georeferencing information for the .jpg file. If you're working with USAPhotoMaps - http://jdmcox.com - the BigJpeg.exe module will create a .jpg with an associated .jgw file for you. If you're downloading directly off TerraServer you can make your own .jwg file. This is the structure:1.000000000000000000.00.0-1.00000000000000000273600.000000000005265400.0000000000Lines one and four contain the X and Y resolution in meters. Don't ask me why line 4 is negative; just enter your image's resolution as a negative number as well. Keep lines two and three as they are and change the last two lines to the upper left corner of your UTM TerraServer .jpg, first Easting (longitude) then Northing (latitude). I'm not entirely sure where the UTM Zone comes in but make sure you'll write it down somewhere.Cheers, Holger

Share this post


Link to post
Share on other sites

Holger, what's the file extension for a geotiff....my efforts are so far crashing viewfinder. I'm thinking I have a geotiff but the extension remains tif, and the file can't be opened by viewfinder.If the file extension isn't a clue, is there another way to verify the geotiff file is "good"?B

Share this post


Link to post
Share on other sites

Hi Bob,Hmmm.... the extension is the same as a regular tif but I don't know what information is stored in the header of the tif file. I thought it duplicating the data provided in the tfw file so one can use either the geotiff with header or a tif file with accompanying tfw file of the same name.Are you following the procedure with ZonerDraw and GeoTIFF Examiner described on the DigitalGrove website or what tools/methods are you using?Cheers, Holger

Share this post


Link to post
Share on other sites

<yes, except rather than use bigjpeg.exe, I'm just downloading a topo map from terraserver, and downloading the corresponding world file. I haven't rtfm very much.....lolB

Share this post


Link to post
Share on other sites

Howdy,well, that's odd: the procedure for georeferencing a TerraServer jpg as described on the website doesn't seem to be working. First off, there's no need to use that Zoner Draw program if you already have any graphics software that can translate a jpg to tif (most do). The problem is that the step with GeoTiff Examiner (writing the world file coordinates into the tif file) works but it's not complete. Apparently (???), the projection information (UTM, zone, and datum) is also stored in the geotiff .tif file but GeoTiff Examiner doesn't deal with that. However, it seems that ERDAS ViewFinder requires that information to correctly read the image and allow for reprojection when saving. I tested this by loading the tif file written by GeoTiff Examiner into my GIS (it asked me for the UTM zone and datum) and saved it as a tif; this geotiff version then worked in ViewFinder just like the satellite imagery.I looked for other free options/tools for appending tif formats to geotiff but haven't had any luck so far. Any other ideas anyone? Maybe it would be possible to add the information with a hex editor?Cheers, Holger

Share this post


Link to post
Share on other sites

Hi there,... and Derek scores again ;-) And the tutorial is even on the same website! Wonder why they have that apparently useless paragraph with the Zoner Draw utility but no crosslink to the complete tutorial? I haven't tried it yet but I'm hopeful. Just remember to set the compression value to minimum (1%) because you probably don't want any quality loss (minimal though it is) when processing TerraServer images.Thanks again, Derek!Cheers, Holger

Share this post


Link to post
Share on other sites

sweet success!Just tried a TerraServer 2-m composite made with USAPhotoMap, following the instructions in the website listed above by Derek and it worked like a charm. I visually compared the image to the output provided by my GIS and the amount of stretch and rotation appear identical!Once again, make sure that you know the UTM zone of your image (for the ECW Header Editor) and, in Step 4 of the tutorial, select Category "geographic" and Projection "WGS84". Also, for both steps in ViewFinder make sure to select "Cubic Convolution" as the Resample Method.Finally, before you close your reprojected image, click on Tools > Image Information and write down the image Width and Height (if you want to use the output for photoreal textures) as well as Lower Right X and Lower Right Y (you need those for Ground2K4; the Upper Left X and Y are already contained in the .tfw file of the same name).Go wild!Cheers, Holger

Share this post


Link to post
Share on other sites

ok, running into problems....it seems I have a successful .tif file with the utm zone 10 projection identified....http://forums.avsim.net/user_files/79379.jpgand attempt to save as "geographic" projection.....http://forums.avsim.net/user_files/79380.jpgbut I get this error....http://forums.avsim.net/user_files/79381.jpgAny one see the mistake? Clicking ok, just ends the save as op....The reporjection works fine using a different end goal projection...but I beleive that "geographic" is the right projection for flight sim....BPS...seems the color image is saved as black and white....I'm too new at this...need help at recombining the layers back into rgb channels...I don't see a way in viewfinder to isolate a layer for individual saving...

Share this post


Link to post
Share on other sites

Hi Bob,that's an easy one - you have to change the units ("Change Output Pixel Size") to degrees.About the color to greyscale thing: I haven't worked with an RGB image yet but there's that "Band" box in the top line of your first screenshot. It's possible that you have to repeat the process for all three "bands" (R, G, :( by selecting a different one for each save.Hope that helps.Cheers, Holger

Share this post


Link to post
Share on other sites

Sounds logical, hadn't thought that through...since the imagry I think of as being sized to 4.75m/pixel...I was thinking that meters were still the appropriate unit. Logical, though...as the units of th inf file is degrees/pixel. Thanks for the help, H. I've been fooling around with the bands myself....more experiments required. best,B

Share this post


Link to post
Share on other sites

My solution of saving the reprojected geotiff as a color image was to open it in mapmaker gratis, and then use the bitmap utility format converter to save as a bitmap.B

Share this post


Link to post
Share on other sites

Can anyone point me to a download for the ECW utilities, the ERMapper site appears dead for me since early this week...Thanks!sg

Share this post


Link to post
Share on other sites

Thanks, Holger. I can't get that second one to load- must be that "large scale internet attack" is read about on CNN...;)You know, I had a similar problem a few weeks ago - I was the only person I know of that couldn't get to hifisim.com...strange.Thanks again!sg

Share this post


Link to post
Share on other sites

Hi Scott,I had similar problems with the MicroDEM site a while ago. In my case the solution was to click on the ISN provided in the error message (took me only two weeks to figure that out, duh!). Another option is that your browser's security settings are too high.Cheers, Holger

Share this post


Link to post
Share on other sites

Thanks for trying Holger - neither of those worked for me (browser settings are already lower than I'd like) - could be a firewall issue, but it'll be a week before I get a response from my tech support gang, and then it'll miraculously start working again...I had a friend download them and upload them to my FTP - I'm back in business!Best,sg

Share this post


Link to post
Share on other sites

Howdy Everyone,I need some help and direction in using ViewFinder etc. Here are Holger's instructions for downloading and processing a satellite image:1. Go to http://glcf.umiacs.umd.edu/index.shtml , then "Download Data", then "Map Search", then check the "ETM+" box, then select the Lat/Long tab. Enter the bounding coordinates of your area and click on "Update map". "Preview and Download" will bring up all available image sets and you can check the previews to pick one or more. Make sure that the image Attributes are "Ortho, GeoCover" and the Type "GeoTiff". Click on download. The individual bands are named *nn*0.tif.gz - e.g., Band 1 is *nn10.tif.gz. Usable for scenery work are Bands 1-5, 7, and 8. The choice is yours. More information about the content of the bands is available here: http://rst.gsfc.nasa.gov/Sect1/Sect1_3.html2. Once you have one or more bands and/or images downloaded, unzip them and load and save/reproject each one with ERDAS ViewFinder.3. Use your image processing software (Photoshop, PSP, Gimp, etc.) to crop each band to the same size and combine them as color RGB, if desired. Important: write down the start and end column and row of the area you're subsetting. Then save the subset as bmp. Note that your area should not be bigger than approx. 4000x4000 (double that for Band8, if saved as 8-bit greyscale), otherwise Ground2K4 will have difficulties handling the large file size.4. Calculate the upper left and lower right corner coordinates for calibrating the image in Ground2K4. Open the ViewFinder .tfw file of your reprojected image in Wordpad or Notepad and use the X/Y resolution (the first line) and longitude and latitude (the two bottom lines) of the original image to calculate the subset image's corner coordinates as follows:N(subset) = N(original) - (Yres * Nrow)W(subset) = W(original) + (Xres * Wcolumn)S(subset) = N(original) - (Yres * Srow)E(subset) = W(original) + (Xres * Ecolumn)(use negative lat/long values for western longitudes and southern latitudes)5. Start Ground2K4 and initiate your new project.I'm having problems trying to get a decent satellite image and manipulating an image. I have no problems downloading from http://glcf.umiacs.umd.edu/index.shtml but run into difficulties from there on working with ViewFinder. First I unzip an image file to an empty directory. Then I open the TIF file in ViewFinder with the only option available being a grayscale image in the window. I save a copy of this image elsewhere for later use in Ground2K4. Once the image is opened (a nearly equal-sided parallelogram) I open this image and set the options to DEGREES, Geographic, etc. and save it again. This comes out as a stretched parallelogram but I can then read the corner coordinates to apply to the original image for Ground2K4. This seems like going way out around the barn to get where I want to go but I don't understand Holger's instructions for calculating the coordinates (#4 above). Here's what my TFW files look like:0.0001284410000000000000.00.0-0.000128441000000000000-110.5607084150298845.617072828223918Something appears missing or ???? in my TFW file. Either that or I just don't understand what Holger is saying and probably am doing something wrong somewhere along the line.I like to use band 8 black and white images but they are very large files and continually cause Ground2K4 to give an error message, it not being able to redraw the image after moving around a bit in it. I'd like to use just a part of an image but can't figure out how to "cut out" a portion and determine its corner coordinates.When I open an image in Ground2K4, the grid appears as rectangles rather than squares as in the images that Holger posted. Is the image still useable in Ground2K4?I also don't understand instruction #3 above. I downloaded Gimp but can't grasp the combining bands procedure to get a color RGB. An area should be no bigger than 4000x4000 whats (pixels, meters, miles, acres, hectares or what?)? How and where do I find these numbers? It's probably right there in front of me but I can't recognize it or them.I guess I came along too late in the game to be able to understand this stuff. Any help will be very much appreciated.Wil

Share this post


Link to post
Share on other sites

Hi Wil,sounds to me as if you've got a handle on ViewFinder. What is left to do is to subset the big Band 8 (15-m) image (the 4000x4000 refers to the *number of pixels* in rows and columns).I don't have Gimp so maybe others know the specifics but all you need is a display of the row/column position of the cursor when you do the cropping.Look at your reprojected image and decide on the subset area. Say, it starts at row 1000 and column 500 and will be 4000x4000 in size. Using your .tmf file above, the calculations for the NW and SE coordinate pairs are:N(subset) = 45.617072828223918 - (0.000128441000000000000 * 1000)W(subset) = -110.56070841502988 + (0.000128441000000000000 * 500)--> NW corner = 45.48863182 / -110.4964879N(subset) = 45.617072828223918 - (0.000128441000000000000 * 5000)W(subset) = -110.56070841502988 + (0.000128441000000000000 * 4500)--> SE corner = 44.97486782 / -109.9827239Make sure that you don't round to less than 6-8 significant digits (We just had this discussion in a differnt thread: people often fail to understand that small fractions of a degree still translate into substantial distances on the ground). Sorry, can't answer your question about how to combine the 30-m bands into an RGB image with Gimp. In Photoshop, you'd open one of the bands, change the type to RGB (which triplicates the grayscale image into 3 channels (not layers): red, green, and blue), and then copy and paste the other two bands into the respective channels. Paintshop even easier as it has a direct function to combine separate images to RGB.To enhance contrast and saturation, I open an individual band, switch to greyscale, and use the sliders in the Adjust > Levels function (in Photoshop).Hope that helps.Cheers, Holger

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this