To create mosaics in GeoExpress, create a mosaic text file, that is, a file with the .mos
extension. Mosaic files list the images that you want to add to the mosaic, and can be used both for images that do and do not have georeferencing.
The individual input tiles of a mosaic cannot be cropped. The mosaic file can be given any name.
For georeferenced images (TIFF images with .tfw
files, JPEG images with .jgw
files, BIL, BIP, or BSQ images with supported .hdr
files, LAN, GeoTiff, ERDAS IMAGINE, USGS DOQ images or MrSID files), the text in the mosaic file lists the images that you want to add to the mosaic.
In the following example, a mosaic is created from four TIFF files. A sample mosaic file for this project is displayed below:
image_nw.tif
image_ne.tif
image_sw.tif
image_se.tif
The following command creates the mosaic using the mosaic file above:
mrsidgeoencoder -i mosaic.mos -mos -o mosaic.sid
The ‑mos
switch identifies the input file as a mosaic file.
GeoExpress does not recognize mosaic files with spaces in either the listed file names or in the listed paths. In addition, the first line in the file cannot be blank and the last line in the file must be followed by a carriage return.
You can opt to generate a shapefile that includes the boundaries of each tile that makes up the output image. Include the switch ‑writeboundsshapefile
(or ‑wbshp
) in your command:
mrsidgeoencoder -i mosaic.mos -mos -o mosaic.sid -writeboundsshapefile
Your job will be created and include the file mosaic.shp
(or whatever name you chose for your output file). You can then use a program such as GeoViewer to load the image and shapefile to see the tile boundaries overlaid on the output image.
When creating a mosaic using images that lack georeferencing information, a mosaic file must be created. In this case, the mosaic file must list the file names and the upper left corner pixel location for each image. Each image must be listed based on the following format:
image_name x-pixel_location y-pixel_location
Only a single space is required between each of the three items in the list. Each image listed must be on a separate text line.
Base the upper left corner pixel location of each image on the location of the image relative to an x=0, y=0 pixel location of the upper left corner of the entire set of images.
Consider an example where a single image is being created from four separate scanned Sun Raster images, each 640 by 480 pixels in size.
The mosaic file requires the following four lines:
image_nw.ras 0 0
image_ne.ras 640 0
image_sw.ras 0 480
image_se.ras 640 480
The sample file above joins the specified images as follows:
A positive y value places the image that many pixels from 0,0 in the negative y direction.
Use the ‑multires
switch with the ‑mos
switch to allow multiresolution input for a mosaic.
Only flat mosaics support tiles with different resolutions.
You can create a mosaic from tiles with different projection systems. Specify an output projection for the tiles using the ‑toepsg
or ‑towkt
switch. For more information on specifying an output projection, see Reprojecting Images.
For example, you might enter the following command:
mrsidgeoencoder -i tiles.mos -mos -toepsg 4326 -o output.sid
When you create a mosaic from tiles with multiple projections, GeoExpress enables multiresolution input by default.
There are several things that you should understand and keep in mind when encoding large flat mosaics (for the difference between flat and composite mosaics, see Creating a Mosaic):
Certain operations will increase encoding time, such as mosaicking and reprojecting, since they require decoding first, whereas others, such as cropping and recompression, can be done in compressed format and will not adversely affect encoding time. Working from RAW images will always be faster than working with compressed imagery.
Several configurable parameters you may wish to set will have an effect on the encoding time:
strip height: selecting higher strip height will result in faster encoding while using more RAM; a lower value, such as 2, will result in a very long encode time but will use less memory.
block size: block size has more of an effect on memory usage than strip height. Selecting a higher block size will use more RAM. Selecting a lower block size will result in lesser quality compression, although there is no benefit in setting it extremely high.
You can expect the following pixel-width limits for the following encoding settings on a computer with 2GB RAM:
a strip height of 12 and block size of 64 will work on images up to 500,000 pixels in width
a strip height of 12 and a block size of 32 should be used for images between 500,000 and 1 million pixels in width
Your workflow will be more efficient if you:
encode to a lossless “master” first
subsequently take any croppings or make compressions from the master mosaic
If possible avoid the strategy of making smaller mosaics first that will in turn be mosaicked in another encoding; this will only increase your encoding time. Even if you want smaller mosaics in addition to the full mosaic, it will take less time to create the full mosaic and crop than it will to create the small mosaics and then create a larger mosaic from those.