Class WorldFileHandler
java.lang.Object
org.openjump.core.rasterimage.WorldFileHandler
- All Implemented Interfaces:
HandlerToMakeYourLifeEasier
class to create a ESRI-Worldfile for RasterImages that are exported from Jump,
also for reading existent world files.
- Version:
- $Rev: 2509 $ modified: [sstein]: 16.Feb.2009 changed logger-entries to comments
- Author:
- Ole Rahn
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Listcreates a list of possible worldfile names for the given image file name.booleanMethod that checks if a world file for the given image name can be found.org.locationtech.jts.geom.EnvelopereadWorldFile(int imgWidth, int imgHeight) Retrieve the real world coordinates of the image from the world filevoidsetAllwaysLookForTFWExtension(boolean allwaysLookForTFWExtension) voidsetImageFileName(String imageFileName) booleanwriteWorldFile(org.locationtech.jts.geom.Envelope imageCoordinates, int imgWidth, int imgHeight) Method that writes a world file according to the given coordinate and image information.
-
Field Details
-
worldFileName
-
imageFileName
-
-
Constructor Details
-
WorldFileHandler
- Parameters:
imageFileName- name of the image file the world file is forallwaysLookForTFWExtension- if true the worldFileHandler will look for world files with the extension.tfweven if the image file format would suggest an other extension, like.pgw- this parameter has no influence on the writing of world files!
-
-
Method Details
-
writeWorldFile
public boolean writeWorldFile(org.locationtech.jts.geom.Envelope imageCoordinates, int imgWidth, int imgHeight) Method that writes a world file according to the given coordinate and image information.- Parameters:
imageCoordinates- real world coordinates of the imageimgWidth- width (in pixel) of the imageimgHeight- height (in pixel) of the image- Returns:
- true if a world file was written, else false
-
readWorldFile
public org.locationtech.jts.geom.Envelope readWorldFile(int imgWidth, int imgHeight) Retrieve the real world coordinates of the image from the world file- Parameters:
imgWidth- width (in pixel) of the imageimgHeight- height (in pixel) of the image- Returns:
- real world coordinates of the image
-
createListOfWorldFileNamesForImage
creates a list of possible worldfile names for the given image file name. The first one meets the naming conventions from ESRI, the other names are variations that we got from ArcView, far away from conventions...- Returns:
- a list of possible worldfile names
-
isWorldFileExistentForImage
Method that checks if a world file for the given image name can be found. If so, it's name will be returned and also be stored internally.- Returns:
- the name of the worldfile if existent, else null
-
isAllwaysLookForTFWExtension
public boolean isAllwaysLookForTFWExtension()- Returns:
- Returns the allwaysLookForTFWExtension.
-
setAllwaysLookForTFWExtension
public void setAllwaysLookForTFWExtension(boolean allwaysLookForTFWExtension) - Parameters:
allwaysLookForTFWExtension- The allwaysLookForTFWExtension to set.
-
getImageFileName
- Returns:
- Returns the imageFileName.
-
setImageFileName
- Parameters:
imageFileName- The imageFileName to set.
-
getWorldFileName
- Returns:
- Returns the worldFileName.
-