Examples of OMGeometryList


Examples of com.bbn.openmap.omGraphics.OMGeometryList

     * key by the AreaHandler.
     */
    public PoliticalArea(String name, String identifier) {
        this.id = identifier;
        this.name = name;
        geometry = new OMGeometryList();
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGeometryList

        UTM_DEBUG_VERBOSE = Debug.debugging("utmgrid_verbose");
    }

    protected OMGeometryList createUTMZoneVerticalLines() {

        OMGeometryList verticalList = new OMGeometryList();
        float[] points = null;

        for (int lon = -180; lon < 180; lon += 6) {
            if (lon == 6) {
                points = new float[] { 56f, lon, -80f, lon };
            } else if (lon > 6 && lon < 42) {
                points = new float[] { 72f, lon, -80f, lon };
            } else {
                points = new float[] { 84f, lon, -80f, lon };
            }
            verticalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE));
        }

        points = new float[] { 72f, 6f, 64f, 6f };
        verticalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE));

        points = new float[] { 64f, 3f, 56f, 3f };
        verticalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE));

        points = new float[] { 84f, 9f, 72f, 9f };
        verticalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE));

        points = new float[] { 84f, 21f, 72f, 21f };
        verticalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE));

        points = new float[] { 84f, 33f, 72f, 33f };
        verticalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE));

        verticalList.setLinePaint(utmGridPaint);

        return verticalList;
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGeometryList

        return verticalList;
    }

    protected OMGeometryList createUTMZoneHorizontalLines() {
        OMGeometryList horizontalList = new OMGeometryList();
        float[] points = null;

        for (float lat = -80f; lat <= 72f; lat += 8f) {
            points = new float[] { lat, -180f, lat, -90f, lat, 0f, lat, 90f,
                    lat, 180f };
            horizontalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_RHUMB));
        }

        points = new float[] { 84f, -180f, 84f, -90f, 84f, 0f, 84f, 90f, 84f,
                180f };
        horizontalList.add(new PolylineGeometry.LL(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_RHUMB));

        horizontalList.setLinePaint(utmGridPaint);

        return horizontalList;
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGeometryList

                list.add(line);
            }
        }

        if (doPolys) {
            OMGeometryList polys = new OMGeometryList();
            for (i = 0; i < vertPoints.length; i++) {
                if (UTM_DEBUG_VERBOSE) {
                    for (int k = 0; k < vertPoints[i].length; k += 2) {
                        System.out.println(" for poly " + i + ": lat = "
                                + vertPoints[i][k] + ", lon = "
                                + vertPoints[i][k + 1]);
                    }
                }
                poly = new PolylineGeometry.LL(vertPoints[i], OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE);
                polys.add(poly);
            }
            polys.setLinePaint(distanceGridPaint);
            list.add(polys);
        } else {

            // This doesn't seem to calculate the right
            // lines, although it looks like it should.
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGeometryList

        mgrs.setAccuracy(accuracy);
        MGRSPoint.LLtoMGRS(llp, ellipsoid, mgrs);

        float accuracyBonus = 100000f / (float) Math.pow(10, accuracy);

        OMGeometryList list = new OMGeometryList();

        for (float i = -numRects * accuracyBonus; i < numRects * accuracyBonus; i += accuracyBonus) {
            for (float j = -numRects * accuracyBonus; j < numRects
                    * accuracyBonus; j += accuracyBonus) {
                if (Debug.debugging("utmdistancegrid")) {
                    System.out.print(".");
                }
                list.add(createMGRSRectangle(mgrs,
                        i,
                        j,
                        accuracyBonus,
                        ellipsoid));
            }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGeometryList

            if (numberBasedForScale > 10) {
                numberBasedForScale = 10;
            }
            // Debug.output(numberBasedForScale + "");

            OMGeometryList geoList = createMGRSRectangles(center,
                    distanceGridResolution,
                    numberBasedForScale);

            if (showLabels && p.getScale() <= dglc) {
                Debug.message("utmgrid",
                        "Creating labels for distance lines ...");

                OMGraphicList textList = new OMGraphicList();
                LatLonPoint llp = new LatLonPoint();
                Point point = new Point();
                Iterator it = geoList.iterator();
                while (it.hasNext()) {
                    PolygonGeometry.LL pll = (PolygonGeometry.LL) it.next();
                    String labelString = (String) (pll).getAppObject();
                    if (labelString == null) {
                        continue;
                    }
                    float[] ll = pll.getLatLonArray();
                    llp.setLatLon(ll[0], ll[1], true);

                    p.forward(llp, point);

                    double x = point.getX();
                    double y = point.getY();
                    int buffer = 20;

                    // Lame attempt of testing whether the label is
                    // on-screen
                    if ((x > -buffer || x < p.getWidth() + buffer)
                            && (y > -buffer || y < p.getHeight() + buffer)) {

                        OMText label = new OMText(llp.getLatitude(), llp.getLongitude(), 4, -4, labelString, OMText.JUSTIFY_LEFT);
                        label.setLinePaint(distanceGridPaint);
                        textList.add(label);
                    }
                }
                list.add(textList);
            }

            geoList.setLinePaint(distanceGridPaint);
            list.add(geoList);
        }

        if (labelList != null) {
            labelList.clear();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.