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).public class TSVectorReader extends LineFeatureSource
square = (lower-lat + 90) * 360 + left-lon + 180where -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 secondsBecause vector segments can cross the boundaries of squares, lat and lon offsets can fall outside the range 0 to 3600 seconds.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POLITICAL
Deprecated.
International boundaries database.
|
static java.lang.String |
STATES
Deprecated.
National boundaries (states) database.
|
area, featureList
Constructor and Description |
---|
TSVectorReader(java.io.File file)
Deprecated.
Creates a new TeraScan vector reader from the database file.
|
TSVectorReader(java.lang.String name)
Deprecated.
Creates a new TeraScan vector reader from a predefined
database name.
|
Modifier and Type | Method and Description |
---|---|
LineFeature |
readPolyline(int[] square,
java.io.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.
|
render
getArea, getAttributeCount, getAttributeNameMap, getAttributes, getFilter, iterator, select, setAttributes, setFilter
public static final java.lang.String POLITICAL
public static final java.lang.String STATES
public TSVectorReader(java.lang.String name) throws java.io.IOException
name
- the predefined database name.java.io.IOException
- if the predefined database is invalid.public TSVectorReader(java.io.File file)
file
- the database file.protected void select() throws java.io.IOException
AbstractFeatureSource
select
in class AbstractFeatureSource
java.io.IOException
- if an error occurred accessing the data source.public LineFeature readPolyline(int[] square, java.io.DataInput in) throws java.io.IOException
square
- the grid square coordinates as [lat, lon].in
- the data input. The polyline is constructed by reading
at the current input position.java.io.IOException
- if an error occurred reading the data file.