/*
* 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.GfrPointAbs;
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;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
public class TestAlignement
{
public static void main(String[] args)
{
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();
}
}
}
}