Package com.solfin.tools

Examples of com.solfin.tools.MapPoint


            while (true) {
                try {
                    System.err.println("before readObject");
                    double lat=dis.readDouble();
                    double lon=dis.readDouble();
                    MapPoint mp=new MapPoint(lon,lat);
                    System.err.println("mp is="+mp.toString());
                    add(mp);
                } catch (IOException e) {
                    break;
                } catch (Exception e) {
                    System.err.println("Exception is "+e);
View Full Code Here


    }
    public int closest(MapPoint point) {
        int closestIdx=-1;
        double distance=Double.MAX_VALUE;
        for (int i=0 ; i<numPoints ; ++i) {
            MapPoint p=points[i];
            double d=MapPoint.distanceMeeus(p, point).value();
            if (d<distance) {
                distance=d;
                closestIdx=i;
            }
View Full Code Here

    public MapPoint getLastWaypoint() {
        return (numPoints>0 ? points[numPoints-1] : null);
    }
   
    public MapPoint getBoatEstPos(Calendar atTime) {
        MapPoint boatPos=new MapPoint();
        double boatSpeed=Speed.valueOfKnot(6.0).value(); /* knots*/
       
        /* the first point on the route starts now!
         * so lets calculate the distance the boat could have travelled between
         * now and 'atTime'
View Full Code Here

        };
        return columnNames;
    }
    public Object[][] getAllData() {
        Double distance=0.0;
        MapPoint lastP=null;
       
        Object[][] d=new Object[numPoints][5];
        for (int i=0 ; i<numPoints ; ++i) {
            MapPoint p=points[i];
            d[i][0]=new Integer(i);
            d[i][1]=p.getLatitude();
            d[i][2]=p.getLongitude();
            //d[i][1]=Config.latitudeToString(p.getLatitude().value());
            //d[i][2]=Config.longitudeToString(p.getLongitude().value());
            if (i==0) {
                d[i][3]=new Double(0.0);
                d[i][4]=new Double(0.0);
View Full Code Here

                retIdx[i]=Integer.MAX_VALUE;
                dists[i]=Double.MAX_VALUE;
            }
           
            for (int i=ni*nj-1 ; i>=0 ; --i) {
                MapPoint p2=new MapPoint(getLon(i),getLat(i));
               
                double dist=GribValue.distanceHaversine(p1, p2).value();
                if (dist > dists[lastI])
                    continue;
               
View Full Code Here

TOP

Related Classes of com.solfin.tools.MapPoint

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.