Package com.bbn.openmap.layer.rpf

Examples of com.bbn.openmap.layer.rpf.RpfCoverageBox


    protected CRFPCoverageBox[] vectorToCRFPCoverageBoxes(Vector vector) {
        int size = vector.size();
        CRFPCoverageBox[] rets = new CRFPCoverageBox[size];

        for (int i = 0; i < size; i++) {
            RpfCoverageBox box = (RpfCoverageBox) vector.elementAt(i);
            if (box != null) {
                rets[i] = new CRFPCoverageBox((float) box.nw_lat, (float) box.nw_lon, (float) box.se_lat, (float) box.se_lon, box.subframeLatInterval, box.subframeLonInterval, box.chartCode, (short) box.zone, new XYPoint((short) box.startIndexes.x, (short) box.startIndexes.y), new XYPoint((short) box.endIndexes.x, (short) box.endIndexes.y), (short) box.tocNumber, (short) box.entryNumber, box.scale, box.percentCoverage);
            }
        }
        return rets;
View Full Code Here


        //int pZone = p.getZone();
        int i, x, y;

        double frameLatInterval = Double.MAX_VALUE;
        double frameLonInterval = Double.MAX_VALUE;
        RpfCoverageBox rcb;
        for (i = 0; i < size; i++) {
            rcb = (RpfCoverageBox) results.elementAt(i);
            if (rcb.subframeLatInterval < frameLatInterval) {
                frameLatInterval = rcb.subframeLatInterval;
            }
            if (rcb.subframeLonInterval < frameLonInterval) {
                frameLonInterval = rcb.subframeLonInterval;
            }
        }

        if (frameLatInterval == Double.MAX_VALUE
                || frameLonInterval == Double.MAX_VALUE) {
            return 0.0f;
        }

        int numHFrames = (int) Math.ceil((lrlon - ullon) / frameLonInterval);
        int numVFrames = (int) Math.ceil((ullat - lrlat) / frameLatInterval);

        boolean[][] coverage = new boolean[numHFrames][numVFrames];
        for (i = 0; i < size; i++) {

            rcb = (RpfCoverageBox) results.elementAt(i);
            if (rcb.percentCoverage == 100) {
                return 1.0f;
            }

            for (y = 0; y < numVFrames; y++) {
                for (x = 0; x < numHFrames; x++) {
                    // degree location of indexs
                    float yFrameLoc = (float) (lrlat + (y * frameLatInterval));
                    float xFrameLoc = (float) (ullon + (x * frameLonInterval));
                    if (coverage[x][y] == false) {
                        if (rcb.within(yFrameLoc, xFrameLoc)) {
                            coverage[x][y] = true;
                        }
                    }
                }
            }
View Full Code Here

    protected Vector translateCRFPCoverageBoxes(CRFPCoverageBox[] boxes) {

        Vector vector = new Vector();
        for (int i = 0; i < boxes.length; i++) {
            CRFPCoverageBox box = boxes[i];
            RpfCoverageBox rcb = new RpfCoverageBox();
            rcb.nw_lat = box.nw_lat;
            rcb.nw_lon = box.nw_lon;
            rcb.se_lat = box.se_lat;
            rcb.se_lon = box.se_lon;
            rcb.subframeLatInterval = box.subframeLatInterval;
View Full Code Here

TOP

Related Classes of com.bbn.openmap.layer.rpf.RpfCoverageBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.