/*
* Copyright (C) 2011-2014 GeoForge Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.geoforge.worldwind._tempo.defaul;
import org.geoforge.lang.util.geography.point.GfrPointDms;
import org.geoforge.lang.util.geography.point.GfrPointConical;
import org.geoforge.lang.util.geography.point.GfrPointUtm;
import org.geoforge.lang.util.geography.projection.GfrPrjAbs;
import org.geoforge.lang.util.geography.projection.cylindrical.PrjCylAbs;
import org.geoforge.lang.util.geography.projection.cylindrical.PrjCylUtm;
import org.geoforge.lang.util.geography.GfrUtilConversionCylindrical;
import org.geoforge.lang.util.geography.GfrUtilConversionCylindricalUtm;
import org.geoforge.lang.util.geography.GfrUtilDmsOperation;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
public class UtmTest
{
public static void main(String[] args)
{
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);
System.out.println("distance = " + GfrUtilDmsOperation.s_getDistanceFromDeg(input, crossVal));
}
catch (Exception ex)
{
ex.printStackTrace();
}
tests[i].show();
}
}
}