Examples of LatLonPoint


Examples of com.bbn.openmap.LatLonPoint

     * points.
     */
    public void setGrabPoints() {

        int renderType = raster.getRenderType();
        LatLonPoint llp1;

        Debug.message("eomg", "EditableOMScalingRaster.setGrabPoints()");

        // Do center point for lat/lon or offset rects
        if (renderType == OMGraphic.RENDERTYPE_LATLON) {

            if (projection != null) {
                if (raster instanceof OMScalingIcon) {
                    setGrabPointsForOMSI();
                    return;
                }

                // Need to figure out which point was moved, and then
                // set the upper left and lower right points
                // accordingly.
                if (movingPoint == gpne) {
                    llp1 = projection.inverse(gpne.getX(), gpne.getY());
                    raster.setULLat(llp1.getLatitude());
                    raster.setLRLon(llp1.getLongitude());
                } else if (movingPoint == gpnw) {
                    llp1 = projection.inverse(gpnw.getX(), gpnw.getY());
                    raster.setULLat(llp1.getLatitude());
                    raster.setULLon(llp1.getLongitude());
                } else if (movingPoint == gpsw) {
                    llp1 = projection.inverse(gpsw.getX(), gpsw.getY());
                    raster.setLRLat(llp1.getLatitude());
                    raster.setULLon(llp1.getLongitude());
                } else if (movingPoint == gpse) {
                    llp1 = projection.inverse(gpse.getX(), gpse.getY());
                    LatLonPoint llp2 = projection.inverse(gpnw.getX(),
                            gpnw.getY());
                    raster.setULLat(llp2.getLatitude());
                    raster.setULLon(llp2.getLongitude());
                    raster.setLRLat(llp1.getLatitude());
                    raster.setLRLon(llp1.getLongitude());
                } else {
                    //movingPoint == gpc
                    llp1 = projection.inverse(gpc.getX(), gpc.getY());
                    raster.setULLat(llp1.getLatitude() + diffy);
                    raster.setULLon(llp1.getLongitude() - diffx);
                    raster.setLRLat(llp1.getLatitude() - diffy);
                    raster.setLRLon(llp1.getLongitude() + diffx);
                }
                raster.setNeedToRegenerate(true);
            }
        }

        boolean settingOffset = getStateMachine().getState() instanceof GraphicSetOffsetState
                && movingPoint == gpo;

        // If the center point is moving, the offset distance changes
        if (renderType == OMGraphic.RENDERTYPE_OFFSET) {

            llp1 = projection.inverse(gpo.getX(), gpo.getY());

            raster.setULLat(llp1.getLatitude());
            raster.setULLon(llp1.getLongitude());

            if (settingOffset || movingPoint == gpc) {
                int halfheight = (gpse.getY() - gpnw.getY()) / 2;
                int halfwidth = (gpse.getX() - gpnw.getX()) / 2;

                // Don't call rect.setLocation because we only want to
                // setNeedToRegenerate if !settingOffset.
                llp1 = projection.inverse(gpc.getX() - halfwidth - gpo.getX(),
                        gpc.getY() - halfheight - gpo.getY());
                LatLonPoint llp2 = projection.inverse(gpc.getX() + halfwidth
                        - gpo.getX(), gpc.getY() + halfheight - gpo.getY());

                raster.setULLat(llp1.getLatitude());
                raster.setULLon(llp1.getLongitude());

                raster.setLRLat(llp2.getLatitude());
                raster.setLRLon(llp2.getLongitude());
            }

            if (!settingOffset) {
                Debug.message("eomg",
                        "EditableOMScalingRaster: updating offset rect");
                if (movingPoint == gpnw || movingPoint == gpse) {
                    llp1 = projection.inverse(gpnw.getX() - gpo.getX(),
                            gpnw.getY() - gpo.getY());
                    LatLonPoint llp2 = projection.inverse(gpse.getX()
                            - gpo.getX(), gpse.getY() - gpo.getY());

                    raster.setULLat(llp1.getLatitude());
                    raster.setULLon(llp1.getLongitude());

                    raster.setLRLat(llp2.getLatitude());
                    raster.setLRLon(llp2.getLongitude());
                } else if (movingPoint == gpne || movingPoint == gpsw) {
                    llp1 = projection.inverse(gpsw.getX() - gpo.getX(),
                            gpne.getY() - gpo.getY());
                    LatLonPoint llp2 = projection.inverse(gpne.getX()
                            - gpo.getX(), gpsw.getY() - gpo.getY());

                    raster.setULLat(llp1.getLatitude());
                    raster.setULLon(llp1.getLongitude());

                    raster.setLRLat(llp2.getLatitude());
                    raster.setLRLon(llp2.getLongitude());
                }
                raster.setNeedToRegenerate(true);
            }

            // Set Location has reset the rendertype, but provides
            // the convenience of setting the max and min values
            // for us.
            raster.setRenderType(OMGraphic.RENDERTYPE_OFFSET);
        }

        // Do the rect height and width for XY and OFFSET render
        // types.
        if (renderType == OMGraphic.RENDERTYPE_XY) {
            Debug.message("eomg", "EditableOMScalingRaster: updating x/y rect");

            if (movingPoint == gpc) {
                int halfheight = (gpse.getY() - gpnw.getY()) / 2;
                int halfwidth = (gpse.getX() - gpnw.getX()) / 2;

                llp1 = projection.inverse(gpc.getX() - halfwidth, gpc.getY()
                        - halfheight);
                LatLonPoint llp2 = projection.inverse(gpc.getX() + halfwidth,
                        gpc.getY() + halfheight);

                raster.setULLat(llp1.getLatitude());
                raster.setULLon(llp1.getLongitude());

                raster.setLRLat(llp2.getLatitude());
                raster.setLRLon(llp2.getLongitude());
            } else if (movingPoint == gpnw || movingPoint == gpse) {
                llp1 = projection.inverse(gpnw.getX(), gpnw.getY());
                LatLonPoint llp2 = projection.inverse(gpse.getX(), gpse.getY());

                raster.setULLat(llp1.getLatitude());
                raster.setULLon(llp1.getLongitude());

                raster.setLRLat(llp2.getLatitude());
                raster.setLRLon(llp2.getLongitude());
            } else if (movingPoint == gpne || movingPoint == gpsw) {
                llp1 = projection.inverse(gpsw.getX(), gpne.getY());
                LatLonPoint llp2 = projection.inverse(gpne.getX(), gpsw.getY());

                raster.setULLat(llp1.getLatitude());
                raster.setULLon(llp1.getLongitude());

                raster.setLRLat(llp2.getLatitude());
                raster.setLRLon(llp2.getLongitude());
            }
        }

        if (projection != null) {
            regenerate(projection);
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

        double distance = getSlopeRun(grid, getContrast());

        // Used for projections of image coordinates. Reused in the
        // loops to save memory.
        LatLonPoint llp = new LatLonPoint();
        Point point = new Point();
        ElevationColors colors = getColors();

        if (colors == null) {
            return SinkGraphic.getSharedInstance();
        }

        // x is the horizontal pixel being modified
        for (short x = 0; x < grid.width; x++) {
            // Check to make sure the pixels we're calculating are on
            // the map.
            int screenx = (int) grid.point1.getX() + x;
            if (screenx < 0 || screenx > proj.getWidth()) {
                incomplete = true;
                continue;
            }

            for (short y = 0; y < grid.height; y++) {

                // Check to make sure the pixels we're calculating are
                // on the map.
                int screeny = (int) grid.point1.getY() + y;
                if (screeny < 0 || screeny > proj.getHeight()) {
                    incomplete = true;
                    continue;
                }

                // OK, on the map.
                point.setLocation(screenx, screeny);
                llp = proj.inverse(point.x, point.y, llp);

                int yc = Math.round((llp.getLatitude() - grid.getLatitude())
                        / grid.getVerticalResolution());
                int xc = Math.round((llp.getLongitude() - grid.getLongitude())
                        / grid.getHorizontalResolution());

                // If the calculated index is out of the data ranges,
                // push it to the end. Don't blow it off, it will
                // cause unfilled data pixel lines to appear. You
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

        int top = 0;
        int bottom = 0;
        int left = 0;
        int right = 0;
        LatLonPoint llp;
        int latoffset = 0;
        int lonoffset = 0;

        boolean doStraight = true;

        if (ntr == false) {

            if (renderType == OMGraphic.RENDERTYPE_LATLON
                    || renderType == OMGraphic.RENDERTYPE_OFFSET) {

                if (projection != null) {
                    float wlon = rect.getWestLon();
                    float nlat = rect.getNorthLat();
                    float elon = rect.getEastLon();
                    float slat = rect.getSouthLat();

                    llp = new LatLonPoint(nlat, wlon);
                    java.awt.Point p = projection.forward(llp);
                    if (renderType == OMGraphic.RENDERTYPE_LATLON) {
                        doStraight = false;
                        top = (int) p.getY();
                        left = (int) p.getX();
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     * want the graphic to change according to the grab points.
     */
    public void setGrabPoints() {

        int renderType = rect.getRenderType();
        LatLonPoint llp1;

        Debug.message("eomg", "EditableOMRect.setGrabPoints()");

        // Do center point for lat/lon or offset rects
        if (renderType == OMGraphic.RENDERTYPE_LATLON) {

            if (projection != null) {

                // Need to figure out which point was moved, and then
                // set the upper left and lower right points
                // accordingly.
                if (movingPoint == gpne) {
                    llp1 = projection.inverse(gpne.getX(), gpne.getY());
                    rect.lat1 = llp1.getLatitude();
                    rect.lon2 = llp1.getLongitude();
                } else if (movingPoint == gpnw) {
                    llp1 = projection.inverse(gpnw.getX(), gpnw.getY());
                    rect.lat1 = llp1.getLatitude();
                    rect.lon1 = llp1.getLongitude();
                } else if (movingPoint == gpsw) {
                    llp1 = projection.inverse(gpsw.getX(), gpsw.getY());
                    rect.lat2 = llp1.getLatitude();
                    rect.lon1 = llp1.getLongitude();
                } else if (movingPoint == gpse) {
                    llp1 = projection.inverse(gpse.getX(), gpse.getY());
                    LatLonPoint llp2 = projection.inverse(gpnw.getX(),
                            gpnw.getY());
                    rect.lat1 = llp2.getLatitude();
                    rect.lon1 = llp2.getLongitude();
                    rect.lat2 = llp1.getLatitude();
                    rect.lon2 = llp1.getLongitude();
                } else {
                    //movingPoint == gpc
                    llp1 = projection.inverse(gpc.getX(), gpc.getY());
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     */
    public OMArc(float latPoint, float lonPoint, int offset_x1, int offset_y1,
            int w, int h, float s, float e) {
        super(RENDERTYPE_OFFSET, LINETYPE_UNKNOWN, DECLUTTERTYPE_NONE);

        center = new LatLonPoint(latPoint, lonPoint);
        off_x = offset_x1;
        off_y = offset_y1;
        width = w;
        height = h;
        start = s;
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     *        direction, matching the OpenMap convention in coordinate
     *        space.
     */
    public OMArc(float latPoint, float lonPoint, float radius, float s, float e) {

        this(new LatLonPoint(latPoint, lonPoint),
             radius,
             Length.DECIMAL_DEGREE,
             -1,
             s,
             e);
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     *        direction, matching the OpenMap convention in coordinate
     *        space.
     */
    public OMArc(float latPoint, float lonPoint, float radius, Length units,
            float s, float e) {
        this(new LatLonPoint(latPoint, lonPoint), radius, units, -1, s, e);
    }
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     *        direction, matching the OpenMap convention in coordinate
     *        space.
     */
    public OMArc(float latPoint, float lonPoint, float radius, Length units,
            int nverts, float s, float e) {
        this(new LatLonPoint(latPoint, lonPoint), radius, units, nverts, s, e);
    }
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

     *
     * @param lat latitude in decimal degrees
     * @param lon longitude in decimal degrees
     */
    public void setLatLon(float lat, float lon) {
        setCenter(new LatLonPoint(lat, lon));
    }
View Full Code Here

Examples of com.bbn.openmap.LatLonPoint

        if (Debug.debugging("coordpanel")) {
            Debug.output("CoordPanel.getLatLon(): lat= " + lat + ", lon= "
                    + lon);
        }

        return (new LatLonPoint(lat, lon));
    }
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.