|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.dataAccess.image.geotiff.GeoTIFFFile
public class GeoTIFFFile
GeoTIFFFile is the main object for loading a GeoTIFF image file. Relies on JAI being installed on the machine, because it needs the TIFF capabilities of that package. You can ask for the BufferedImage representing the image in the file, or ask for specific tag information. The GeoTIFFModelFactory can be used to create specific geo-referenced ImageTile objects for display in OpenMap.
Field Summary | |
---|---|
protected java.net.URL |
fileURL
|
protected org.libtiff.jai.codec.XTIFFField[] |
geoKeys
|
protected org.geotiff.image.jai.GeoTIFFDirectory |
gtfDirectory
|
static java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
GeoTIFFFile(java.lang.String filePath)
|
|
GeoTIFFFile(java.net.URL fileURL)
|
Method Summary | |
---|---|
void |
dumpTags(org.libtiff.jai.codec.XTIFFField[] gtfFields)
Prints out the values of the XTIFF Fields provided to it. |
java.awt.image.BufferedImage |
getBufferedImage()
Uses the XTIFF Image Decoder to decode as rendered image, creating a new Buffered Image. |
protected int |
getFieldIntValue(int tiffCode)
Helper function for taking a code from the TIFF spec, and getting the field value as a single int. |
org.libtiff.jai.codec.XTIFFField |
getFieldWithTag(int tagNumber)
Helper function designed to make it easier to get the XTIFF field for a given tag number. |
protected org.libtiff.jai.codec.XTIFFField |
getGeoFieldForCode(int code)
Searches for tag in geo keys. |
int |
getGeographicType()
|
protected int |
getGeoKeyIntValue(int codeFromKeyRegistry)
Helper function for taking a code from the Geo KeyRegistry, and getting the field value as a single int. |
org.libtiff.jai.codec.XTIFFField[] |
getGeoKeys()
Ask specifically for the array of XTIFFFields pertaining to georeferencing. |
org.geotiff.image.jai.GeoTIFFDirectory |
getGtfDirectory()
Very handy class from the file. |
ImageTile |
getImageTile()
Uses a GeoTIFFModelFactory to create a georeferenced ImageTile image. |
ImageTile |
getImageTile(GeoTIFFImageReader id,
ImageTile.Cache cache)
|
int |
getModelType()
Determine which class of model space coordinates are most natural for this dataset:Geographic, Geocentric, or Projected Coordinate System. |
int |
getProjectedCSType()
Here is a summary of the index ranges for the various coding systems used by EPSG in their tables. |
int |
getRasterType()
Pixels derived from scanners or other optical devices represent areas, and most commonly will use the RasterPixelIsArea coordinate system. |
java.lang.String |
getStringOfType(int type)
Helper function that coverts type codes to string representation. |
void |
init(java.net.URL fileURL)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.logging.Logger logger
protected org.geotiff.image.jai.GeoTIFFDirectory gtfDirectory
protected org.libtiff.jai.codec.XTIFFField[] geoKeys
protected java.net.URL fileURL
Constructor Detail |
---|
public GeoTIFFFile(java.lang.String filePath) throws java.net.MalformedURLException, java.io.IOException, java.lang.IllegalArgumentException
java.net.MalformedURLException
java.io.IOException
java.lang.IllegalArgumentException
public GeoTIFFFile(java.net.URL fileURL) throws java.net.MalformedURLException, java.io.IOException, java.lang.IllegalArgumentException
java.net.MalformedURLException
java.io.IOException
java.lang.IllegalArgumentException
Method Detail |
---|
public void init(java.net.URL fileURL) throws java.io.IOException, java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
public java.awt.image.BufferedImage getBufferedImage() throws java.io.IOException
java.io.IOException
- if the file URL is null, or if there's a problem
reading the file.public org.libtiff.jai.codec.XTIFFField getFieldWithTag(int tagNumber)
int tagNumber = KeyRegistry.getCode(KeyRegistry.GEOKEY, "GTModelTypeGeoKey");Once you have the XTIFFField, you can figure out what type it is, and then ask for its values as that type.
tagNumber
-
public org.geotiff.image.jai.GeoTIFFDirectory getGtfDirectory()
public org.libtiff.jai.codec.XTIFFField[] getGeoKeys()
protected org.libtiff.jai.codec.XTIFFField getGeoFieldForCode(int code)
public int getRasterType()
public int getModelType()
public int getProjectedCSType()
Here is a summary of the index ranges for the various coding systems used by EPSG in their tables. A copy of this index may be acquired at the FTP sites mentioned in the references in section 5. The "value" table entries below describe how values from one table are related to codes from another table. Summary -------- Entity digit Range ---------------------------- ------- -------------- Prime Meridian 8 8000 thru 8999 Ellipsoid 7 7000 thru 7999 Geodetic Datum 6 6000 thru 6999 Vertical datum 5 5000 thru 5999 Geographic Coordinate System 4 4000 thru 4999 Projected Coordinate Systems 2 or 3 20000 thru 32760 Map Projection 1 10000 - 19999 Geodetic Datum Codes -------------------- Datum Type Value Range Currently Defined -------------------------- --------- -------------- ----------------- Unspecified Geodetic Datum [EC-1000] 6000 thru 6099 6001 thru 6035 Geodetic Datum 6100 thru 6321 6200 thru 6315 WGS 72; WGS 72BE and WGS84 6322 thru 6327 6322 thru 6327 Geodetic Datum (ancient) 6900 thru 6999 6901 thru 6902 Note for Values: EC = corresponding Ellipsoid Code. Vertical Datum Codes -------------------- Datum Type Value Range Currently Defined -------------------------- --------- -------------- ----------------- Ellipsoidal [EC-1000] 5000 thru 5099 5001 thru 5035 Orthometric 5100 thru 5899 5101 thru 5106 Note for Values: EC = corresponding Ellipsoid Code. Geographic Coordinate System Codes ---------------------------------- GCS Type Value Range Currently Defined ----------------------- ---------- -------------- ----------------- Unknown geodetic datum [GDC-2000] 4000 thru 4099 4001 thru 4045 Known datum (Greenwich) [GDC-2000] 4100 thru 4321 4200 thru 4315 WGS 72; WGS 72BE and WGS84 4322 thru 4327 4322 thru 4327 Known datum (not Greenwich) 4800 thru 4899 4801 thru 4812 Known datum (ancient) [GDC-2000] 4900 thru 4999 4901 thru 4902 Note for Values: GDC = corresponding Geodetic Datum Code Map Projection System Codes --------------------------- US State Plane ( 10000-15999 ) Format: 1sszz where ss is USC&GS State code 01 thru 59 zz is (USC&GS zone code) for NAD27 zones zz is (USC&GS zone code + 30) for NAD83 zones Larger zoned systems ( 16000-17999 ) System Format zz Range -------------------------------- ------- ------- UTM (North) 160zz 01 60 UTM (South) 161zz 01 60 zoned Universal Gauss-Kruger 162zz 04 32 Universal Gauss-Kruger (unzoned) 163zz 04 3 Australian Map Grid 174zz 48 58 Southern African STM 175zz 13 35 Smaller zoned systems ( 18000-18999 ) Format: 18ssz where ss is sequential system number 01 18 z is zone code Single zone projections ( 19900-19999 ) Format: 199ss where ss is sequential system number 00 25 Projected Coordinate Systems ---------------------------- For PCS utilizing GeogCS with code in range 4201 through 4321 (i.e. geodetic datum code 6201 through 6319): As far as is possible the PCS code will be of the format gggzz where ggg is (geodetic datum code -6000) and zz is zone. For PCS utilizing GeogCS with code out of range 4201 through 4321 (i.e.geodetic datum code 6201 through 6319): PCS code 20xxx where xxx is a sequential number WGS72 / UTM North 322zz where zz is UTM zone number 32201 32260 WGS72 / UTM South 323zz where zz is UTM zone number 32301 32360 WGS72BE / UTM North 324zz where zz is UTM zone number 32401 32460 WGS72BE / UTM South 325zz where zz is UTM zone number 32501 32560 WGS84 / UTM North 326zz where zz is UTM zone number 32601 32660 WGS84 / UTM South 327zz where zz is UTM zone number 32701 32760 US State Plane (NAD27) 267xx or 320xx where xx is a sequential number US State Plane (NAD83) 269xx or 321xx where xx is a sequential number
public int getGeographicType()
protected int getGeoKeyIntValue(int codeFromKeyRegistry)
codeFromKeyRegistry
-
protected int getFieldIntValue(int tiffCode)
tiffCode
-
public void dumpTags(org.libtiff.jai.codec.XTIFFField[] gtfFields)
gtfFields
- You can get all of the XTIFFFields from the directory
object, or ask this class for the geokeys.public java.lang.String getStringOfType(int type)
type
- code from XTIFFField.
public ImageTile getImageTile() throws java.io.IOException
java.io.IOException
public ImageTile getImageTile(GeoTIFFImageReader id, ImageTile.Cache cache) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |