Class TSVectorReader
- All Implemented Interfaces:
Iterable<Feature>
,FeatureSource
The TeraScan vector reader class reads databases in the SeaSpace TeraScan package vector file format. The file format is as follows. Each file contains a 180x360 1 degree square index, followed by a heap filled with variable length vectors. The 1 degree squares are numbered as follows:
square = (lower-lat + 90) * 360 + left-lon + 180
where -90 <= lat < 90 and -180 <= lon < 180. The index is a 180x360 long integer array, indexed by square number. The index entry for a given square is the offset to the first vector in the heap for that square. The offset to the first vector in the heap is 0. All vectors for a given square are contiguous in the heap. The index entry for a square with no vectors is 0. (-1 would have been a better choice!)
The format for a given vector in the heap is shown here:
long integer square number long integer number of (lat,lon) pairs in vector short int lat offset #1 from lower lat in seconds short int lon offset #1 from left lon in seconds short int lat offset #2 from lower lat in seconds short int lon offset #2 from left lon in seconds
Because vector segments can cross the boundaries of squares, lat and lon offsets can fall outside the range 0 to 3600 seconds.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.International boundaries database.static final String
Deprecated.National boundaries (states) database.Fields inherited from class noaa.coastwatch.render.feature.AbstractFeatureSource
area, featureList
-
Constructor Summary
ConstructorDescriptionTSVectorReader
(File file) Deprecated.Creates a new TeraScan vector reader from the database file.TSVectorReader
(String name) Deprecated.Creates a new TeraScan vector reader from a predefined database name. -
Method Summary
Modifier and TypeMethodDescriptionreadPolyline
(int[] square, DataInput in) Deprecated.Reads a polyline from the specified input.protected void
select()
Deprecated.Selects a set of features from the data source based on the current area.Methods inherited from class noaa.coastwatch.render.feature.LineFeatureSource
render
Methods inherited from class noaa.coastwatch.render.feature.AbstractFeatureSource
getArea, getAttributeCount, getAttributeNameMap, getAttributes, getFilter, iterator, select, setAttributes, setFilter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
POLITICAL
Deprecated.International boundaries database.- See Also:
-
STATES
Deprecated.National boundaries (states) database.- See Also:
-
-
Constructor Details
-
TSVectorReader
Deprecated.Creates a new TeraScan vector reader from a predefined database name.- Parameters:
name
- the predefined database name.- Throws:
IOException
- if the predefined database is invalid.
-
TSVectorReader
Deprecated.Creates a new TeraScan vector reader from the database file.- Parameters:
file
- the database file.
-
-
Method Details
-
select
Deprecated.Description copied from class:AbstractFeatureSource
Selects a set of features from the data source based on the current area.- Specified by:
select
in classAbstractFeatureSource
- Throws:
IOException
- if an error occurred accessing the data source.
-
readPolyline
Deprecated.Reads a polyline from the specified input.- Parameters:
square
- the grid square coordinates as [lat, lon].in
- the data input. The polyline is constructed by reading at the current input position.- Returns:
- a new polyline as a vector of earth locations.
- Throws:
IOException
- if an error occurred reading the data file.
-
BinnedGSHHSLineReader
class which provides better performance for reading and rendering. The problem is that the TeraScan vector files only have one resolution and so render very slowly for large areas. The actual vectors rendered will differ between the data files provided by this class and the GSHHS data files because the TeraScan data is from the Digital Chart of the World (DCW) and the GSHHS data is from the CIA World Data Bank II (WDBII).