internal GeographicCoordinateSystem( 
			IAngularUnit angularUnit, 
			IHorizontalDatum horizontalDatum, 
			IPrimeMeridian primeMeridian, 
			IAxisInfo axis0, 
			IAxisInfo axis1,
			string remarks, string authority, string authorityCode, string name, string alias, string abbreviation)
			: base(remarks, authority, authorityCode, name, alias, abbreviation)
		{
			_angularUnit = angularUnit;
			_horizontalDatum = horizontalDatum;
			_primeMeridian = primeMeridian;
			_axisInfo = new IAxisInfo[]{axis0,axis1};

			
			CoordinatePoint minPt = new CoordinatePoint();
			minPt.Ord= new Double[2];
			minPt.Ord.SetValue(-180,0);
			minPt.Ord.SetValue(-90,1);

			CoordinatePoint maxPt = new CoordinatePoint();
			maxPt.Ord= new Double[2];
			maxPt.Ord.SetValue(-180,0);
			maxPt.Ord.SetValue(-90,1);

			// define the envelope.
			_defaultEnvelope = new Positioning.Envelope();
			_defaultEnvelope.MinCP = minPt;
			_defaultEnvelope.MaxCP = maxPt;
		

	
		}
		public void TestCreateFromTransformationCode1()
		{
			ICoordinateTransformation UKNationalGrid1 = _CTfactory.CreateFromTransformationCode("1036");

			double long1 = -2;
			double lat1 = 49;
			CoordinatePoint pt = new CoordinatePoint();
			pt.Ord = new Double[2];
			pt.Ord[0] = long1;
			pt.Ord[1] = lat1;

			CoordinatePoint result1 = UKNationalGrid1.MathTransform.Transform( pt);

			double metersX = (double)result1.Ord[0];
			double metersY = (double)result1.Ord[1];

			Assertion.AssertEquals("Transverse Mercator Transform X","400000",metersX.ToString());
			Assertion.AssertEquals("Transverse Mercator Transform Y","-100000",metersY.ToString());

			CoordinatePoint result2 = UKNationalGrid1.MathTransform.GetInverse().Transform( result1);
				
			double long2= (double)result2.Ord[0];
			double lat2= (double)result2.Ord[1];

			Assertion.AssertEquals("Transverse Mercator InverseTransformPoint X","-2",long2.ToString());
			Assertion.AssertEquals("TransverseMercator InverseTransformPoint Y","49",lat2.ToString());	
		}
Пример #3
0
        private CoordinatePoint CreateCoordinatePoint( Coordinate coord )
        {
            CoordinatePoint pt = new CoordinatePoint();
            pt.Ord = new Double[2];
            pt.Ord[0] = coord.x;
            pt.Ord[1] = coord.y;

            return pt;
        }
        public void Test_Constructor()
        {
            ParameterList parameters = new ParameterList();
            parameters.Add("latitude_of_natural_origin",49.0);
            parameters.Add("longitude_of_natural_origin",-2.0);
            parameters.Add("scale_factor_at_natural_origin",0.999601272);
            parameters.Add("false_easting",400000.0);
            parameters.Add("false_northing",-100000.0);
            parameters.Add("semi_major",6377563.396);
            parameters.Add("semi_minor",6377563.396);

            TransverseMercatorProjection meractor = new TransverseMercatorProjection(parameters);

            double long1 = -2.0;
            double lat1 = 49.0;
            CoordinatePoint pt = new CoordinatePoint();
            pt.Ord = new Double[2];
            pt.Ord.SetValue(long1,0);
            pt.Ord.SetValue(lat1,1);

            CoordinatePoint result1 = meractor.Transform(pt);

            double metersX = (double)result1.Ord[0];
            double metersY = (double)result1.Ord[1];

            Assertion.AssertEquals("Transverse Mercator Transform X","400000",metersX.ToString());
            Assertion.AssertEquals("Transverse Mercator Transform Y","-100000",metersY.ToString());

            CoordinatePoint result2 = meractor.GetInverse().Transform(result1);

            double long2= (double)result2.Ord[0];
            double lat2= (double)result2.Ord[1];

            Assertion.AssertEquals("Transverse Mercator InverseTransformPoint X","-2",long2.ToString());
            Assertion.AssertEquals("TransverseMercator InverseTransformPoint Y","49",lat2.ToString());
        }
		public void TestCreateFromTransformationCode2()
		{
			ICoordinateTransformation UKNationalGrid1 = _CTfactory.CreateFromTransformationCode("1681");
			double long1 = 2.5;
			double lat1 = 53.2;
			CoordinatePoint pt = new CoordinatePoint();
			pt.Ord = new Double[2];
			pt.Ord[0] = long1;
			pt.Ord[1] = lat1;

			CoordinatePoint result1 = UKNationalGrid1.MathTransform.Transform(pt);

			double metersX = (double)result1.Ord[0];
			double metersY = (double)result1.Ord[1];
		}
Пример #6
0
 public override double[] TransformList(double[] ord)
 {
     if (ord.Length % 2!=0)
     {
         throw new ArgumentException("Array must have an even number of parameters.");
     }
     double[] result = new double[ord.Length];
     double x;
     double y;
     for(int i=0; i<ord.Length; i=i+2)
     {
         x=result[i];
         y=result[i+1];
         CoordinatePoint point = new CoordinatePoint();
         point.Ord = new double[2];
         point.Ord.SetValue(x,0);
         point.Ord.SetValue(y,1);
         CoordinatePoint projectedPoint;
         if (_isInverse==false)
         {
             projectedPoint = Transform( point);
         }
         else
         {
             projectedPoint = GetInverse().Transform(point);
         }
         result[i] = (double)projectedPoint.Ord.GetValue(0);
         result[i+1] = (double)projectedPoint.Ord.GetValue(1);
     }
     return result;
 }
Пример #7
0
        public override CoordinatePoint Transform(CoordinatePoint cp)
        {
            CoordinatePoint projectedPoint = new CoordinatePoint();
            projectedPoint.Ord = new double[2];
            if (_isInverse==false)
            {
                double x=0.0;
                double y=0.0;
                double longitude = (double)cp.Ord.GetValue(0);
                double latitude = (double)cp.Ord.GetValue(1);

                this.DegreesToMeters(longitude, latitude, out x, out y);

                projectedPoint.Ord.SetValue(x,0);
                projectedPoint.Ord.SetValue(y,1);
            }
            else
            {
                double x=(double)cp.Ord.GetValue(0);
                double y=(double)cp.Ord.GetValue(1);
                double longitude = 0.0 ;
                double latitude =0.0;

                this.MetersToDegrees(x, y, out longitude, out latitude);

                projectedPoint.Ord.SetValue(longitude,0);
                projectedPoint.Ord.SetValue(latitude,1);
            }
            return projectedPoint;
        }
Пример #8
0
 private static CoordinatePoint CreateCoordinatePoint( PointF point )
 {
     CoordinatePoint pt = new CoordinatePoint();
     pt.Ord = new Double[2];
     pt.Ord[0] = point.X;
     pt.Ord[1] = point.Y;
     return pt;
 }
Пример #9
0
 /// <summary>
 ///  Not implemented.
 /// </summary>
 /// <param name="Cp"></param>
 /// <returns></returns>
 public Matrix Derivative(CoordinatePoint Cp)
 {
     throw new NotImplementedException();
 }
Пример #10
0
 /// <summary>
 /// Not implemented.
 /// </summary>
 /// <param name="Cp"></param>
 /// <returns></returns>
 public virtual CoordinatePoint Transform(CoordinatePoint Cp)
 {
     throw new NotImplementedException();
 }