Package noaa.coastwatch.render.feature
Class BinnedGSHHSReader.Bin.Segment
java.lang.Object
noaa.coastwatch.render.feature.BinnedGSHHSReader.Bin.Segment
- Enclosing class:
- BinnedGSHHSReader.Bin
The segment class acts as a container for GSHHS shore segment
data. Segments are part of a larger GSHHS polygon that has
been divided into shorter sections based on their respective
bins. A segment contains a number of keys to help sort
segments based on entry and exit positions. The entry and exit
keys sort the segment based on a counter-clockwise position
starting at the south-west corner of the bin.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The segment closed constant.static final int
Island in lake level constant.static final int
Lake level constant.static final int
Land level constant.static final int
Pond in island in lake level constant. -
Constructor Summary
ConstructorDescriptionSegment
(byte level, byte entry, byte exit, double area, short[] dx, short[] dy) Creates a new segment from the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getArea()
Gets the segment area in km^2.short[]
getDx()
Gets the raw segment longitude offsets.short[]
getDy()
Gets the raw segment latitude offsets.Gets the entry sorting key.byte
Gets the segment entry side.Gets the exit sorting key.byte
Gets the segment exit side.byte
getLevel()
Gets the segment level.Gets the earth vector for this segment.boolean
isClosed()
Determines if this segment is closed.boolean
isLand()
Determines if this polygon segment encloses land.boolean
isWater()
Determines if this polygon segment encloses water.toString()
Returns a string representation of this segment.
-
Field Details
-
LAND
public static final int LANDLand level constant.- See Also:
-
LAKE
public static final int LAKELake level constant.- See Also:
-
ISLAND_IN_LAKE
public static final int ISLAND_IN_LAKEIsland in lake level constant.- See Also:
-
POND_IN_ISLAND
public static final int POND_IN_ISLANDPond in island in lake level constant.- See Also:
-
CLOSED
public static final int CLOSEDThe segment closed constant.- See Also:
-
-
Constructor Details
-
Segment
public Segment(byte level, byte entry, byte exit, double area, short[] dx, short[] dy) Creates a new segment from the specified parameters.- Parameters:
level
- the segment level: land, lake, island, or pond.entry
- the segment starting side: north, south, east, west, or closed.exit
- the segment ending side: north, south, east, west, or closed.area
- the area of the segment polygon in km^2.dx
- the array of scaled longitudes relative to the bin corner.dy
- the array of scaled latitudes relative to the bin corner.
-
-
Method Details
-
toString
Returns a string representation of this segment. -
getLevel
public byte getLevel()Gets the segment level. -
getEntrySide
public byte getEntrySide()Gets the segment entry side. -
getExitSide
public byte getExitSide()Gets the segment exit side. -
getArea
public double getArea()Gets the segment area in km^2. -
getLineFeature
Gets the earth vector for this segment. -
getDx
public short[] getDx()Gets the raw segment longitude offsets. -
getDy
public short[] getDy()Gets the raw segment latitude offsets. -
isClosed
public boolean isClosed()Determines if this segment is closed. -
getEntryKey
Gets the entry sorting key. -
getExitKey
Gets the exit sorting key. -
isLand
public boolean isLand()Determines if this polygon segment encloses land. -
isWater
public boolean isWater()Determines if this polygon segment encloses water.
-