Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply code formatter to classes of module 'udig.tools.feature.util' #540

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -1,73 +1,70 @@
/* uDig - User Friendly Desktop Internet GIS client
/**
* uDig - User Friendly Desktop Internet GIS client
* http://udig.refractions.net
* (C) 2012, Refractions Research Inc.
* (C) 2006, Axios Engineering S.L. (Axios)
* (C) 2006, County Council of Gipuzkoa, Department of Environment and Planning
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Axios BSD
* License v1.0 (http://udig.refractions.net/files/asd3-v10.html).
*/
package org.locationtech.udig.tools.feature.util;

// OpenGIS dependencies
import org.geotools.geometry.jts.DefaultCoordinateSequenceTransformer;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;

import org.geotools.geometry.jts.LiteCoordinateSequenceFactory;
import org.locationtech.jts.geom.CoordinateSequence;
import org.locationtech.jts.geom.CoordinateSequenceFactory;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;

/**
* Coordinate Sequence preserving the Coordinate Sequence Transformer
* <p>
* This transformer extends GeoTools
* {@link DefaultCoordinateSequenceTransformer} The base class uses a user
* provided CoordinateSequenceFactory. The rational is that
* This transformer extends GeoTools {@link DefaultCoordinateSequenceTransformer} The base class
* uses a user provided CoordinateSequenceFactory. The rational is that
* DefaultCoordinateSequenceTransformer uses JTS {@code
* DefaultCoordinateSequenceFactory} then we need to preserve the one used in
* the GeometryFactory being used by uDig. (aka,
* {@link LiteCoordinateSequenceFactory}.
* DefaultCoordinateSequenceFactory} then we need to preserve the one used in the GeometryFactory
* being used by uDig. (aka, {@link LiteCoordinateSequenceFactory}.
* </p>
* <p>
* Note: this issue was solved in GeoTools 2.4. TODO: This class will be
* deprecated when uDig will be update with GeoTools 2.4
* Note: this issue was solved in GeoTools 2.4. TODO: This class will be deprecated when uDig will
* be update with GeoTools 2.4
* </p>
*
*
* @since 1.1.0
*
*
* @author Mauricio Pazos (www.axios.es)
* @author Aritz Davila (www.axios.es)
*/
class CoordSeqFactoryPreservingCoordinateSequenceTransformer extends DefaultCoordinateSequenceTransformer {
class CoordSeqFactoryPreservingCoordinateSequenceTransformer
extends DefaultCoordinateSequenceTransformer {

/**
* The coordinate sequence factory to use.
*/
private final CoordinateSequenceFactory csFactory;
/**
* The coordinate sequence factory to use.
*/
private final CoordinateSequenceFactory csFactory;

/**
* Constructs a CoordinateSequenceFactory preserving coordinate sequence
* transformer.
*
* @param csFactory
* the CoordinateSequenceFactory to use
*/
public CoordSeqFactoryPreservingCoordinateSequenceTransformer(CoordinateSequenceFactory csFactory) {
this.csFactory = csFactory;
}
/**
* Constructs a CoordinateSequenceFactory preserving coordinate sequence transformer.
*
* @param csFactory the CoordinateSequenceFactory to use
*/
public CoordSeqFactoryPreservingCoordinateSequenceTransformer(
CoordinateSequenceFactory csFactory) {
this.csFactory = csFactory;
}

/**
* Was re-written to use the factory setted by the client module
* {@inheritDoc}
*/
@Override
public CoordinateSequence transform(final CoordinateSequence sequence, final MathTransform transform)
throws TransformException {
/**
* Was re-written to use the factory set by the client module {@inheritDoc}
*/
@Override
public CoordinateSequence transform(final CoordinateSequence sequence,
final MathTransform transform) throws TransformException {

CoordinateSequence cs = super.transform(sequence, transform);
CoordinateSequence cs = super.transform(sequence, transform);

return this.csFactory.create(cs);
}
return this.csFactory.create(cs);
}
}
Loading