Exemple #1
0
 public void Transform(esriTransformDirection direction, ITransformation transformation)
 {
     if (null != this.m_triangle)
     {
         ((ITransform2D)this.m_triangle).Transform(direction, transformation);
         IAffineTransformation2D affineTransformation2D = (IAffineTransformation2D)transformation;
         if (affineTransformation2D.YScale != 1)
         {
             TriangleElementClass mSize = this;
             mSize.m_size = mSize.m_size * Math.Max(affineTransformation2D.YScale, affineTransformation2D.XScale);
         }
         this.RefreshTracker();
     }
 }
Exemple #2
0
        /// <summary>
        /// </summary>
        /// <param name="direction"></param>
        /// <param name="transformation"></param>
        public void Transform(esriTransformDirection direction, ITransformation transformation)
        {
            object           value        = Missing.Value;
            IPointCollection polygonClass = new Polygon();

            polygonClass.AddPoint(this.m_pGeometry.LowerLeft, ref value, ref value);
            polygonClass.AddPoint(this.m_pGeometry.LowerRight, ref value, ref value);
            polygonClass.AddPoint(this.m_pGeometry.UpperRight, ref value, ref value);
            polygonClass.AddPoint(this.m_pGeometry.UpperLeft, ref value, ref value);
            (polygonClass as IPolygon).Close();
            (polygonClass as IGeometry).SpatialReference = this.m_pGeometry.SpatialReference;
            (polygonClass as ITransform2D).Transform(direction, transformation);
            this.m_pGeometry = (polygonClass as IPolygon).Envelope;
            this.RefreshTracker();
        }
        private IGeoTransformation GetGeoTransformationToLv95(
            out esriTransformDirection direction)
        {
            IList <KeyValuePair <IGeoTransformation, esriTransformDirection> > transformations =
                SpatialReferenceUtils.GetPredefinedGeoTransformations(
                    _wgs84, _lv95);

            Assert.AreEqual(1, transformations.Count);

            IGeoTransformation transformation = transformations[0].Key;

            direction = transformations[0].Value;

            Console.WriteLine(@"{0} ({1})", transformation.Name, direction);

            return(transformation);
        }
Exemple #4
0
        public void Transform(esriTransformDirection direction, ITransformation transformation)
        {
            object           before = Missing.Value;
            IPointCollection points = new ESRI.ArcGIS.Geometry.Polygon();

            points.AddPoint(this.m_pGeometry.LowerLeft, ref before, ref before);
            points.AddPoint(this.m_pGeometry.LowerRight, ref before, ref before);
            points.AddPoint(this.m_pGeometry.UpperRight, ref before, ref before);
            points.AddPoint(this.m_pGeometry.UpperLeft, ref before, ref before);
            (points as IPolygon).Close();
            (points as IGeometry).SpatialReference = this.m_pGeometry.SpatialReference;
            (points as ITransform2D).Transform(direction, transformation);
            IEnvelope envelope = (points as IPolygon).Envelope;

            this.m_pGeometry = envelope;
            this.RefreshTracker();
        }
Exemple #5
0
        public IPoint ProjectWgsToUrkaine2000WithGeoTransformation(
            IPoint inputPoint,
            CoordinateSystemModel coordinateSystemModel,
            esriTransformDirection transformationDirection)
        {
            if (inputPoint == null)
            {
                return(null);
            }

            var bufferPoint = new PointClass {
                X = inputPoint.X, Y = inputPoint.Y, SpatialReference = inputPoint.SpatialReference
            };

            //Create Spatial Reference Factory
            var spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            var targetSpatialReference  = spatialReferenceFactory.CreateGeographicCoordinateSystem(coordinateSystemModel.ESRIWellKnownID);

            var compositeGeoTransformation  = new CompositeGeoTransformationClass();
            var predefinedGeoTransformation =
                spatialReferenceFactory.CreateGeoTransformation(Constants.ItrfToWgsGeoTransformationID) as IGeoTransformation;

            compositeGeoTransformation.Add(esriTransformDirection.esriTransformReverse, predefinedGeoTransformation);

            var coordinateFrameGeoTransformation = new CoordinateFrameTransformationClass();
            var itrfSpatialReference             =
                spatialReferenceFactory.CreateSpatialReference((int)esriSRGeoCS3Type.esriSRGeoCS_IERSTerrestrialReferenceFrame2000);

            coordinateFrameGeoTransformation.PutSpatialReferences(itrfSpatialReference, targetSpatialReference);
            coordinateFrameGeoTransformation.PutParameters(
                Constants.UkraineToItrf.XAxisTranslation,
                Constants.UkraineToItrf.YAxisTranslation,
                Constants.UkraineToItrf.ZAxisTranslation,
                Constants.UkraineToItrf.XAxisRotation,
                Constants.UkraineToItrf.YAxisRotation,
                Constants.UkraineToItrf.ZAxisRotation,
                Constants.UkraineToItrf.ScaleDifference);
            compositeGeoTransformation.Add(esriTransformDirection.esriTransformForward, coordinateFrameGeoTransformation);

            var geometry = bufferPoint as IGeometry5;

            geometry.ProjectEx(targetSpatialReference, transformationDirection, compositeGeoTransformation, false, 0.0, 0.0);

            return(geometry as IPoint);
        }
