Note
A small success story tonight. I've been struggling to figure out how to handle aerial photos for both large and small mapping projects. Often when I get aerials, they are tiled, usually in the same tile system as the lidar. So once in a while I'll get lucky and have the entire area covered by one lidar tile. Usually, though, it's two, four, or more tiles.
With lidar, for small projects I get UTM coordinates from Acme Mapper for a rectangle around the area of interest. Then I'll reproject (las2las), then merge and clip (lasmerge), using the UTM rectangle. This gives one file that is usually small enough to process without having to tile the input files. For large projects, I do the same process, but end up tiling the laz input files into 1km tiles (although smaller tiles of 250m or 500m also have advantages, especially if you have to classify lidar using lastools).
Oh---I discovered laz files. They're compressed las files, and they're awesome. They take up about 1/7th the space of las, so they're easy to email and don't hog hard drive space. Highly recommended. Everything I use (software) uses laz files seamlessly. Again---awesome.
So I had to combine four las tiles to make one laz tile for processing. Up til now I haven't had a way to combine aerials. But---it's pretty easy. I haven't tried this with overlapping aerials such as those from Pictometry, but only with tiled aerials that line up nicely in the native projection. Here's how I did it:
Open QGIS and start a new project. Go to "File, Project Properties, CRS, and Enable on-the-fly projection changes and select the native projection of the aerials. For me, it's Southern Ohio with feet. Now load the aerials using the checkerboard button (add raster layer). They should load up and be visible without gaps or black wedges. Now select "Raster--Miscellaneous---Merge". This opens a dialog box. Select the aerials again, and create an output file name such as "Mosaic_OH.tif" (for Ohio projection). The gdal tools really prefer tif, so this stuff gets big, but the tif has the world file embedded, so you can ignore world files (until the last step). There might be some more things you have to select, but I don't think so. Run it. If the box is checked to automatically load it to the current project, you can X the boxes and verify the mosaic file is correct.
But, it's still in the Ohio projection. So select "Raster-Conversion-Projection" (??? I'll update if that's not right. It might be a day or two.) This brings up a dialog box where you select Mosaic_OH as an input and Mosaic_UTM.tif as an output. You also have to select the source and target projections. I use 32616 (UTM zone 16, northern hemisphere) as a target.
Now I go to File--Project Properties, and change the CRS to UTM 16N (32616). Again, I click and unclick the X's for the two mosaic files to verify they're perfectly aligned. One will have black wedges, though.
Now you clip to the same UTM coordinates that you used for the lidar "park" file. Got to "Raster--Conversions---Clipper". Select Mosaic_UTM as input, and a park file name as output, such as storywoods.tif. Type in the min UTMs into the "1" boxes, and the max UTMs into the "2" boxes, and run it. I do one more step here, but it hasn't been helpful because it's not in UTM: I force a world file. Click on the pencil tool and edit the command line. I clicked at the end of the line and added:
-co "tfw=yes" and then run the command. (-co is creation option.)
Again, check and uncheck the boxes between the park file and the mosaic_UTM file to verify it's all perfectly aligned.
Now, if the park TIF file is small enough, you're done. But if you want a smaller file, it's a bit messy. Here's what I do. I open the tif file in Paint, and "Save As" a jpg. If the tif is big, like bigger than 125MB, it won't work. I was able to open big ones in GIMP (free open source, like "photoshop") and "export" as a jpg.
Finally, you need a world file, but the one created by gdal isn't in UTM, but rather long-lat or something. Here's what I did. I went to my OL-Laser output directory and grabbed a random jgw file. I pasted it into my aerial directory and renamed it to match the jpg. The upper left hand pixel should be the min X and max Y UTM coordinates. But rows 1 and 4 will probably be wrong. Write down the x and y pixel counts of the donor jgw file jpg (from OL-Laser or Karttapullautin). Then write down the x and y pixel counts of your clipped "park" aerial. (My lidar files tend to have 1m pixels, and aerials are much higher resolution.) So the donor jgw file has 1 and -1 as row 1 and 4. Divide the lidar pixel size by the aerial pixel size. My aerials were one-foot pixels, so the number was a touch bigger than 0.3048. Now edit the donor jgw file, changing row 1 to 0.3048xxx, and row 4 to -0.3048xx (it needs the minus). Click save, and load it up into QGIS. I was using FR (for Forest Run) as my park aerial name, and I couldn't tell the tif from the jpg in QGIS, so I edited the file names to be FRt.tif and tfw, and FRj.jpg and jgw. Be careful that your "clip" coordinates are fully within the lidar and aerial files, or it will cause problems.
(And if you got any improvements, I really want to know.)
Future research:
1. Try this with overlapping aerials, such as those from Pictometry.
2. Try the selection "creation options" "Use JPEG compression" in the merge and later steps. It will still be a TIF file, but I'm hoping it's more jpg-like in filesize.