/** * Parses a "PASSTHROUGH_MT" element. This element has the following pattern: * * <blockquote> * * <code> * PASSTHROUGH_MT[<integer>, <math transform>] * </code> * * </blockquote> * * @param parent The parent element. * @return The "PASSTHROUGH_MT" element as an {@link MathTransform} object. * @throws ParseException if the "PASSTHROUGH_MT" element can't be parsed. */ private MathTransform parsePassThroughMT(final Element parent) throws ParseException { final Element element = parent.pullElement("PASSTHROUGH_MT"); final int firstAffectedOrdinate = parent.pullInteger("firstAffectedOrdinate"); final MathTransform transform = parseMathTransform(element, true); element.close(); try { return mtFactory.createPassThroughTransform(firstAffectedOrdinate, transform, 0); } catch (FactoryException exception) { throw element.parseFailed(exception, null); } }
/** Delegate to {@link MathTransformFactory#createPassThroughTransform(int, MathTransform, int)}. */ @Override MathTransform passThrough(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates) throws FactoryException { return factory.createPassThroughTransform(firstAffectedOrdinate, subTransform, numTrailingOrdinates); }
/** * A datum identical to the specified datum except for the prime meridian, which is replaced by * Greenwich. This datum is processed in a special way by {@link #equalsIgnorePrimeMeridian}. */ private static final class TemporaryDatum extends DefaultGeodeticDatum { /** For cros-version compatibility. */ private static final long serialVersionUID = -8964199103509187219L; /** The wrapped datum. */ private final GeodeticDatum datum; /** Wrap the specified datum. */ public TemporaryDatum(final GeodeticDatum datum) { super(getTemporaryName(datum), datum.getEllipsoid(), DefaultPrimeMeridian.GREENWICH); this.datum = datum; } /** Unwrap the datum. */ public static GeodeticDatum unwrap(GeodeticDatum datum) { while (datum instanceof TemporaryDatum) { datum = ((TemporaryDatum) datum).datum; } return datum; } /** Compares this datum with the specified object for equality. */ @Override public boolean equals( final AbstractIdentifiedObject object, final boolean compareMetadata) { if (super.equals(object, compareMetadata)) {
/** * Creates a three-dimensional map projections for the given parameters. * The ellipsoidal height is assumed to be in the third dimension. */ @Override public MathTransform createMathTransform(MathTransformFactory factory, ParameterValueGroup parameters) throws FactoryException { return factory.createPassThroughTransform(0, redimensioned.createMathTransform(factory, parameters), 1); } }
/** * Creates a three-dimensional map projections for the given parameters. * The ellipsoidal height is assumed to be in the third dimension. */ @Override public MathTransform createMathTransform(MathTransformFactory factory, ParameterValueGroup parameters) throws FactoryException { return factory.createPassThroughTransform(0, redimensioned.createMathTransform(factory, parameters), 1); } }
compare(sub, sub, 0); try { mtFactory.createPassThroughTransform(-1, sub, 0); fail("An illegal argument should have been detected"); } catch (FactoryException e) { mtFactory.createPassThroughTransform(0, sub, -1); fail("An illegal argument should have been detected"); } catch (FactoryException e) { "Failed to recognize that no passthrough transform was needed", sub, mtFactory.createPassThroughTransform(0, sub, 0)); final MathTransform passthrough = mtFactory.createPassThroughTransform(subLower, sub, 1); assertEquals( "Wrong number of source dimensions",
final int firstAffectedOrdinate = Math.max(0, subLower - lower); final int numTrailingOrdinates = Math.max(0, upper - subUpper); return factory.createPassThroughTransform( firstAffectedOrdinate, subTransform, numTrailingOrdinates);
MathTransform step = filter.separate(toSource); ensureStableDimensions(filter); step = factory.createPassThroughTransform(0, step, sourceDim - lowerDim); toTarget = factory.createConcatenatedTransform(step, toTarget); MathTransform step = filter.separate(toSource); ensureStableDimensions(filter); step = factory.createPassThroughTransform(upperDim, step, 0); toTarget = factory.createConcatenatedTransform(toTarget, step);
/** * Returns the cylindrical, including conversion between degrees and radians units. * This method is legal only for {@link PolarToCartesian} or {@link CartesianToPolar}. */ final MathTransform passthrough(final MathTransformFactory factory) throws FactoryException { MathTransform tr = passthrough; if (tr == null) { tr = factory.createPassThroughTransform(0, completeTransform(factory), 1); if (DefaultFactories.isDefaultInstance(MathTransformFactory.class, factory)) { // No need to synchronize since DefaultMathTransformFactory returns unique instances. passthrough = tr; } } return tr; }
/** * Returns the cylindrical, including conversion between degrees and radians units. * This method is legal only for {@link PolarToCartesian} or {@link CartesianToPolar}. */ final MathTransform passthrough(final MathTransformFactory factory) throws FactoryException { MathTransform tr = passthrough; if (tr == null) { tr = factory.createPassThroughTransform(0, completeTransform(factory), 1); if (DefaultFactories.isDefaultInstance(MathTransformFactory.class, factory)) { // No need to synchronize since DefaultMathTransformFactory returns unique instances. passthrough = tr; } } return tr; }
/** * Parses a {@code "PASSTHROUGH_MT"} element. This element has the following pattern: * * {@preformat text * PASSTHROUGH_MT[<integer>, <math transform>] * } * * @param parent the parent element. * @return the {@code "PASSTHROUGH_MT"} element as an {@link MathTransform} object. * @throws ParseException if the {@code "PASSTHROUGH_MT"} element can not be parsed. */ private MathTransform parsePassThroughMT(final Element parent) throws ParseException { final Element element = parent.pullElement(FIRST, WKTKeywords.PassThrough_MT); if (element == null) { return null; } final int firstAffectedOrdinate = parent.pullInteger("firstAffectedOrdinate"); final MathTransform transform = parseMathTransform(element, true); element.close(ignoredElements); try { return mtFactory.createPassThroughTransform(firstAffectedOrdinate, transform, 0); } catch (FactoryException exception) { throw element.parseFailed(exception); } }
/** * Parses a {@code "PASSTHROUGH_MT"} element. This element has the following pattern: * * {@preformat text * PASSTHROUGH_MT[<integer>, <math transform>] * } * * @param parent the parent element. * @return the {@code "PASSTHROUGH_MT"} element as an {@link MathTransform} object. * @throws ParseException if the {@code "PASSTHROUGH_MT"} element can not be parsed. */ private MathTransform parsePassThroughMT(final Element parent) throws ParseException { final Element element = parent.pullElement(FIRST, WKTKeywords.PassThrough_MT); if (element == null) { return null; } final int firstAffectedOrdinate = parent.pullInteger("firstAffectedOrdinate"); final MathTransform transform = parseMathTransform(element, true); element.close(ignoredElements); try { return mtFactory.createPassThroughTransform(firstAffectedOrdinate, transform, 0); } catch (FactoryException exception) { throw element.parseFailed(exception); } }
if (i < nonLinearCount) { final int srcDim = sourceDimensions[i]; tr = factory.createPassThroughTransform(srcDim, tr, (srcEnd + 1) - (srcDim + tr.getSourceDimensions()));
transform = factory.createPassThroughTransform(interpDim, transform, 0);
transform = factory.createPassThroughTransform(interpDim, transform, 0);
mtFactory.createAffineTransform(prepend), mt), mtFactory.createAffineTransform(append)); mt = mtFactory.createPassThroughTransform(0, mt, 1); projection = new DefaultConversion(IdentifiedObjects.getProperties(projection), projection.getMethod(), mt, null);
MathTransform step = filter.separate(toSource); ensureStableDimensions(filter); step = factory.createPassThroughTransform(0, step, sourceDim-lowerDim); toTarget = factory.createConcatenatedTransform(step, toTarget); MathTransform step = filter.separate(toSource); ensureStableDimensions(filter); step = factory.createPassThroughTransform(upperDim, step, 0); toTarget = factory.createConcatenatedTransform(toTarget, step);
pixelIsPoint = true; gridToCRS = Localization.nonLinear(modelTiePoints); gridToCRS = factory.createPassThroughTransform(0, gridToCRS, n - 2);
return factory.createPassThroughTransform(subLower - lower, subTransform, Math.max(0, upper - subUpper));
if (sub != null) { if (factory != null) { return factory.createPassThroughTransform( candidate.firstAffectedOrdinate, factory.createConcatenatedTransform(factory.createAffineTransform(sub), candidate.subTransform),