private static ICoordinateTransformation Geog2Proj(IGeographicCoordinateSystem source, IProjectedCoordinateSystem target) { if (source.EqualParams(target.GeographicCoordinateSystem)) { return(new CoordinateTransformation(source, target, TransformType.Transformation, CreateCoordinateOperation(target.Projection, target.GeographicCoordinateSystem.HorizontalDatum.Ellipsoid), string.Empty, string.Empty, -1L, string.Empty, string.Empty)); } ConcatenatedTransform mathTransform = new ConcatenatedTransform(); CoordinateTransformationFactory factory = new CoordinateTransformationFactory(); mathTransform.CoordinateTransformationList.Add(factory.CreateFromCoordinateSystems(source, target.GeographicCoordinateSystem)); mathTransform.CoordinateTransformationList.Add(factory.CreateFromCoordinateSystems(target.GeographicCoordinateSystem, target)); return(new CoordinateTransformation(source, target, TransformType.Transformation, mathTransform, string.Empty, string.Empty, -1L, string.Empty, string.Empty)); }
private static ICoordinateTransformation Geog2Proj(IGeographicCoordinateSystem source, IProjectedCoordinateSystem target) { if (source.EqualParams(target.GeographicCoordinateSystem)) { IMathTransform mathTransform = CreateCoordinateOperation(target.Projection, target.GeographicCoordinateSystem.HorizontalDatum.Ellipsoid, target.LinearUnit); return(new CoordinateTransformation(source, target, TransformType.Transformation, mathTransform, String.Empty, String.Empty, -1, String.Empty, String.Empty)); } else { // Geographic coordinatesystems differ - Create concatenated transform ConcatenatedTransform ct = new ConcatenatedTransform(); CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory(); ct.CoordinateTransformationList.Add(ctFac.CreateFromCoordinateSystems(source, target.GeographicCoordinateSystem)); ct.CoordinateTransformationList.Add(ctFac.CreateFromCoordinateSystems(target.GeographicCoordinateSystem, target)); return(new CoordinateTransformation(source, target, TransformType.Transformation, ct, String.Empty, String.Empty, -1, String.Empty, String.Empty)); } }
private static ICoordinateTransformation Geog2Proj(IGeographicCoordinateSystem source, IProjectedCoordinateSystem target) { if (source.EqualParams(target.GeographicCoordinateSystem)) { return new CoordinateTransformation(source, target, TransformType.Transformation, CreateCoordinateOperation(target.Projection, target.GeographicCoordinateSystem.HorizontalDatum.Ellipsoid), string.Empty, string.Empty, -1L, string.Empty, string.Empty); } ConcatenatedTransform mathTransform = new ConcatenatedTransform(); CoordinateTransformationFactory factory = new CoordinateTransformationFactory(); mathTransform.CoordinateTransformationList.Add(factory.CreateFromCoordinateSystems(source, target.GeographicCoordinateSystem)); mathTransform.CoordinateTransformationList.Add(factory.CreateFromCoordinateSystems(target.GeographicCoordinateSystem, target)); return new CoordinateTransformation(source, target, TransformType.Transformation, mathTransform, string.Empty, string.Empty, -1L, string.Empty, string.Empty); }
private static ICoordinateTransformation Geog2Proj(IGeographicCoordinateSystem source, IProjectedCoordinateSystem target) { if (source.EqualParams(target.GeographicCoordinateSystem)) { IMathTransform mathTransform = CreateCoordinateOperation(target.Projection, target.GeographicCoordinateSystem.HorizontalDatum.Ellipsoid, target.LinearUnit); return new CoordinateTransformation(source, target, TransformType.Transformation, mathTransform, String.Empty, String.Empty, -1, String.Empty, String.Empty); } else { // Geographic coordinatesystems differ - Create concatenated transform ConcatenatedTransform ct = new ConcatenatedTransform(); CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory(); ct.CoordinateTransformationList.Add(ctFac.CreateFromCoordinateSystems(source,target.GeographicCoordinateSystem)); ct.CoordinateTransformationList.Add(ctFac.CreateFromCoordinateSystems(target.GeographicCoordinateSystem, target)); return new CoordinateTransformation(source, target, TransformType.Transformation, ct, String.Empty, String.Empty, -1, String.Empty, String.Empty); } }