wfutils.xl (Tools Related to World Files)
Author: Hirohisa Mori / joshua@globalbase.org +
[Transrate]Reiko Inoue Bendtsen c/o Suzaku Translations /
(http://www.suzaku-translations.com/) +
PROTOTYPE
exl wfutils.xl / generate [.map URL] [.crd URL]
exl wfutils.xl / shift [load-worldfile] [save-worldfile] [x-rate] [y-rate] [x-shift] [y-shift]
exl wfutils.xl / split [load-worldfile] [splited-files trunc] [x-split-nos] [y-split-nos]
ARGUMENTS
[.map URL] Map file URL
[.crd URL] Coordinate system file URL
[load-worldfile] World file name to be read
[save-worldfile] World file name to be written
[splited-files truc] Base name of a divided file
[x-rate] Increase rate of resolution in the x direction
[y-rate] Increase rate of resolution in the y direction
[x-shift] Number of pixels to be moved in parallel to the x direction
[y-shift] Number of pixels to be moved in parallel to the y direction
[x-split-nos] Number of divisions in the x direction
[y-split-nos] Number of divisions in the y direction
Option
-
dir =[forward/reverse] The default is forward.
-
prefix =Prefix ( including ".") The default is .tfw.
-
ENVIRONMENT
Agent exl [UNDEF REF (exl)]
EXPLANATION
This command is supported from ver.B.b17.02.
This tool is used to create world files based on GLOBALBASE contents. It is used together with export-pnm of
matrix.xl and so on. We did not employ a mechanism where world files are generated at the same time as export-pnm in order to allow adding world files to already generated image files at a later stage.
generate
If you specify generate in this script, world files are generated from GLOBALBASE contents. The mapping to be specified for [.map URL] must be an image object .lst file as the source and a coordinate system ( .crd) as the destination. The file to be specified for [.crd URL], on the other hand, must be a coordinate system equivalent to the reference coordinate system on which the world files are based. With these specifications, this tool generates world files of .lst image data seen in the coordinate system [.crd URL].
It is possible to specify the
dir option. If you specify dir=reverse, the order of the X and Y axes can be switched. Moreover, the prefix option specified the prefix attached to world file names.
shift
Starting from world files of images generated from a certain matrix of existing world files, [load-worldfile], this tool outputs data at low resolution from this matrix or creates world files from sub-parts extracted from the entire image.
Specify offset of an image at a certain level from the origin, seen from the level, for [x-shift][y-shift]. Specify the values of 1/(1<<(level*dim_divide bit) for [x-rate][y-rate]. In this example, the values shall be calculated assuming dim_divde bit=4. Note that, if the value is 1/4, it can also be specified as /4.
Specify the offset of the image whose resolution was decreased for [x-shift],[y-shift].
split
This tool is used to create a world file corresponding to an image file if one image is divided into multiple images using matrix.xl export-pnm or similar. Consider the case where the original image world file is [load-worldfile] and divided into [x-split-nos] portions horizontally and [y-split-nos] portions vertically. In order to check the image size after the division, specify [splited-file trunc]. This corresponds to [pnm-filename], which is specified by export-pnm of
matrix.xl . Specify only the base name of the file. The file number and prefix are added to this. Multiple world files are created by referring to a series of files.
How to use ( creating a single world image file)
-
Create a coordinate system that includes matrix images in such a way that they can be viewed with COSMOS. In this example, the coordinate system is called test.crd and the mapping that connects the matrix images to this coordinate system is called test.map.
-
exl wfutils.xl - - / generate test..map test.crd prefix=.tfw
If you execute the command above, a world file called test.tfw is generated.
-
From the matrix test.mtx connected via test.map, create a ppm file using matrix.xl export-pnm.
xl matrix.xl - - / export-pnm test.mtx test.ppm
-
Create a tiff image based on the generated test.ppm.
pnmtotiff test.ppm > test.tif
-
A world file is created based on the pair test.tif and test.tfw.
How to use ( creating world image files whose resolution is reduced in some parts)
-
Create a coordinate system that include matrix images in such a way that they can be viewed with COSMOS. In this example, the coordinate system is called test.crd and the mapping that connects the matrix images to this coordinate system is called test.map.
-
exl wfutils.xl - - / generate test.map test.crd prefix=.tfw
If you execute the command above, a world file called test.tfw is generated.
-
From the matrix test.mtx connected via test.map, create a ppm file using matrix.xl export-pnm by specifying level=1 and partial image.
xl matrix.xl - - / export-pnm test.mtx test.ppm 1000 2000 500 500 level=1 splitmode=part
-
Create a tiff image based on the generated test.ppm.
pnmtotiff test.ppm > test.tif
-
Create a world file again from test.tfw based on the partial output above.
exl wfutils.xl - - / shift test.tfw tmp.tfw /4 /4 250 500
mv tmp.tfw test.tfw
In case level=1, the image resolution is 1/4. Accordingly, the image offset becomes 1/4. Be aware that the exact ratio varies depending on the specification at matrix creation.
-
A world file is created with the pair of test.tif and test.tfw.
How to use ( dividing one matrix image into multiple world image files
-
Create a coordinate system that includes matrix images in such a way that they can be viewed with COSMOS. In this example, the coordinate system is called test.crd and the mapping that connects the matrix images to this coordinate system is called test.map.
-
exl wfutils.xl - - / generate test.map test.crd prefix=.tfw
If you execute the command above, a world file called test.tfw is generated.
-
From the matrix test.mtx connected via test.map, extract images divided into 4in the x direction and 8in the y direction.
xl matrix.xl - - / export-pnm test.mtx test 4 8 splitmode=split
Files named test-0-0.ppm, test-0-1.ppm, .... are generated.
-
Create a world file again from test.tfw based on the partial output above.
exl wfutils.xl - - / split test.tfw test 4 8 prefix=.tfw
mv tmp.tfw test.tfw
The generated ppm file is read and the corresponding tfw is generated.
-
Create a tiff image based on the ppm file.
pnmtotiff test-0-0.ppm > test.tif
pnmtotiff test-0-1.ppm > test.tif
.....
-
A world file is created based on the pair test-X-Y.tif and test-X-Y.tfw.
[UP]
Go To Page Top
RETURN VALUE
-
In case the generate option is used
File specified with [save-worldfile]
-
In case the shift option is used
File specified with [save-worldfile]
-
In case the split option is used
A file group specified with [splited-file trun]
ERRORS
REFERENCE
BUGS
[UP]
Go To Page Top