001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    Copyright © 2004-2024 Open Geospatial Consortium, Inc.
004 *    http://www.geoapi.org
005 *
006 *    Licensed under the Apache License, Version 2.0 (the "License");
007 *    you may not use this file except in compliance with the License.
008 *    You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *    Unless required by applicable law or agreed to in writing, software
013 *    distributed under the License is distributed on an "AS IS" BASIS,
014 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 *    See the License for the specific language governing permissions and
016 *    limitations under the License.
017 */
018package org.opengis.referencing.crs;
019
020import java.util.Map;
021import org.opengis.referencing.cs.*;
022import org.opengis.referencing.datum.*;
023import org.opengis.referencing.operation.*;
024import org.opengis.referencing.ObjectFactory;
025import org.opengis.parameter.ParameterValueGroup;  // For javadoc
026import org.opengis.util.UnimplementedServiceException;
027import org.opengis.util.FactoryException;
028import org.opengis.annotation.UML;
029
030import static org.opengis.annotation.Specification.*;
031import static org.opengis.geoapi.internal.Errors.cannotParse;
032
033
034/**
035 * Builds up complex Coordinate Reference Systems from simpler objects or values.
036 * {@code CRSFactory} allows applications to make
037 * {@linkplain CoordinateReferenceSystem Coordinate Reference Systems} (<abbr>CRS</abbr>)
038 * that cannot be created by a {@link CRSAuthorityFactory}.
039 * This factory is very flexible, whereas the authority factory is easier to use.
040 * So {@link CRSAuthorityFactory} can be used to make "standard" coordinate reference systems,
041 * and {@code CRSFactory} can be used to make "special" coordinate reference systems.
042 *
043 * <p>For example, the EPSG authority has codes for USA state plane coordinate systems
044 * using the NAD83 datum, but these coordinate systems always use meters.
045 * EPSG does not have codes for NAD83 state plane coordinate systems that use feet units.
046 * This factory lets an application create such a hybrid coordinate system.</p>
047 *
048 * <h2>Default methods</h2>
049 * All {@code create(…)} methods in this interface are optional.
050 * Unless otherwise specified in the documentation, methods that are not overridden
051 * by the implementer will throw an {@link UnimplementedServiceException} by default.
052 *
053 * @author  OGC 01-009 (for abstract model and documentation)
054 * @author  Martin Desruisseaux (IRD, Geomatys)
055 * @author  Johann Sorel (Geomatys)
056 * @version 3.1
057 * @since   1.0
058 *
059 * @see org.opengis.referencing.cs.CSFactory
060 * @see org.opengis.referencing.datum.DatumFactory
061 */
062@UML(identifier="CS_CoordinateSystemFactory", specification=OGC_01009)
063public interface CRSFactory extends ObjectFactory {
064    /**
065     * Creates a geographic <abbr>CRS</abbr> from a reference frame.
066     * This is a shortcut for the {@linkplain #createGeographicCRS(Map, GeodeticDatum, DatumEnsemble, EllipsoidalCS)
067     * more generic method} without datum ensemble.
068     *
069     * @param  properties  name and other properties to give to the new object.
070     *         Available properties are {@linkplain ObjectFactory listed there}.
071     * @param  datum  geodetic reference frame to use in created CRS.
072     * @param  cs  the ellipsoidal coordinate system for the created CRS.
073     * @return the coordinate reference system for the given properties.
074     * @throws FactoryException if the object creation failed.
075     */
076    @UML(identifier="createGeographicCoordinateSystem", specification=OGC_01009)
077    default GeographicCRS createGeographicCRS(Map<String,?> properties,
078                                              GeodeticDatum datum,
079                                              EllipsoidalCS cs) throws FactoryException
080    {
081        return createGeographicCRS(properties, datum, null, cs);
082    }
083
084    /**
085     * Creates a geographic <abbr>CRS</abbr> from a reference frame or datum ensemble.
086     * It could be (<var>latitude</var>, <var>longitude</var>) or (<var>longitude</var>, <var>latitude</var>).
087     * The <abbr>CRS</abbr> can optionally be three-dimensional with an ellipsoidal height.
088     *
089     * <p>At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
090     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.</p>
091     *
092     * @param  properties  name and other properties to give to the new object.
093     *         Available properties are {@linkplain ObjectFactory listed there}.
094     * @param  datum  geodetic reference frame, or {@code null} if the CRS is associated only to a datum ensemble.
095     * @param  datumEnsemble  collection of reference frames which for low accuracy requirements may be considered
096     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
097     * @param  cs  the ellipsoidal coordinate system for the created CRS.
098     * @return the coordinate reference system for the given properties.
099     * @throws FactoryException if the object creation failed.
100     *
101     * @since 3.1
102     */
103    default GeographicCRS createGeographicCRS(Map<String,?> properties,
104            GeodeticDatum datum, DatumEnsemble<GeodeticDatum> datumEnsemble,
105            EllipsoidalCS cs) throws FactoryException
106    {
107        throw new UnimplementedServiceException(this, GeographicCRS.class);
108    }
109
110    /**
111     * Creates a geocentric <abbr>CRS</abbr> from a spherical coordinate system.
112     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
113     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
114     *
115     * @param  properties  name and other properties to give to the new object.
116     *         Available properties are {@linkplain ObjectFactory listed there}.
117     * @param  datum  geodetic reference frame.
118     * @param  cs  the spherical coordinate system for the created CRS.
119     * @return the coordinate reference system for the given properties.
120     * @throws FactoryException if the object creation failed.
121     *
122     * @deprecated The {@code GeocentricCRS} type has been removed since ISO 19111:2007.
123     * Use {@link #createGeodeticCRS(Map, GeodeticDatum, DatumEnsembe, SphericalCS)} instead.
124     */
125    @Deprecated(since = "3.1")
126    default GeocentricCRS createGeocentricCRS(Map<String,?> properties,
127                                              GeodeticDatum datum,
128                                              SphericalCS   cs) throws FactoryException
129    {
130        throw new UnimplementedServiceException(this, GeocentricCRS.class, "spherical");
131    }
132
133    /**
134     * Creates a geocentric <abbr>CRS</abbr> from a spherical coordinate system.
135     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
136     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
137     *
138     * @param  properties  name and other properties to give to the new object.
139     *         Available properties are {@linkplain ObjectFactory listed there}.
140     * @param  datum  geodetic reference frame, or {@code null} if the CRS is associated only to a datum ensemble.
141     * @param  datumEnsemble  collection of reference frames which for low accuracy requirements may be considered
142     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
143     * @param  cs  the spherical coordinate system for the created CRS.
144     * @return the coordinate reference system for the given properties.
145     * @throws FactoryException if the object creation failed.
146     *
147     * @since 3.1
148     */
149    default GeodeticCRS createGeodeticCRS(Map<String,?> properties,
150            GeodeticDatum datum, DatumEnsemble<GeodeticDatum> datumEnsemble,
151            SphericalCS cs) throws FactoryException
152    {
153        throw new UnimplementedServiceException(this, GeodeticCRS.class, "spherical");
154    }
155
156    /**
157     * Creates a geocentric <abbr>CRS</abbr> from a Cartesian coordinate system.
158     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
159     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
160     *
161     * @param  properties  name and other properties to give to the new object.
162     *         Available properties are {@linkplain ObjectFactory listed there}.
163     * @param  datum  geodetic reference frame.
164     * @param  cs  the Cartesian coordinate system for the created CRS.
165     * @return the coordinate reference system for the given properties.
166     * @throws FactoryException if the object creation failed.
167     *
168     * @deprecated The {@code GeocentricCRS} type has been removed since ISO 19111:2007.
169     * Use {@link #createGeodeticCRS(Map, GeodeticDatum, DatumEnsemble, CartesianCS)} instead.
170     */
171    @Deprecated(since = "3.1")
172    default GeocentricCRS createGeocentricCRS(Map<String,?> properties,
173                                              GeodeticDatum datum,
174                                              CartesianCS   cs) throws FactoryException
175    {
176        throw new UnimplementedServiceException(this, GeocentricCRS.class, "Cartesian");
177    }
178
179    /**
180     * Creates a geocentric <abbr>CRS</abbr> from a Cartesian coordinate system.
181     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
182     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
183     *
184     * @param  properties  name and other properties to give to the new object.
185     *         Available properties are {@linkplain ObjectFactory listed there}.
186     * @param  datum  geodetic reference frame, or {@code null} if the CRS is associated only to a datum ensemble.
187     * @param  datumEnsemble  collection of reference frames which for low accuracy requirements may be considered
188     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
189     * @param  cs  the Cartesian coordinate system for the created CRS.
190     * @return the coordinate reference system for the given properties.
191     * @throws FactoryException if the object creation failed.
192     *
193     * @since 3.1
194     */
195    default GeodeticCRS createGeodeticCRS(Map<String,?> properties,
196            GeodeticDatum datum, DatumEnsemble<GeodeticDatum> datumEnsemble,
197            CartesianCS cs) throws FactoryException
198    {
199        throw new UnimplementedServiceException(this, GeodeticCRS.class, "Cartesian");
200    }
201
202    /**
203     * Creates a vertical <abbr>CRS</abbr> from a reference frame.
204     * This is a shortcut for the {@linkplain #createVerticalCRS(Map, VerticalDatum, DatumEnsemble, VerticalCS)
205     * more generic method} without datum ensemble.
206     *
207     * @param  properties  name and other properties to give to the new object.
208     *         Available properties are {@linkplain ObjectFactory listed there}.
209     * @param  datum  vertical datum to use in created CRS.
210     * @param  cs  the vertical coordinate system for the created CRS.
211     * @return the coordinate reference system for the given properties.
212     * @throws FactoryException if the object creation failed.
213     */
214    @UML(identifier="createVerticalCoordinateSystem", specification=OGC_01009)
215    default VerticalCRS createVerticalCRS(Map<String,?> properties,
216                                          VerticalDatum datum,
217                                          VerticalCS    cs) throws FactoryException
218    {
219        return createVerticalCRS(properties, datum, null, cs);
220    }
221
222    /**
223     * Creates a vertical <abbr>CRS</abbr> from a reference frame or datum ensemble.
224     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
225     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
226     *
227     * @param  properties  name and other properties to give to the new object.
228     *         Available properties are {@linkplain ObjectFactory listed there}.
229     * @param  datum  vertical reference frame, or {@code null} if the CRS is associated only to a datum ensemble.
230     * @param  datumEnsemble  collection of reference frames which for low accuracy requirements may be considered
231     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
232     * @param  cs  the vertical coordinate system for the created CRS.
233     * @return the coordinate reference system for the given properties.
234     * @throws FactoryException if the object creation failed.
235     *
236     * @since 3.1
237     */
238    default VerticalCRS createVerticalCRS(Map<String,?> properties,
239            VerticalDatum datum, DatumEnsemble<VerticalDatum> datumEnsemble,
240            VerticalCS cs) throws FactoryException
241    {
242        throw new UnimplementedServiceException(this, VerticalCRS.class);
243    }
244
245    /**
246     * Creates a temporal <abbr>CRS</abbr> from a datum.
247     * This is a shortcut for the {@linkplain #createTemporalCRS(Map, TemporalDatum, DatumEnsemble, TimeCS)
248     * more generic method} without datum ensemble.
249     *
250     * @param  properties  name and other properties to give to the new object.
251     *         Available properties are {@linkplain ObjectFactory listed there}.
252     * @param  datum  temporal datum to use in created CRS.
253     * @param  cs  the temporal coordinate system for the created CRS.
254     * @return the coordinate reference system for the given properties.
255     * @throws FactoryException if the object creation failed.
256     */
257    default TemporalCRS createTemporalCRS(Map<String,?> properties,
258                                          TemporalDatum datum,
259                                          TimeCS        cs) throws FactoryException
260    {
261        return createTemporalCRS(properties, datum, null, cs);
262    }
263
264    /**
265     * Creates a temporal <abbr>CRS</abbr> from a datum or datum ensemble.
266     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
267     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
268     *
269     * @param  properties  name and other properties to give to the new object.
270     *         Available properties are {@linkplain ObjectFactory listed there}.
271     * @param  datum  temporal datum, or {@code null} if the CRS is associated only to a datum ensemble.
272     * @param  datumEnsemble  collection of datum which for low accuracy requirements may be considered
273     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
274     * @param  cs  the temporal coordinate system for the created CRS.
275     * @return the coordinate reference system for the given properties.
276     * @throws FactoryException if the object creation failed.
277     *
278     * @since 3.1
279     */
280    default TemporalCRS createTemporalCRS(Map<String,?> properties,
281            TemporalDatum datum, DatumEnsemble<TemporalDatum> datumEnsemble,
282            TimeCS cs) throws FactoryException
283    {
284        throw new UnimplementedServiceException(this, TemporalCRS.class);
285    }
286
287    /**
288     * Creates a parametric <abbr>CRS</abbr> from a datum or datum ensemble.
289     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
290     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
291     *
292     * @param  properties  name and other properties to give to the new object.
293     *         Available properties are {@linkplain ObjectFactory listed there}.
294     * @param  datum  parametric datum, or {@code null} if the CRS is associated only to a datum ensemble.
295     * @param  datumEnsemble  collection of datum which for low accuracy requirements may be considered
296     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
297     * @param  cs  the parametric coordinate system for the created CRS.
298     * @return the coordinate reference system for the given properties.
299     * @throws FactoryException if the object creation failed.
300     *
301     * @since 3.1
302     */
303    default ParametricCRS createParametricCRS(Map<String,?> properties,
304            ParametricDatum datum, DatumEnsemble<ParametricDatum> datumEnsemble,
305            ParametricCS cs) throws FactoryException
306    {
307        throw new UnimplementedServiceException(this, ParametricCRS.class);
308    }
309
310    /**
311     * Creates a engineering <abbr>CRS</abbr> from a datum.
312     * This is a shortcut for the {@linkplain #createEngineeringCRS(Map, EngineeringDatum, DatumEnsemble, CoordinateSystem)
313     * more generic method} without datum ensemble.
314     *
315     * @param  properties  name and other properties to give to the new object.
316     *         Available properties are {@linkplain ObjectFactory listed there}.
317     * @param  datum  engineering datum to use in created CRS.
318     * @param  cs     the coordinate system for the created CRS.
319     * @return the coordinate reference system for the given properties.
320     * @throws FactoryException if the object creation failed.
321     */
322    @UML(identifier="createLocalCoordinateSystem", specification=OGC_01009)
323    default EngineeringCRS createEngineeringCRS(Map<String,?>    properties,
324                                                EngineeringDatum datum,
325                                                CoordinateSystem cs) throws FactoryException
326    {
327        return createEngineeringCRS(properties, datum, null, cs);
328    }
329
330    /**
331     * Creates a engineering <abbr>CRS</abbr> from a datum or datum ensemble.
332     * At least one of the {@code datum} and {@code datumEnsemble} arguments shall be non-null.
333     * If both are non-null, then {@code datum} <em>shall</em> be a member of the datum ensemble.
334     *
335     * @param  properties  name and other properties to give to the new object.
336     *         Available properties are {@linkplain ObjectFactory listed there}.
337     * @param  datum  engineering datum, or {@code null} if the CRS is associated only to a datum ensemble.
338     * @param  datumEnsemble  collection of datum which for low accuracy requirements may be considered
339     *         to be insignificantly different from each other, or {@code null} if there is no such ensemble.
340     * @param  cs     the coordinate system for the created CRS.
341     * @return the coordinate reference system for the given properties.
342     * @throws FactoryException if the object creation failed.
343     *
344     * @since 3.1
345     */
346    @UML(identifier="createLocalCoordinateSystem", specification=OGC_01009)
347    default EngineeringCRS createEngineeringCRS(Map<String,?> properties,
348            EngineeringDatum datum, DatumEnsemble<EngineeringDatum> datumEnsemble,
349            CoordinateSystem cs) throws FactoryException
350    {
351        throw new UnimplementedServiceException(this, EngineeringCRS.class);
352    }
353
354    /**
355     * Creates an image coordinate reference system.
356     *
357     * @param  properties  name and other properties to give to the new object.
358     *         Available properties are {@linkplain ObjectFactory listed there}.
359     * @param  datum  image datum to use in created CRS.
360     * @param  cs     the Cartesian or Oblique Cartesian coordinate system for the created CRS.
361     * @return the coordinate reference system for the given properties.
362     * @throws FactoryException if the object creation failed.
363     *
364     * @deprecated {@code ImageCRS} is replaced by {@link EngineeringCRS} as of ISO 19111:2019.
365     */
366    @Deprecated(since="3.1")
367    default ImageCRS createImageCRS(Map<String,?> properties,
368                                    ImageDatum    datum,
369                                    AffineCS      cs) throws FactoryException
370    {
371        throw new UnimplementedServiceException(this, ImageCRS.class);
372    }
373
374    /**
375     * Creates a compound <abbr>CRS</abbr> from an ordered sequence of components.
376     *
377     * @param  properties  name and other properties to give to the new object.
378     *         Available properties are {@linkplain ObjectFactory listed there}.
379     * @param  components  the sequence of coordinate reference systems making the compound CRS.
380     * @return the coordinate reference system for the given properties.
381     * @throws FactoryException if the object creation failed.
382     */
383    @UML(identifier="createCompoundCoordinateSystem", specification=OGC_01009)
384    default CompoundCRS createCompoundCRS(Map<String,?> properties,
385                                          CoordinateReferenceSystem... components) throws FactoryException
386    {
387        throw new UnimplementedServiceException(this, CompoundCRS.class);
388    }
389
390    /**
391     * Creates a derived <abbr>CRS</abbr>.
392     * The {@code conversionFromBase} argument shall contain the {@linkplain Conversion#getParameterValues()
393     * parameter values} required for the conversion. It may or may not contain the corresponding
394     * “{@linkplain Conversion#getMathTransform() base to derived}” transform, at user's choice.
395     * If a math transform is provided, this method may or may not use it at implementation choice.
396     * Otherwise this method shall create a math transform from the parameters.
397     *
398     * <p>If the transform is an affine map performing a rotation, then any mixed axes must have identical units.
399     * For example, a (<var>latitude</var> (°), <var>longitude</var> (°), <var>height</var> (m))
400     * system can be rotated in the (<var>latitude</var>, <var>longitude</var>) plane, since both affected
401     * axes are in degrees. But the transform should not rotate this coordinate system in any other plane.</p>
402     *
403     * <p>It is the user's responsibility to ensure that the conversion performs all required steps,
404     * including unit conversions and change of axis order, if needed. Note that this behavior is
405     * different than {@link #createProjectedCRS createProjectedCRS(…)} because transforms other than
406     * <i>cartographic projections</i> are not standardized.</p>
407     *
408     * <div class="warning"><b>Upcoming API change — specialization</b><br>
409     * According ISO 19111, the {@code baseCRS} type should be {@link SingleCRS}.
410     * This change may be applied in GeoAPI 4.0.
411     * </div>
412     *
413     * @param  properties  name and other properties to give to the new object.
414     *         Available properties are {@linkplain ObjectFactory listed there}.
415     * @param  baseCRS  coordinate reference system to base the projection on.
416     *         The number of axes must matches the number of source dimensions of the conversion from base.
417     * @param  conversionFromBase  the {@linkplain CoordinateOperationFactory#createDefiningConversion defining conversion}.
418     * @param  derivedCS  the coordinate system for the derived CRS.
419     *         The number of axes must matches the number of target dimensions} of the conversion from base.
420     * @return the coordinate reference system for the given properties.
421     * @throws FactoryException if the object creation failed.
422     *
423     * @see CoordinateOperationFactory#createDefiningConversion(Map, OperationMethod, ParameterValueGroup)
424     * @see MathTransformFactory#createBaseToDerived(CoordinateReferenceSystem, ParameterValueGroup, CoordinateSystem)
425     */
426    @UML(identifier="createFittedCoordinateSystem", specification=OGC_01009)
427    default DerivedCRS createDerivedCRS(Map<String,?> properties,
428                                        CoordinateReferenceSystem baseCRS,
429                                        Conversion conversionFromBase,
430                                        CoordinateSystem derivedCS) throws FactoryException
431    {
432        throw new UnimplementedServiceException(this, DerivedCRS.class);
433    }
434
435    /**
436     * Creates a projected <abbr>CRS</abbr> from a defining conversion.
437     * The {@code conversionFromBase} argument shall contain the {@linkplain Conversion#getParameterValues()
438     * parameter values} required for the projection. It may or may not contain the corresponding
439     * “{@linkplain Conversion#getMathTransform() base to derived}” transform, at user's choice.
440     * If a math transform is provided, this method may or may not use it at implementation choice.
441     * Otherwise this method shall create a math transform from the parameters.
442     *
443     * <p>The supplied conversion should <strong>not</strong> includes the operation steps for
444     * performing {@linkplain CoordinateSystemAxis#getUnit() axis unit} conversions and change
445     * of axis order; those operations shall be inferred by this constructor by some code equivalent to:</p>
446     *
447     * <blockquote><code>
448     * MathTransform baseToDerived = {@linkplain MathTransformFactory#createBaseToDerived
449     * MathTransformFactory.createBaseToDerived}(baseCRS, parameters, derivedCS)
450     * </code></blockquote>
451     *
452     * This behavior is different than {@link #createDerivedCRS createDerivedCRS(…)} because parameterized transforms
453     * are standardized for projections. See the {@linkplain MathTransformFactory#createParameterizedTransform note on
454     * cartographic projections}.
455     *
456     * @param  properties  name and other properties to give to the new object.
457     *         Available properties are {@linkplain ObjectFactory listed there}.
458     * @param  baseCRS  geographic coordinate reference system to base the projection on.
459     *         The number of axes must matches the number of source dimensions of the conversion from base.
460     * @param  conversionFromBase  the {@linkplain CoordinateOperationFactory#createDefiningConversion defining conversion}.
461     * @param  derivedCS  the coordinate system for the projected CRS.
462     *         The number of axes must matches the number of target dimensions of the conversion from base.
463     * @return the coordinate reference system for the given properties.
464     * @throws FactoryException if the object creation failed.
465     *
466     * @see CoordinateOperationFactory#createDefiningConversion(Map, OperationMethod, ParameterValueGroup)
467     * @see MathTransformFactory#createBaseToDerived(CoordinateReferenceSystem, ParameterValueGroup, CoordinateSystem)
468     */
469    @UML(identifier="createProjectedCoordinateSystem", specification=OGC_01009)
470    default ProjectedCRS createProjectedCRS(Map<String,?> properties,
471                                            GeographicCRS baseCRS,
472                                            Conversion    conversionFromBase,
473                                            CartesianCS   derivedCS) throws FactoryException
474    {
475        throw new UnimplementedServiceException(this, ProjectedCRS.class);
476    }
477
478    /**
479     * Creates a <abbr>CRS</abbr> object from a GML string.
480     *
481     * @param  xml  coordinate reference system encoded in GML format.
482     * @return the coordinate reference system for the given GML.
483     * @throws FactoryException if the object creation failed.
484     */
485    @UML(identifier="createFromXML", specification=OGC_01009)
486    default CoordinateReferenceSystem createFromXML(String xml) throws FactoryException {
487        throw new UnimplementedServiceException(cannotParse(this, "XML"));
488    }
489
490    /**
491     * Creates a <abbr>CRS</abbr> object from a <i>Well-Known Text</i>.
492     * Well-Known texts (WKT) may come in two formats:
493     *
494     * <ul>
495     *   <li>The current standard, WKT 2, is defined by {@linkplain org.opengis.annotation.Specification#ISO_19162 ISO 19162}.</li>
496     *   <li>The legacy format, WKT 1, was defined by {@linkplain org.opengis.annotation.Specification#OGC_01009 OGC 01-009}.</li>
497     * </ul>
498     *
499     * Implementations are encouraged, but not required, to recognize both versions.
500     *
501     * @param  wkt  coordinate system encoded in Well-Known Text format.
502     * @return the coordinate reference system for the given WKT.
503     * @throws FactoryException if the object creation failed.
504     *
505     * @see org.opengis.referencing.IdentifiedObject#toWKT()
506     */
507    @UML(identifier="createFromWKT", specification=OGC_01009)
508    default CoordinateReferenceSystem createFromWKT(String wkt) throws FactoryException {
509        throw new UnimplementedServiceException(cannotParse(this, "WKT"));
510    }
511}