public class WorldFileHandler extends java.lang.Object implements HandlerToMakeYourLifeEasier
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
imageFileName |
protected java.lang.String |
worldFileName |
Constructor and Description |
---|
WorldFileHandler(java.lang.String imageFileName,
boolean allwaysLookForTFWExtension) |
Modifier and Type | Method and Description |
---|---|
protected java.util.List |
createListOfWorldFileNamesForImage()
creates a list of possible worldfile names for the given image
file name.
|
java.lang.String |
getImageFileName() |
java.lang.String |
getWorldFileName() |
boolean |
isAllwaysLookForTFWExtension() |
java.lang.String |
isWorldFileExistentForImage()
Method that checks if a world file for the given image name can be found.
|
com.vividsolutions.jts.geom.Envelope |
readWorldFile(int imgWidth,
int imgHeight)
Retrieve the real world coordinates of the image from the world file
|
void |
setAllwaysLookForTFWExtension(boolean allwaysLookForTFWExtension) |
void |
setImageFileName(java.lang.String imageFileName) |
boolean |
writeWorldFile(com.vividsolutions.jts.geom.Envelope imageCoordinates,
int imgWidth,
int imgHeight)
Method that writes a world file according to the given coordinate
and image information.
|
protected java.lang.String worldFileName
protected java.lang.String imageFileName
public WorldFileHandler(java.lang.String imageFileName, boolean allwaysLookForTFWExtension)
imageFileName
- name of the image file the world file is forallwaysLookForTFWExtension
- if true the worldFileHandler will look for
world files with the extension .tfw
even if the image file format
would suggest an other extension, like .pgw
- this parameter has no influence
on the writing of world files!public boolean writeWorldFile(com.vividsolutions.jts.geom.Envelope imageCoordinates, int imgWidth, int imgHeight)
imageCoordinates
- real world coordinates of the imageimgWidth
- width (in pixel) of the imageimgHeight
- height (in pixel) of the imagepublic com.vividsolutions.jts.geom.Envelope readWorldFile(int imgWidth, int imgHeight)
imgWidth
- width (in pixel) of the imageimgHeight
- height (in pixel) of the imageprotected java.util.List createListOfWorldFileNamesForImage()
public java.lang.String isWorldFileExistentForImage()
public boolean isAllwaysLookForTFWExtension()
public void setAllwaysLookForTFWExtension(boolean allwaysLookForTFWExtension)
allwaysLookForTFWExtension
- The allwaysLookForTFWExtension to set.public java.lang.String getImageFileName()
public void setImageFileName(java.lang.String imageFileName)
imageFileName
- The imageFileName to set.public java.lang.String getWorldFileName()