@@ -26,8 +26,8 @@ namespace ProjNet.CoordinateSystems
2626 /// Builds up complex objects from simpler objects or values.
2727 /// </summary>
2828 /// <remarks>
29- /// <para>ICoordinateSystemFactory allows applications to make coordinate systems that
30- /// cannot be created by a <see cref="ICoordinateSystemAuthorityFactory "/>. This factory is very
29+ /// <para>CoordinateSystemFactory allows applications to make coordinate systems that
30+ /// cannot be created by a <see cref="CoordinateSystemAuthorityFactory "/>. This factory is very
3131 /// flexible, whereas the authority factory is easier to use.</para>
3232 /// <para>So <see cref="ICoordinateSystemAuthorityFactory"/>can be used to make 'standard' coordinate
3333 /// systems, and <see cref="CoordinateSystemFactory"/> can be used to make 'special'
@@ -67,19 +67,22 @@ public CoordinateSystem CreateFromWkt(string WKT)
6767 return info as CoordinateSystem ;
6868 }
6969
70- /*
70+
7171 /// <summary>
7272 /// Creates a <see cref="CompoundCoordinateSystem"/> [NOT IMPLEMENTED].
7373 /// </summary>
7474 /// <param name="name">Name of compound coordinate system.</param>
7575 /// <param name="head">Head coordinate system</param>
7676 /// <param name="tail">Tail coordinate system</param>
7777 /// <returns>Compound coordinate system</returns>
78- public ICompoundCoordinateSystem CreateCompoundCoordinateSystem(string name, ICoordinateSystem head, ICoordinateSystem tail)
78+ public CompoundCoordinateSystem CreateCompoundCoordinateSystem ( string name , CoordinateSystem head , CoordinateSystem tail )
7979 {
80- throw new NotImplementedException();
80+ if ( string . IsNullOrWhiteSpace ( name ) )
81+ throw new ArgumentException ( "Invalid name" ) ;
82+
83+ return new CompoundCoordinateSystem ( head , tail , name , string . Empty , - 1 , string . Empty , string . Empty , string . Empty ) ;
8184 }
82- */
85+
8386 /// <summary>
8487 /// Creates a <see cref="FittedCoordinateSystem"/>.
8588 /// </summary>
@@ -91,12 +94,30 @@ public ICompoundCoordinateSystem CreateCompoundCoordinateSystem(string name, ICo
9194 /// should not rotate this coordinate system in any other plane.</remarks>
9295 /// <param name="name">Name of coordinate system</param>
9396 /// <param name="baseCoordinateSystem">Base coordinate system</param>
94- /// <param name="toBaseWkt"></param>
95- /// <param name="arAxes"></param>
97+ /// <param name="toBaseWkt">WKT of the math transform to the base coordinate system </param>
98+ /// <param name="arAxes">Axiis of the fitted coordinate system </param>
9699 /// <returns>Fitted coordinate system</returns>
97100 public FittedCoordinateSystem CreateFittedCoordinateSystem ( string name , CoordinateSystem baseCoordinateSystem , string toBaseWkt , List < AxisInfo > arAxes )
98101 {
99- throw new NotImplementedException ( ) ;
102+ if ( string . IsNullOrWhiteSpace ( name ) )
103+ throw new ArgumentException ( "Invalid name" ) ;
104+
105+ var toBaseTransform = MathTransformWktReader . Parse ( toBaseWkt ) ;
106+ return new FittedCoordinateSystem ( baseCoordinateSystem , toBaseTransform , name , string . Empty , - 1 , string . Empty , string . Empty , string . Empty ) ;
107+ }
108+
109+ /// <inheritdoc cref="CreateFittedCoordinateSystem(string, CoordinateSystem, string, List{AxisInfo})"/>
110+ /// <param name="name">Name of coordinate system</param>
111+ /// <param name="baseCoordinateSystem">Base coordinate system</param>
112+ /// <param name="toBase">the math transform to the base coordinate system</param>
113+ /// <param name="arAxes">Axiis of the fitted coordinate system</param>
114+ /// <returns></returns>
115+ public FittedCoordinateSystem CreateFittedCoordinateSystem ( string name , CoordinateSystem baseCoordinateSystem , Transformations . MathTransform toBase , List < AxisInfo > arAxes )
116+ {
117+ if ( string . IsNullOrWhiteSpace ( name ) )
118+ throw new ArgumentException ( "Invalid name" ) ;
119+
120+ return new FittedCoordinateSystem ( baseCoordinateSystem , toBase , name , string . Empty , - 1 , string . Empty , string . Empty , string . Empty ) ;
100121 }
101122
102123 /*
@@ -270,33 +291,39 @@ public ILocalDatum CreateLocalDatum(string name, DatumType datumType)
270291 }
271292 */
272293
273- /*
294+
274295 /// <summary>
275- /// Creates a <see cref="IVerticalDatum "/> from an enumerated type value.
296+ /// Creates a <see cref="VerticalDatum "/> from an enumerated type value.
276297 /// </summary>
277298 /// <param name="name">Name of datum</param>
278299 /// <param name="datumType">Type of datum</param>
279300 /// <returns>Vertical datum</returns>
280- public IVerticalDatum CreateVerticalDatum(string name, DatumType datumType)
301+ public VerticalDatum CreateVerticalDatum ( string name , DatumType datumType )
281302 {
282- throw new NotImplementedException();
303+ if ( string . IsNullOrWhiteSpace ( name ) )
304+ throw new ArgumentException ( "Invalid name" ) ;
305+
306+ return new VerticalDatum ( datumType , name , string . Empty , - 1 , string . Empty , string . Empty , string . Empty ) ;
283307 }
284- */
285308
286- /*
309+
310+
287311 /// <summary>
288- /// Creates a <see cref="IVerticalCoordinateSystem "/> from a <see cref="IVerticalDatum ">datum</see> and <see cref="LinearUnit">linear units</see>.
312+ /// Creates a <see cref="VerticalCoordinateSystem "/> from a <see cref="VerticalDatum ">datum</see> and <see cref="LinearUnit">linear units</see>.
289313 /// </summary>
290314 /// <param name="name">Name of vertical coordinate system</param>
291315 /// <param name="datum">Vertical datum</param>
292316 /// <param name="verticalUnit">Unit</param>
293317 /// <param name="axis">Axis info</param>
294318 /// <returns>Vertical coordinate system</returns>
295- public IVerticalCoordinateSystem CreateVerticalCoordinateSystem(string name, IVerticalDatum datum, ILinearUnit verticalUnit, AxisInfo axis)
319+ public VerticalCoordinateSystem CreateVerticalCoordinateSystem ( string name , VerticalDatum datum , LinearUnit verticalUnit , AxisInfo axis )
296320 {
297- throw new NotImplementedException();
321+ if ( string . IsNullOrWhiteSpace ( name ) )
322+ throw new ArgumentException ( "Invalid name" ) ;
323+
324+ return new VerticalCoordinateSystem ( verticalUnit , datum , axis , name , string . Empty , - 1 , string . Empty , string . Empty , string . Empty ) ;
298325 }
299- */
326+
300327 /// <summary>
301328 /// Creates a <see cref="CreateGeocentricCoordinateSystem"/> from a <see cref="HorizontalDatum">datum</see>,
302329 /// <see cref="LinearUnit">linear unit</see> and <see cref="PrimeMeridian"/>.
0 commit comments