| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>MathTransformProvider (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <meta name="keywords" content="org.apache.sis.referencing.operation.transform.MathTransformProvider interface"> |
| <meta name="keywords" content="createMathTransform()"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="MathTransformProvider (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/MathTransformProvider.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.referencing.operation.transform</a></div> |
| <h2 title="Interface MathTransformProvider" class="title">Interface MathTransformProvider</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>Functional Interface:</dt> |
| <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> |
| </dl> |
| <hr> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang" class="externalLink">@FunctionalInterface</a> |
| public interface <span class="typeNameLabel">MathTransformProvider</span></pre> |
| <div class="block">An object capable to create <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink"><code>MathTransform</code></a> instances from given parameter values. |
| This interface is the Apache SIS mechanism by which |
| <a href="../DefaultFormula.html" title="class in org.apache.sis.referencing.operation">formula</a> are concretized as Java code. |
| |
| <p>Implementations of this interface usually extend <a href="../DefaultOperationMethod.html" title="class in org.apache.sis.referencing.operation"><code>DefaultOperationMethod</code></a>, |
| but this is not mandatory. This interface can also be used alone since <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink"><code>MathTransform</code></a> instances can be created |
| for other purpose than coordinate operations.</p> |
| |
| <p>This interface is generally not used directly. The recommended way to get a <code>MathTransform</code> |
| is to <a href="../../CRS.html#findOperation(org.opengis.referencing.crs.CoordinateReferenceSystem,org.opengis.referencing.crs.CoordinateReferenceSystem,org.opengis.metadata.extent.GeographicBoundingBox)">find the coordinate operation</a> |
| (generally from a pair of <var>source</var> and <var>target</var> CRS), then to invoke |
| <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/CoordinateOperation.html?is-external=true#getMathTransform()" title="class or interface in org.opengis.referencing.operation" class="externalLink"><code>CoordinateOperation.getMathTransform()</code></a>. |
| Alternative, one can also use a <a href="DefaultMathTransformFactory.html" title="class in org.apache.sis.referencing.operation.transform">math transform factory</a></p> |
| |
| |
| <div class="section">How to add custom coordinate operations to Apache SIS</div> |
| <a href="DefaultMathTransformFactory.html" title="class in org.apache.sis.referencing.operation.transform"><code>DefaultMathTransformFactory</code></a> can discover automatically new coordinate operations |
| (including map projections) by scanning the classpath. To define a custom coordinate operation, |
| one needs to define a <strong>thread-safe</strong> class implementing <strong>both</strong> this |
| <code>MathTransformProvider</code> interface and the <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/OperationMethod.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink"><code>OperationMethod</code></a> one. |
| While not mandatory, we suggest to extend <a href="../DefaultOperationMethod.html" title="class in org.apache.sis.referencing.operation"><code>DefaultOperationMethod</code></a>. |
| Example: |
| |
| <div class="note"><blockquote><pre><font color="green">public</font> <font color="green">class</font> MyProjectionProvider <font color="green">extends</font> DefaultOperationMethod <font color="green">implements</font> MathTransformProvider { |
| <font color="green">public</font> <b>MyProjectionProvider</b>() { |
| <b><font color="green">super</font></b>(Collections.<b>singletonMap</b>(NAME_KEY, <font color="orangered">"My projection"</font>), |
| 2, <i><font color="gray">// Number of source dimensions</font></i> |
| 2, <i><font color="gray">// Number of target dimensions</font></i> |
| parameters); |
| } |
| |
| @Override |
| <font color="green">public</font> MathTransform <b>createMathTransform</b>(MathTransformFactory factory, ParameterValueGroup parameters) { |
| <font color="green">double</font> semiMajor = values.<b>parameter</b>(<font color="orangered">"semi_major"</font>).<b>doubleValue</b>(Units.METRE); |
| <font color="green">double</font> semiMinor = values.<b>parameter</b>(<font color="orangered">"semi_minor"</font>).<b>doubleValue</b>(Units.METRE); |
| <i><font color="gray">// etc...</font></i> |
| <font color="green">return</font> <font color="green">new</font> <b>MyProjection</b>(semiMajor, semiMinor, ...); |
| } |
| }</pre></blockquote></div> |
| |
| Then the fully-qualified class name of that implementation should be listed in a file reachable on the classpath |
| with this exact name: |
| |
| <blockquote><pre>META-INF/services/org.opengis.referencing.operation.OperationMethod</pre></blockquote></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.6</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../DefaultOperationMethod.html" title="class in org.apache.sis.referencing.operation"><code>DefaultOperationMethod</code></a>, |
| <a href="DefaultMathTransformFactory.html" title="class in org.apache.sis.referencing.operation.transform"><code>DefaultMathTransformFactory</code></a>, |
| <a href="AbstractMathTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>AbstractMathTransform</code></a></dd> |
| |
| <p><font size="-1">Defined in the <code>sis-referencing</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createMathTransform(org.opengis.referencing.operation.MathTransformFactory,org.opengis.parameter.ParameterValueGroup)">createMathTransform</a></span>​(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransformFactory.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransformFactory</a> factory, |
| <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterValueGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterValueGroup</a> parameters)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a math transform from the specified group of parameter values.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="createMathTransform(org.opengis.referencing.operation.MathTransformFactory,org.opengis.parameter.ParameterValueGroup)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>createMathTransform</h4> |
| <pre class="methodSignature"><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a> createMathTransform​(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransformFactory.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransformFactory</a> factory, |
| <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterValueGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterValueGroup</a> parameters) |
| throws <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/InvalidParameterNameException.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">InvalidParameterNameException</a>, |
| <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterNotFoundException.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterNotFoundException</a>, |
| <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/InvalidParameterValueException.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">InvalidParameterValueException</a>, |
| <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/util/FactoryException.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink">FactoryException</a></pre> |
| <div class="block">Creates a math transform from the specified group of parameter values. |
| |
| <div class="note"><b>Implementation example:</b> |
| The following example shows how parameter values can be extracted |
| before to instantiate the transform: |
| |
| <blockquote><pre><font color="green">public</font> MathTransform <b>createMathTransform</b>(MathTransformFactory factory, ParameterValueGroup parameters) { |
| <font color="green">double</font> semiMajor = values.<b>parameter</b>(<font color="orangered">"semi_major"</font>).<b>doubleValue</b>(Units.METRE); |
| <font color="green">double</font> semiMinor = values.<b>parameter</b>(<font color="orangered">"semi_minor"</font>).<b>doubleValue</b>(Units.METRE); |
| <i><font color="gray">// etc...</font></i> |
| <font color="green">return</font> <font color="green">new</font> <b>MyProjection</b>(semiMajor, semiMinor, ...); |
| }</pre></blockquote> |
| </div> |
| |
| <div class="section">Purpose of the factory argument</div> |
| Some math transforms may actually be implemented as a chain of operation steps, for example a |
| <a href="DefaultMathTransformFactory.html#createConcatenatedTransform(org.opengis.referencing.operation.MathTransform,org.opengis.referencing.operation.MathTransform)">concatenation</a> of <a href="DefaultMathTransformFactory.html#createAffineTransform(org.opengis.referencing.operation.Matrix)">affine transforms</a> |
| with other kind of transforms. In such cases, implementations should use the given factory for creating |
| the steps.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>factory</code> - the factory to use if this constructor needs to create other math transforms.</dd> |
| <dd><code>parameters</code> - the parameter values that define the transform to create.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the math transform created from the given parameters.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/InvalidParameterNameException.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">InvalidParameterNameException</a></code> - if the given parameter group contains an unknown parameter.</dd> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterNotFoundException.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterNotFoundException</a></code> - if a required parameter was not found.</dd> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/InvalidParameterValueException.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">InvalidParameterValueException</a></code> - if a parameter has an invalid value.</dd> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/util/FactoryException.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink">FactoryException</a></code> - if the math transform can not be created for some other reason |
| (for example a required file was not found).</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/MathTransformProvider.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |