Package com.bbn.openmap

Examples of com.bbn.openmap.LatLonPoint


     *
     * @param p Point
     * @return Point p
     */
    private Point edge_point(Point p, float current_azimuth) {
        LatLonPoint tmpll = GreatCircle.spherical_between(ctrLat,
                ctrLon,
                MoreMath.HALF_PI/*-epsilon*/,
                current_azimuth);

        float phi = tmpll.radlat_;
View Full Code Here


     * screen.
     *
     * @return LatLonPoint
     */
    public LatLonPoint getUpperLeft() {
        LatLonPoint tmp = new LatLonPoint();
        float lat, lon;

        // over north pole
        if (overNorthPole()) {
            lat = NORTH_POLE;
            lon = -DATELINE;
        }

        // over south pole
        else if (overSouthPole()) {
            lon = -DATELINE;

            // get the left top corner
            tmp = inverse(0, 0, tmp);

            // check for invalid
            if (MoreMath.approximately_equal(tmp.radlon_, ctrLon, 0.0001f)) {
                lat = ctrLat + MoreMath.HALF_PI;
            } else {
                // northernmost coord is left top
                lat = tmp.radlat_;
            }
        }

        // view in northern hemisphere
        else if (ctrLat >= 0f) {
            // get the left top corner
            tmp = inverse(0, 0, tmp);

            // check for invalid
            if (MoreMath.approximately_equal(tmp.radlon_, ctrLon, 0.0001f)) {
                lat = inverse(width / 2, 0, tmp).radlat_;
                lon = -DATELINE;
            } else {
                // westernmost coord is left top
                lon = tmp.radlon_;
                // northernmost coord is center top
                lat = inverse(width / 2, 0, tmp).radlat_;
            }
        }

        // view in southern hemisphere
        else {
            // get the left top corner
            tmp = inverse(0, 0, tmp);

            // check for invalid
            if (MoreMath.approximately_equal(tmp.radlon_, ctrLon, 0.0001f)) {
                lat = ctrLat + MoreMath.HALF_PI;
                lon = -DATELINE;
            } else {
                // northernmost coord is left top
                lat = tmp.radlat_;
                // westernmost coord is left bottom
                lon = inverse(0, height - 1, tmp).radlon_;
            }
        }
        tmp.setLatLon(lat, lon, true);
        //      Debug.output("ul="+tmp);
        return tmp;
    }
View Full Code Here

     * complicated for azimuthal projections.
     *
     * @return LatLonPoint
     */
    public LatLonPoint getLowerRight() {
        LatLonPoint tmp = new LatLonPoint();
        float lat, lon;

        // over north pole
        if (overNorthPole()) {
            lon = DATELINE;

            // get the right bottom corner
            tmp = inverse(width - 1, height - 1, tmp);

            // check for invalid
            if (MoreMath.approximately_equal(tmp.radlon_, ctrLon, 0.0001f)) {
                lat = ctrLat - MoreMath.HALF_PI;
            } else {
                // southernmost coord is right bottom
                lat = tmp.radlat_;
            }
        }

        // over south pole
        else if (overSouthPole()) {
            lat = SOUTH_POLE;
            lon = DATELINE;
        }

        // view in northern hemisphere
        else if (ctrLat >= 0f) {
            // get the right bottom corner
            tmp = inverse(width - 1, height - 1, tmp);

            // check for invalid
            if (MoreMath.approximately_equal(tmp.radlon_, ctrLon, 0.0001f)) {
                lat = ctrLat - MoreMath.HALF_PI;
                lon = DATELINE;
            } else {
                // southernmost coord is right bottom
                lat = tmp.radlat_;
                // easternmost coord is right top
                lon = inverse(width - 1, 0, tmp).radlon_;
            }
        }

        // view in southern hemisphere
        else {
            // get the right bottom corner
            tmp = inverse(width - 1, height - 1, tmp);

            // check for invalid
            if (MoreMath.approximately_equal(tmp.radlon_, ctrLon, 0.0001f)) {
                lat = inverse(width / 2, height - 1, tmp).radlat_;
                lon = DATELINE;
            } else {
                // easternmost coord is right bottom
                lon = tmp.radlon_;
                // southernmost coord is center bottom
                lat = inverse(width / 2, height - 1, tmp).radlat_;
            }
        }
        tmp.setLatLon(lat, lon, true);
        //      Debug.output("lr="+tmp);
        return tmp;
    }
View Full Code Here

        // 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 OrthographicViewHelper(uCtr, scale, width, height);
        }
View Full Code Here

        // convert from screen to world coordinates
        int tx = x - this.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

                nsegs = MAX_RHUMB_SEGS;
        }

        //      Debug.output(
        //              "from=("+from.x+","+from.y+")to=("+to.x+","+to.y+")");
        LatLonPoint llp = inverse(from.x, from.y, new LatLonPoint());
//        LatLonPoint llp2 = inverse(to.x, to.y, new LatLonPoint());
        //      Debug.output(
        //              "invfrom=("+llp.getLatitude()+","+llp.getLongitude()+
        //              ")invto=("+llp2.getLatitude()+","+llp2.getLongitude()+")");
        //      Debug.output("nsegs="+nsegs);
View Full Code Here

            Debug.message("basic", "MultiShapeLayer|" + getName()
                    + ": prepare called with null projection");
            return new OMGraphicList();
        }

        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 masterList = new OMGraphicList();
        OMGraphicList list = null;
        SpatialIndexHandler sih;
        Iterator sii;
View Full Code Here

        }

        float lat = link.dis.readFloat();
        float lon = link.dis.readFloat();

        center = new LatLonPoint(lat, lon);

        scale = link.dis.readFloat();
        height = link.dis.readInt();
        width = link.dis.readInt();
        int length = link.dis.readInt();
View Full Code Here

     */
    public void updateWithParameters(MapBean mapBean) {
        Proj projection = (Proj) mapBean.getProjection();
        Object suggested = getSuggested(PROJECTION_TYPE);
        if (suggested instanceof Class && suggested != projection.getClass()) {
            LatLonPoint center = projection.getCenter();
            projection = (Proj) ProjectionFactory.makeProjection((Class) suggested,
                    center.getLatitude(),
                    center.getLongitude(),
                    projection.getScale(),
                    projection.getWidth(),
                    projection.getHeight());
        }

View Full Code Here

     * @throws exception if a parameter is missing or invalid.
     */
    public Projection create(Properties props) throws ProjectionException {

        try {
            LatLonPoint llp = (LatLonPoint) props.get(ProjectionFactory.CENTER);
            float scale = PropUtils.floatFromProperties(props,
                    ProjectionFactory.SCALE,
                    10000000);
            int height = PropUtils.intFromProperties(props,
                    ProjectionFactory.HEIGHT,
View Full Code Here

TOP

Related Classes of com.bbn.openmap.LatLonPoint

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.