/// <summary> /// Gets a managed coordinate transformation for the specified coordinate reference systems. /// </summary> /// <param name="source">The source coordinate reference system.</param> /// <param name="target">The source coordinate reference system.</param> /// <returns>The managed coordinate transformation, provided through <see cref="ICoordinateTransformation"/>.</returns> /// <exception cref="TransformationNotFoundException">Thrown if no transformation is available to transform coordinates /// from the specified source to the specified target coordinate reference system.</exception> public new static ICoordinateTransformation Get(CoordinateReferenceSystem source, CoordinateReferenceSystem target) { if (source == null || target == null) { throw new TransformationNotFoundException(source.getId(), target.getId()); } return(Get(source.getId(), target.getId())); }
/// <summary> /// Initializes a new instance of the <see cref="CoordinateTransformation"/> class. /// </summary> /// <param name="source">Source coordinate reference system.</param> /// <param name="target">Target coordinate reference system.</param> private CoordinateTransformation(CoordinateReferenceSystem source, CoordinateReferenceSystem target) { this.source = source; this.target = target; if (source == null || !source.Valid || target == null || !target.Valid) { throw new TransformationNotFoundException(source.getId(), target.getId()); } }
/// <summary> /// Tries to get a managed coordinate transformation for the specified coordinate reference systems. /// </summary> /// <param name="source">The source coordinate reference system.</param> /// <param name="target">The source coordinate reference system.</param> /// <param name="transform">The managed coordinate transformation, returned on success.</param> /// <returns>True, if a valid managed coordinate transformation could be found a/o created. False otherwise.</returns> internal static bool TryGet(CoordinateReferenceSystem source, CoordinateReferenceSystem target, out ICoordinateTransformation transform) { transform = null; if (source == null || target == null) { return(false); } return(TryGet(source.getId(), target.getId(), out transform)); }