span8
span4
span8
span4
Using the RasterMosaicker transformer,multiple source raster files may be mosaicked into a single file.Source rasters must all have the same number of bands and in turn the same number of palettes.In this basic example,we will mosaic four raster files which have the same number of bands.For a more advanced example that deals with rasters without the same number of bands,please visit theRaster Mosaicking Scenario篇文章。
RasterMosaicking.fmw (completed workspace)
MosaicData.zip (contains all four JPEG2000 orthophotos)
1.Read in four JPEG2000 orthophotos
In a blank workspace add aJPEG2000 (GeoJP2/GMLJP2)Reader to the canvas.Browse to and select all four JPEG2000 files that we will mosaic together (BCVANC15_N5_A.jp2,BCVANC15_N5_B.jp2,BCVANC15_N5_C.jp2,and BCVANC15_N5_D.jp2) for the dataset.
The four JPEG2000 orthophotos
2.Inspect the data
Prior to mosaicking,it is worth taking a look at the imagery and noting a few things about these files.Connect anInspectortransformer to the JPEG2000 Reader feature type and then run the translation.In the Data Inspector,the rasters appear as though they are mosaicked together,but if you drag and select a corner of the image,you can see only a quarter of the image gets selected.
The four JPEG2000 orthophotos in the Data Inspector,only one image can be selected at a time
3.Mosaic the rasters together
Back in FME Workbench,remove the Inspector,and add aRasterMosaickertransformer.Since the images all line up together with no gaps or overlaps and all of them have the same spacing they can be mosaicked together with the default settings in the RasterMosaicker.
Four features go into the RasterMosaicker and one feature comes out
4.Write out to one GeoTIFF
Add aGeoTIFFwriter to the canvas and connect it to the Output port on the RasterMosaicker.In the GeoTIFF parameters,set the Raster File Name to the attribute CoalHarbor
Final output all four orthophotos merged into one GeoTIFF file
Data Attribution
The data used here originates from open data made available by theCity of Vancouver,British Columbia.It contains information licensed under the Open Government License - Vancouver.
In the nextexercise,learn how to use NoData and Alpha bands to remove black borders.
© 2019 亚搏在线Safe Software Inc |Legal