Package org.geoforge.worldwind.util

Source Code of org.geoforge.worldwind.util.GfrGetCaracteristicDimensionFromListOfCoordinates

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.worldwind.util;

import gov.nasa.worldwind.geom.LatLon;
import gov.nasa.worldwind.geom.Position;
import java.util.List;
import org.geoforge.lang.util.geography.GfrUtilDmsOperation;
import org.geoforge.lang.util.number.GfrDouble;

/**
*
* @author robert
*/
public class GfrGetCaracteristicDimensionFromListOfCoordinates
{
   static public double doJob(List<Position> lstPos)
   {
      if (lstPos==null || lstPos.isEmpty())
         return GfrDouble.DBL_NDV;
     
      double dblMinLat = 500;
      double dblMaxLat = -500;
      double dblMinLon = 500;
      double dblMaxLon = -500;
     
      for (Position posCur: lstPos)
      {
         LatLon llnCur = (LatLon) posCur;
        
         double[] dbls = llnCur.asDegreesArray();

         if (dbls[0] < dblMinLat)//=a
            dblMinLat = dbls[0];

         if (dbls[1] < dblMinLon)//=c
            dblMinLon = dbls[1];

         if (dbls[0] > dblMaxLat)//=b
            dblMaxLat = dbls[0];

         if (dbls[1] > dblMaxLon)//=d
            dblMaxLon = dbls[1];
      }
     
      double dist = GfrUtilDmsOperation.s_getDistanceFromDeg(dblMinLat, dblMinLon, dblMaxLat, dblMaxLon);

      dist *= 2;
      return dist;
   }
  
   private GfrGetCaracteristicDimensionFromListOfCoordinates()
   {
     
   }
}
TOP

Related Classes of org.geoforge.worldwind.util.GfrGetCaracteristicDimensionFromListOfCoordinates

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.