Package org.geoforge.lang.util.geography.point

Examples of org.geoforge.lang.util.geography.point.GfrPointDms


      else if (Math.abs(lat) <= 89)
         prec = 100000D;
      else
         prec = 10000D;

      return new GfrPointDms(
            Math.round(lon * prec) / prec,
            Math.round(lat * prec) / prec);

   }
View Full Code Here


      double lat_expanded = lat*10000000000000D;

      double lon_rounded = Math.round(lon_expanded);
      double lat_rounded = Math.round(lat_expanded);
     
      return new GfrPointDms(
           lat_rounded/10000000000000D,
           lon_rounded/10000000000000D);
     
   }
View Full Code Here

      double lat_expanded = lat*10000000000000D;

      double lon_rounded = Math.round(lon_expanded);
      double lat_rounded = Math.round(lat_expanded);
     
      return new GfrPointDms(
           lat_rounded/10000000000000D,
           lon_rounded/10000000000000D);
   }
View Full Code Here

      TestConversion[] tests =
      {
         new TestConversion(
         "UTM_36T",
         new GfrPointDms(11.5, 8),
         new GfrPointConical(563967.423103, 6095248.70824),
         PrjCylUtm.s_getInstance()),
         new TestConversion(
         "UTM_36T",
         new GfrPointDms(6, 23),
         new GfrPointConical(563967.423103, 6095248.70824),
         PrjCylUtm.s_getInstance()),
      };

      GfrPointUtm[] utmList =
      {
         new GfrPointUtm(885134.998233339, 775582.60399115, 32, "N"),
         new GfrPointUtm(1051288.26638927, 717270.056573956, 32, "N"),
         new GfrPointUtm(1217441.5345452, 658957.509156762, 32, "N"),
         new GfrPointUtm(1383594.80270113, 600644.961739567, 32, "N"),
         new GfrPointUtm(1715901.33901299, 484019.866905178, 32, "N"),
         new GfrPointUtm(1882054.60716892, 425707.319487984, 32, "N"),
         new GfrPointUtm(2048207.87532485, 367394.772070789, 32, "N"),
         new GfrPointUtm(2214361.14348078, 309082.224653595, 32, "N"),
         new GfrPointUtm(2380514.41163671, 250769.677236401, 32, "N"),
         new GfrPointUtm(2546667.67979265, 192457.129819206, 32, "N"),
      };




      for (int i = 0; i < tests.length; i++)
      {
         GfrPointAbs input = tests[i].getPointInput();
         GfrPrjAbs prj = tests[i].getProjection();

         GfrPointUtm found = GfrUtilConversionCylindricalUtm.s_getUtmCoordinateFromDms(
                 (GfrPointDms) input,
                 (PrjCylAbs) prj);
         tests[i].setPointFound(found);

         System.out.println(found.getZoneNumber() + found.getZoneLetter());


         GfrPointDms crossVal;
         try
         {
            crossVal = GfrUtilConversionCylindricalUtm.s_getDmsCoordinateFromUtm(found, (PrjCylAbs) prj);
            tests[i].setCrossVal(crossVal);
         }
         catch (Exception ex)
         {
            ex.printStackTrace();
         }

         tests[i].show();
      }


      for (int i = 0; i < utmList.length; ++i)
      {
         try
         {
            GfrPointDms pnt = GfrUtilConversionCylindricalUtm.s_getDmsCoordinateFromUtm(utmList[i], PrjCylUtm.s_getInstance());
            pnt.show();
         }
         catch (Exception ex)
         {
            ex.printStackTrace();
         }
View Full Code Here

   {
      TestConversion[] tests =
      {
         new TestConversion(
            "test",
            new GfrPointDms(120, 81),
            new GfrPointConical(10, 10),
            PrjCylUtm.s_getInstance()),
      };


      for (int i = 0; i < tests.length; i++)
      {
         GfrPointDms input = (GfrPointDms) tests[i].getPointInput();
         GfrPrjAbs prj = tests[i].getProjection();

         GfrPointUtm found = GfrUtilConversionCylindricalUtm.s_getUtmCoordinateFromDms(
                 (GfrPointDms) input,
                 (PrjCylAbs) prj);
         tests[i].setPointFound(found);

         System.out.println("number :" +found.getZoneNumber() + ", letter :" +  found.getZoneLetter());


         GfrPointDms crossVal;
         try
         {
            crossVal = GfrUtilConversionCylindricalUtm.s_getDmsCoordinateFromUtm(found, (PrjCylAbs) prj);
            tests[i].setCrossVal(crossVal);
View Full Code Here

   {
      TestConversion[] tests =
      {
         new TestConversion(
         "PrjConLambert93",
         new GfrPointDms(10, 40),
         new GfrPointConical(1300132.2440885678, 5903651.94441981),
         PrjConLambert93.s_getInstance()),
         new TestConversion(
         "3812_PrjConLambert2008",
         new GfrPointDms(10, 40),
         new GfrPointConical(1138158.9936737407, -522382.3696528121),
         PrjConLambert2008.s_getInstance()),
         new TestConversion(
         "SR39_PrjConLambertMexican",
         new GfrPointDms(-80.83594322203, 7.916019558907),
         new GfrPointConical(4897414.312483, -284576.20796),
         PrjConLambertMexico.s_getInstance()),
         new TestConversion(
         "SR39_PrjConLambert1972",
         new GfrPointDms(10, 40),
         new GfrPointConical(639153.261772, -1022369.266852),
         PrjConLambert1972.s_getInstance()),
         new TestConversion(
         "Lambert Carto II ext",
         new GfrPointDms(1.289542, 46.444770),
         new GfrPointConical(519558.64,2161058.15),
         PrjConLambertII_Carto.s_getInstance()),
         new TestConversion(
         "Lambert III",
         new GfrPointDms(1.4681805556, 42.5864644444),
         new GfrPointConical(528701.67,32224.69),
         PrjConLambertIII.s_getInstance()),
        
         new TestConversion(
         "Lambert III",
         new GfrPointDms(1.5214830555555,42.4552458333333),
         new GfrPointConical(532933.35, 17600.64),
         PrjConLambertIII.s_getInstance()),
       
      };



      StopWatch.start();
      /*/
      for(int i = 0; i < tests.length; i++)
      {
      GfrPointAbs input = tests[i].getPointInput();
      GfrPrjAbs prj = tests[i].getProjection();
     
     
      if(input instanceof GfrPointDms && prj instanceof PrjConAbs)//Dms -> conical, Big precision
      {
      GfrPointConical found = UtilConicalConvert.s_getConicalCoordinateFromDmsWithBigPrecision((GfrPointDms)input, (PrjConAbs)prj);
      tests[i].setPointFound(found);
     
     
      GfrPointDms crossVal = UtilConicalConvert.s_getDmsCoordinateFromConicalBigPrecision(found, (PrjConAbs)prj);
      tests[i].setCrossVal(crossVal);
      }
     
      /*/
      /*
     
     
      tests[i].show();
      }
     
      //*/
      for (int i = 0; i < tests.length; i++)
      {
         GfrPointAbs input = tests[i].getPointInput();
         GfrPrjAbs prj = tests[i].getProjection();


         if (input instanceof GfrPointDms && prj instanceof PrjConAbs)//Dms -> conical, Big precision
         {
            GfrPointConical found = GfrUtilConversionConical.s_getConicalCoordinateFromDms((GfrPointDms) input, (PrjConAbs) prj);
            tests[i].setPointFound(found);


            GfrPointDms crossVal = GfrUtilConversionConical.s_getDmsCoordinateFromConical(found, (PrjConAbs) prj);
            tests[i].setCrossVal(crossVal);
         }

         if (input instanceof GfrPointDms && prj instanceof PrjCylAbs)//Dms -> cylindrical, Big precision
         {
            GfrPointUtm found = GfrUtilConversionCylindricalUtm.s_getUtmCoordinateFromDms(
                    (GfrPointDms) input,
                    (PrjCylAbs) prj);
            tests[i].setPointFound(found);

            System.out.println(found.getZoneNumber() + found.getZoneLetter());


            GfrPointDms crossVal = GfrUtilConversionCylindricalUtm.s_getDmsCoordinateFromUtm(found, (PrjCylAbs) prj);
            tests[i].setCrossVal(crossVal);
         }
         tests[i].show();
      }
      //*/
 
View Full Code Here

      else
      {
         strLetter = "K";
      }

      GfrPointDms dms = GfrUtilConversionCylindricalUtm.s_getDmsCoordinateFromUtm(
              new GfrPointUtm(
              douNorthing,
              douEasting,
              zone,
              strLetter),
              PrjCylUtm.s_getInstance());

      return new Point2D.Double(dms.getLongitude(), dms.getLatitude());
   }
View Full Code Here

      if (this._pnlChoice_.getContent().equals(_STR_LAMBERT_II_EXT_))
         prj = PrjConLambertII_Carto.s_getInstance();


      GfrPointDms dms = GfrUtilConversionConical.s_getDmsCoordinateFromConical(
              new GfrPointConical(
              dblX,
              dblY),
              (PrjConAbs) prj);

      return new Point2D.Double(dms.getLongitude(), dms.getLatitude());
   }
View Full Code Here

TOP

Related Classes of org.geoforge.lang.util.geography.point.GfrPointDms

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.