Examples of LatLonPoint


Examples of com.bbn.openmap.LatLonPoint

    public static void main(String[] argv) {
        Debug.init();
        Debug.put("coordpanel");
        DMSCoordPanel dms = new DMSCoordPanel();
        dms.setLatLon(new LatLonPoint(40.8000000000f, -75.200000000000f));
        System.exit(0);
    }
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

                shape = createShape(xpoints[0], ypoints[0], false);

                isPolyline = true;

            } else {
                ArrayList lines = proj.forwardLine(new LatLonPoint(latlons[0], latlons[1]),
                        new LatLonPoint(latlons[2], latlons[3]),
                        lineType,
                        nsegs);
                int size = lines.size();

                xpoints = new int[(int) (size / 2)][0];
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

            //if it does, the values don't work out right because the
            //pixel spacings are different. If the zones are
            //different, we need to recalculate the scale based on
            // the
            //new zone.
            CADRG newcadrg = new CADRG(new LatLonPoint(nCenterLat, nCenterLon), ret, getWidth(), getHeight());

            // Use the recursiveCount to prevent extended recalls. A
            // couple rounds should suffice.
            if (newcadrg.getZone() != zone && recursiveCount < 2) {
                ret = newcadrg.getScale(ll1,
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

                ///////////////////////////////////

                int clear = 0x00000000;

                Point ctp = new Point();
                LatLonPoint llp = new LatLonPoint();
                LatLonPoint center = p.getCenter();

                for (int i = 0; i < projWidth; i++) {
                    for (int j = 0; j < projHeight; j++) {
                        p.inverse(i, j, llp);
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

        // We have no way of constructing the User Space at anything
        // other than 0,0 for now.
        if (uCtr == null) {
            uCtrLat = (float) 0.0;
            uCtrLon = (float) 0.0;
            uCtr = new LatLonPoint(uCtrLat, uCtrLon);
        }

        if (helper == null) {
            helper = new MercatorViewHelper(uCtr, scale, width, height);
        }
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

        // convert from screen to world coordinates
        int tx = x - wx + dUSX;
        int ty = this.hy - y + dUSY;

        // This is only to aid printing....
        LatLonPoint tllp = helper.inverse(tx, ty, llp);

        Debug.message("mercatorview-i", "xy: " + x + "," + y + " txty: " + tx
                + "," + ty + " llp: " + tllp.getLongitude() + ","
                + tllp.getLatitude());

        return (helper.inverse(tx, ty, llp));
    }
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     * @return OMGraphicList
     */
    public synchronized OMGraphicList prepare() {

        Projection projection = getProjection();
        LatLonPoint ul = projection.getUpperLeft();
        LatLonPoint lr = projection.getLowerRight();
        float ulLat = ul.getLatitude();
        float ulLon = ul.getLongitude();
        float lrLat = lr.getLatitude();
        float lrLon = lr.getLongitude();

        OMGraphicList list = areas.getGraphics(ulLat,
                ulLon,
                lrLat,
                lrLon,
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     * change according to the grab points.
     */
    public void setGrabPoints() {
        int i;
        GrabPoint gb; // just to use a temp marker
        LatLonPoint llp = new LatLonPoint();
        int renderType = poly.getRenderType();
        if (renderType == OMGraphic.RENDERTYPE_LATLON) {
            if (projection != null) {
                float[] floats = new float[polyGrabPoints.size() * 2];
                for (i = 0; i < polyGrabPoints.size(); i++) {
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

                float[] ll = poly.getLatLonArray();
                int actualPosition = (position == Integer.MAX_VALUE ? ll.length
                        : position * 2);

                LatLonPoint llpnt = projection.inverse(x, y);

                if (Debug.debugging("eomp")) {
                    Debug.output("EditableOMPoly: adding point to lat/lon poly at "
                            + x + ", " + y + ": " + llpnt + ", at the end of ");

                    for (int j = 0; j < ll.length; j += 2) {
                        Debug.output(ll[j] + ", " + ll[j + 1]);
                    }
                }

                float[] newll = new float[ll.length + 2];

                if (actualPosition >= ll.length) {
                    // Put the new points at the end
                    if (ll.length != 0) {
                        System.arraycopy(ll, 0, newll, 0, ll.length);
                    }
                    newll[ll.length] = llpnt.radlat_;
                    newll[ll.length + 1] = llpnt.radlon_;

                    position = ll.length / 2;

                } else if (actualPosition <= 0) {
                    // Put the new point at the beginning
                    System.arraycopy(ll, 0, newll, 2, ll.length);
                    newll[0] = llpnt.radlat_;
                    newll[1] = llpnt.radlon_;
                    position = 0;
                } else {
                    // actualPosition because there are 2 floats for
                    // every
                    // position.
                    newll[actualPosition] = llpnt.radlat_;
                    newll[actualPosition + 1] = llpnt.radlon_;
                    System.arraycopy(ll, 0, newll, 0, actualPosition);
                    System.arraycopy(ll,
                            actualPosition,
                            newll,
                            actualPosition + 2,
                            ll.length - actualPosition);
                }
                poly.setLocation((float[]) newll, OMGraphic.RADIANS);
            }
        } else if (renderType == OMGraphic.RENDERTYPE_XY) {
            // Grab the projected endpoints
            Debug.message("eomg", "EditableOMPoly: adding point to x/y poly");
            int currentLength = poly.xs.length;
            int[] newxs = new int[currentLength + 1];
            int[] newys = new int[currentLength + 1];

            if (position >= currentLength) {
                // Put the new points at the end
                System.arraycopy(poly.xs, 0, newxs, 0, currentLength);
                System.arraycopy(poly.ys, 0, newys, 0, currentLength);
                newxs[currentLength] = x;
                newys[currentLength] = y;

                position = currentLength;

            } else if (position <= 0) {
                // Put the new points at the beginning
                System.arraycopy(poly.xs, 0, newxs, 1, currentLength);
                System.arraycopy(poly.ys, 0, newys, 1, currentLength);
                newxs[0] = x;
                newys[0] = y;

                position = 0;

            } else {
                newxs[position] = x;
                newys[position] = y;

                System.arraycopy(poly.xs, 0, newxs, 0, position);
                System.arraycopy(poly.xs,
                        position,
                        newxs,
                        position + 1,
                        currentLength - position);

                System.arraycopy(poly.ys, 0, newys, 0, position);
                System.arraycopy(poly.ys,
                        position,
                        newys,
                        position + 1,
                        currentLength - position);
            }

            poly.setLocation(newxs, newys);

        } else {
            // Rendertype is offset...
            // Grab the projected endpoints
            Debug.message("eomg", "EditableOMPoly: adding point to offset poly");
            int currentLength = poly.xs.length;
            int[] newxs = new int[currentLength + 1];
            int[] newys = new int[currentLength + 1];

            if (position >= currentLength) {
                // Put the new points at the end
                position = currentLength;

                System.arraycopy(poly.xs, 0, newxs, 0, currentLength);
                System.arraycopy(poly.ys, 0, newys, 0, currentLength);

            } else if (position <= 0) {
                // Put the new points at the beginning
                position = 0;

                System.arraycopy(poly.xs, 0, newxs, 1, currentLength);
                System.arraycopy(poly.ys, 0, newys, 1, currentLength);

            } else {

                System.arraycopy(poly.xs, 0, newxs, 0, position);
                System.arraycopy(poly.xs,
                        position,
                        newxs,
                        position + 1,
                        currentLength - position);

                System.arraycopy(poly.ys, 0, newys, 0, position);
                System.arraycopy(poly.ys,
                        position,
                        newys,
                        position + 1,
                        currentLength - position);
            }

            int offsetX;
            int offsetY;

            if (gpo.getX() == -1 && gpo.getY() == -1) {
                offsetX = projection.getWidth() / 2;
                offsetY = projection.getHeight() / 2;
            } else {
                offsetX = gpo.getX();
                offsetY = gpo.getY();
            }

            if (poly.coordMode == OMPoly.COORDMODE_ORIGIN || position == 0) { // cover
                // the
                // first
                // point

                newxs[position] = x - offsetX;
                newys[position] = y - offsetY;
            } else { // CMode Previous offset deltas
                newxs[position] = x - offsetX - newxs[position - 1];
                newys[position] = y - offsetY - newys[position - 1];
            }

            if (position == 0) {
                // Could call projection.getCenter() but that might
                // break if/when we make other projection
                // libraries/paradigms active.
                LatLonPoint llpnt = projection.inverse(offsetX, offsetY);
                poly.lat = llpnt.radlat_;
                poly.lon = llpnt.radlon_;
            }

            poly.setLocation(poly.lat,
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     * Sets up user interface.
     */
    public void setupUI() {
        getContentPane().setLayout(new BorderLayout());
        setSize(640, 480);
        _mapBean.setCenter(new LatLonPoint(43.0f, -95.0f));
        _mapBean.setScale(120000000f);
        _layers = new Layer[1];

        Properties props = new Properties();
        props.put("prettyName", "Graticule");
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.