Exemple #6
0
        public void Transform(esriTransformDirection direction, ITransformation transformation)
        {
            if (null == m_triangle)
            {
                return;
            }

            //Geometry
            ((ITransform2D)m_triangle).Transform(direction, transformation);

            IAffineTransformation2D affineTrans = (IAffineTransformation2D)transformation;

            if (affineTrans.YScale != 1.0)
            {
                m_size *= Math.Max(affineTrans.YScale, affineTrans.XScale);
            }

            RefreshTracker();
        }
Exemple #7
0
        public IPoint ProjectWgsToPulkovoWithGeoTransformation(
            IPoint inputPoint,
            CoordinateSystemModel coordinateSystemModel,
            esriTransformDirection transformationDirection)
        {
            if (inputPoint == null)
            {
                return(null);
            }

            var bufferPoint = new PointClass {
                X = inputPoint.X, Y = inputPoint.Y, SpatialReference = inputPoint.SpatialReference
            };

            //Create Spatial Reference Factory
            var spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            var targetSpatialReference  = spatialReferenceFactory.CreateGeographicCoordinateSystem(coordinateSystemModel.ESRIWellKnownID);

            var coordinateFrameGeoTransformation = new CoordinateFrameTransformationClass();

            coordinateFrameGeoTransformation.PutSpatialReferences(bufferPoint.SpatialReference, targetSpatialReference);
            coordinateFrameGeoTransformation.PutParameters(
                Constants.PulkovoToWGS.XAxisTranslation,
                Constants.PulkovoToWGS.YAxisTranslation,
                Constants.PulkovoToWGS.ZAxisTranslation,
                Constants.PulkovoToWGS.XAxisRotation,
                Constants.PulkovoToWGS.YAxisRotation,
                Constants.PulkovoToWGS.ZAxisRotation,
                Constants.PulkovoToWGS.ScaleDifference);

            var geometry = bufferPoint as IGeometry5;

            geometry.ProjectEx(targetSpatialReference, transformationDirection, coordinateFrameGeoTransformation, false, 0.0, 0.0);

            return(geometry as IPoint);
        }
 /// <summary>
 /// </summary>
 /// <param name="direction"></param>
 /// <param name="transformation"></param>
 public void Transform(esriTransformDirection direction, ITransformation transformation)
 {
     (this.m_pGeometry as ITransform2D).Transform(direction, transformation);
     this.RefreshTracker();
 }
Exemple #9
0
 public void Transform(esriTransformDirection direction, ITransformation transformation)
 {
     (this.m_pGroupElement as ITransform2D).Transform(direction, transformation);
 }
    public void Transform(esriTransformDirection direction, ITransformation transformation)
    {
      if (null == m_triangle)
        return;

      //Geometry
      ((ITransform2D)m_triangle).Transform(direction, transformation);

      IAffineTransformation2D affineTrans = (IAffineTransformation2D)transformation;
      if (affineTrans.YScale != 1.0)
        m_size *= Math.Max(affineTrans.YScale, affineTrans.XScale);

      RefreshTracker();
    }
 public void Transform(esriTransformDirection direction, ITransformation transformation)
 {
     throw new NotImplementedException();
 }
        /// <summary>
        /// Returns a projected copy of the geometry without altering the state of the original object.
        /// </summary>
        /// <typeparam name="T">The type of geometry.</typeparam>
        /// <param name="shape">The current geometry.</param>
        /// <param name="spatialReference">The target spatial reference.</param>
        /// <param name="transformation">The datum transformation.</param>
        /// <param name="direction">The direction of transformation.</param>
        /// <returns>A projected copy of the geometry.</returns>
        public static T Project2 <T>(this T shape, ISpatialReference spatialReference, IGeoTransformation transformation, esriTransformDirection direction) where T : class, IGeometry
        {
            var copy = shape.Copy();

            if (transformation == null)
            {
                copy.Project(spatialReference);
            }
            else
            {
                ((IGeometry2)copy).ProjectEx(spatialReference, direction, transformation, false, 0, 0);
            }

            return(copy);
        }