Package com.bbn.openmap

Examples of com.bbn.openmap.LatLonPoint


        _leos.writeDouble(0.0);
        _leos.writeDouble(0.0);

        for (int i = 0; i < list.size(); i++) {
            OMPoint point = (OMPoint) list.getOMGraphicAt(i);
            LatLonPoint pt = new LatLonPoint(point.getLat(), point.getLon());

            // Record header...
            _leos.writeInt(i + 1); // Record numbers start with 1
            _leos.writeInt(indexData[1][i]);

            // Beginning of Geometry data
            _leos.writeLEInt(list.getType());

            Float lat = new Float(pt.getLatitude());
            Float lon = new Float(pt.getLongitude());

            _leos.writeLEDouble(lon.doubleValue());
            _leos.writeLEDouble(lat.doubleValue());
        }
        _leos.flush();
View Full Code Here


            // Get the default MapBean that the BasicMapPanel created.
            MapBean mapBean = mapPanel.getMapBean();

            // Set the map's center
            mapBean.setCenter(new LatLonPoint(43.0f, -95.0f));

            // Set the map's scale 1:120 million
            mapBean.setScale(120000000f);

            /*
 
View Full Code Here

        modified = false;
    }

    public float getLengthInKilometers() {
        float kilometers = 0.0f;
        LatLonPoint prevPoint = points[0].getLocation();
        // logger.warning ("" + this + " pt 0 " + points[0] + " pt 1 "
        // + points[1] + " getSecondInter " + getSecondIntersection
        // ());
        for (int i = 1; i < points.length; i++) {
            LatLonPoint thisPoint = points[i].getLocation();
            kilometers += GreatCircle.spherical_distance(prevPoint.getLatitude(),
                    prevPoint.getLongitude(),
                    thisPoint.getLatitude(),
                    thisPoint.getLongitude());
            prevPoint = thisPoint;
        }
        return kilometers;
    }
View Full Code Here

            return Float.MAX_VALUE;
        return getLengthInKilometers() / getRoadClass().getConvoySpeed();
    }

    public LatLonPoint getLocationAtKilometer(float kilometers) {
        LatLonPoint prevPoint = points[0].getLocation();
        float prevLat = prevPoint.getLatitude();
        float prevLon = prevPoint.getLongitude();
        for (int i = 1; i < points.length; i++) {
            LatLonPoint thisPoint = points[i].getLocation();
            float thisLat = thisPoint.getLatitude();
            float thisLon = thisPoint.getLongitude();
            float thisLength = GreatCircle.spherical_distance(prevLat,
                    prevLon,
                    thisLat,
                    thisLon);
            if (thisLength >= kilometers) {
                float fraction = kilometers / thisLength;
                float deltaLat = thisLat - prevLat;
                float deltaLon = thisLon - prevLon;
                if (deltaLon < -180f)
                    deltaLon += 360f;
                else if (deltaLon > 180f)
                    deltaLon -= 360f;
                return new LatLonPoint(prevLat + fraction * deltaLat, prevLon
                        + fraction * deltaLon);
            }
            kilometers -= thisLength;
            prevPoint = thisPoint;
            prevLat = thisLat;
View Full Code Here

        locationCenterYPixel = ((double) getHeight() / 2d);
       
        locationPixelsPerLambert = (double)getPPM() / getScale();
       
        Point2D lp = new Point2D.Double();
        LatLonPoint origin = new LatLonPoint(referenceLatitude, centralMeridian);
        LLToWorld(origin.getLatitude(), origin.getLongitude(), lp);
        locationOriginX = lp.getX();
        locationOriginY = lp.getY();
       
        LatLonPoint center = getCenter();
        LLToWorld(center.getLatitude(), center.getLongitude(), lp);
        locationCenterXLambert = lp.getX();
        locationCenterYLambert = lp.getY();
       
        if (Debug.debugging("Lambert")) {
            Debug.output("Creating LambertConformal: center x = "
View Full Code Here

     * @return LatLonPoint llp
     * @see Proj#inverse(Point)
     */
    public LatLonPoint inverse(int x, int y, LatLonPoint llp) {
        if (llp == null) {
            llp = new LatLonPoint();
        }
        // convert from screen to world coordinates
        pixelToLL(x, y, llp);
        return llp;
    }
View Full Code Here

     */
    public LatLonPoint getUpperLeft() {
        // In a conic projection the upper left is meaningless
        // unless at realitively small scales.
        // Return 90.0 -180 until someone fugures out a better way.
        return new LatLonPoint(90.0, -180.0);
    }
View Full Code Here

     */
    public LatLonPoint getLowerRight() {
        // In a conic projection the upper left is meaningless
        // unless at realitively small scales.
        // Return 90.0 -180 until someone fugures out a better way.
        return new LatLonPoint(-90.0, 180.0);
    }
View Full Code Here

        Debug.init();
        Debug.put("Lambert");
        LambertConformal proj = null;
       
        proj = new LambertConformal(
                new LatLonPoint(50.679572292f, 5.807370150f),
                100000.0f,
                620,
                480,
                4.3569395237f, //centralMeridian
                49.833333109f, //lambert_sp_one
                51.166666321f, //lambert_sp_two
                90.0f, //referenceLatitude
                150000.01f, //falseEasting
                5400088.44f, //falseNorthing
                Ellipsoid.WGS_84);
       
        Debug.message("Lambert", "(1)" + proj.inverse(310, 240));
       
        LatLonPoint llp = new LatLonPoint(0.0f, 0.0f);
        Debug.message("Lambert", "(2)" + proj.worldToLL(251763.20f, 153034.13f, llp));
       
        Point2D lp = new Point2D.Double();
        LatLonPoint pt = new LatLonPoint(50.679572292f, 5.807370150f);
        Debug.message("Lambert", "(3)" + proj.LLToWorld(pt.getLatitude(), pt.getLongitude(), lp));
    }
View Full Code Here

        OMText text = (OMText) graphic;
        boolean ntr = text.getNeedToRegenerate();
        int renderType = text.getRenderType();

        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 lon = text.getLon();
                    float lat = text.getLat();

                    llp = new LatLonPoint(lat, lon);
                    java.awt.Point p = projection.forward(llp);
                    if (renderType == OMGraphic.RENDERTYPE_LATLON) {
                        doStraight = false;
                        gpc.set((int) p.getX(), (int) p.getY());
                    } else {
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.