RpfCoverageBox (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.layer.rpf
Class RpfCoverageBox

    java.lang.Object
      com.bbn.openmap.layer.rpf.RpfCoverageBox

    public class RpfCoverageBox

extends java.lang.Object

The RpfCoverageBox describes the coverage provided by a RpfTocEntry within a table of contents file. This should be enough information that lets you tell what you need to ask for the proper subframes to put on a screen.

Field Summary
`java.lang.String` | `chartCode` Two letter code for chart type.
`java.awt.Point` | `endIndexes` The ending index for coverage subframes.
`int` | `entryNumber` The RpfTocEntry index to use to get more information about the frame files to use to get data for a subframe.
`protected java.lang.String` | `id` A semi unique string descriptor.
`double` | `nw_lat`
`double` | `nw_lon`
`float` | `percentCoverage` Of the number of subframes that can fit on the screen, the percentage of them that are on the screen.
`float` | `scale` The scale of the maps of this coverage rectangle.
`double` | `se_lat`
`double` | `se_lon`
`java.awt.Point` | `startIndexes` The starting index for coverage subframes.
`double` | `subframeLatInterval` Lat degrees/subframe; vertInterval*256.
`double` | `subframeLonInterval` Lon degrees/subframe; horizInterval*256.
`int` | `tocNumber` The TOC number that a frame provider can use to get to the right entry number.
`int` | `zone` For the coverage queries, the CADRG zone becomes important.

Constructor Summary
`RpfCoverageBox()`

Method Summary
`java.lang.String` | `getID()` Modified to make the semi-unique ID more unique.
`float` | `getPercentCoverage()` Return the percent coverage of the last queried rectangle.
`int` | `horizontalSubframes()` The number of subframes horizontally within this coverage box.
`void` | `reset()` Reset the coverage percentage and scale difference.
`int` | `setBoundaryHits(double ullat, double ullon, double lrlat, double lrlon)` This is only good for a preliminary check to see of the boundaries are within the range of each other.
`float` | `setPercentCoverage(double ullat, double ullon, double lrlat, double lrlon)` The percentage of subframes that actually fill the queried rectangle, compared to the number of subframes that could fit.
`float` | `setPercentCoverage(double ullat, double ullon, double lrlat, double lrlon, java.awt.Point start, java.awt.Point end)` The percentage of subframes that actually fill the queried rectangle, compared to the number of subframes that could fit.
`java.lang.String` | `toString()`
`int` | `verticalSubframes()` The number of subframes vertically within this coverage box.
`boolean` | `within(float lat, float lon)` Location within box.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### nw_lat

    public double nw_lat

### nw_lon

    public double nw_lon

### se_lat

    public double se_lat

### se_lon

    public double se_lon

### subframeLatInterval

    public double subframeLatInterval

  Lat degrees/subframe; vertInterval*256.

### subframeLonInterval

    public double subframeLonInterval

  Lon degrees/subframe; horizInterval*256.

### chartCode

    public java.lang.String chartCode

  Two letter code for chart type.

### startIndexes

    public java.awt.Point startIndexes

  The starting index for coverage subframes. If it's null, it hasn't been figured out yet.

### endIndexes

    public java.awt.Point endIndexes

  The ending index for coverage subframes. If it's null, it hasn't been figured out yet.

### zone

    public int zone

  For the coverage queries, the CADRG zone becomes important. This is not the zone from the RpfTocEntry - its the translated zone for use with the CADRG projection.

### tocNumber

    public int tocNumber

  The TOC number that a frame provider can use to get to the right entry number. Used internally.

### entryNumber

    public int entryNumber

  The RpfTocEntry index to use to get more information about the frame files to use to get data for a subframe. Used internally.

### scale

    public float scale

  The scale of the maps of this coverage rectangle.

### percentCoverage

    public float percentCoverage

  Of the number of subframes that can fit on the screen, the percentage of them that are on the screen. Should be set via setPercentCoverage, unless you are copying all values as well.

### id

    protected java.lang.String id

  A semi unique string descriptor.

Constructor Detail

### RpfCoverageBox

    public RpfCoverageBox()

Method Detail

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getID

    public java.lang.String getID()

  Modified to make the semi-unique ID more unique. The former method of generating these ID numbers was causing some coverage boxes that are geographically close to each other to have the same ID, which resulted in caching problems. In particular, if two non-identical boxes had the same ID, they could invalidate each others' caches in certain regions. Modified these IDs so that the numbers would be more unique. This was a major cause of gaps at zone boundaries.

  Returns:
    a unique ID for the coverage box

### verticalSubframes

    public int verticalSubframes()

  The number of subframes vertically within this coverage box. NOTE: Empirically noticed that # of subframes sometimes underreported because these cast to an int. Rounding would sometimes overreport, however. Observed that a tolerance of .000001 would define when to round up. This appeared to be causing gaps at zone boundaries, since a coverage box could think it doesn't have a certain subframe, when it actually does.

### horizontalSubframes

    public int horizontalSubframes()

  The number of subframes horizontally within this coverage box. NOTE: Empirically noticed that # of subframes sometimes underreported because these cast to an int. Rounding would sometimes overreport, however. Observed that a tolerance of .000001 would define when to round up. This appeared to be causing gaps at zone boundaries, since a coverage box could think it doesn't have a certain subframe, when it actually does.

### setBoundaryHits

    public int setBoundaryHits(double ullat,
                               double ullon,
                               double lrlat,
                               double lrlon)

  This is only good for a preliminary check to see of the boundaries are within the range of each other.

  Returns:
    how many of the edges of this coverage box fall within the queried box.

### setPercentCoverage

    public float setPercentCoverage(double ullat,
                                    double ullon,
                                    double lrlat,
                                    double lrlon)

  The percentage of subframes that actually fill the queried rectangle, compared to the number of subframes that could fit. As a bonus, the start and end suframe indexes are set.

  Returns:
    the percentage of coverage over the queried rectangle.

### setPercentCoverage

    public float setPercentCoverage(double ullat,
                                    double ullon,
                                    double lrlat,
                                    double lrlon,
                                    java.awt.Point start,
                                    java.awt.Point end)

  The percentage of subframes that actually fill the queried rectangle, compared to the number of subframes that could fit. As a bonus, the start and end suframe indexes are set.

  Returns:
    the percentage of coverage over the queried rectangle.

### getPercentCoverage

    public float getPercentCoverage()

  Return the percent coverage of the last queried rectangle.

### within

    public boolean within(float lat,
                          float lon)

  Location within box. True if it is;

### reset

    public void reset()

  Reset the coverage percentage and scale difference.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details