本文整理汇总了Java中org.opengis.referencing.operation.TransformException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java TransformException.printStackTrace方法的具体用法?Java TransformException.printStackTrace怎么用?Java TransformException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opengis.referencing.operation.TransformException
的用法示例。
在下文中一共展示了TransformException.printStackTrace方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: worldToLLong
import org.opengis.referencing.operation.TransformException; //导入方法依赖的package包/类
public static Point2d worldToLLong( Tweed tweed, Point3d cen ) {
Point3d out = new Point3d( cen );
TweedSettings.settings.fromOrigin.transform( out );
try {
double[] latLong = new double[3];
toLatLong.transform( new double[] { out.x, out.y, out.z }, 0, latLong, 0, 1 );
return new Point2d( latLong[ 0 ], latLong[ 1 ] );
} catch ( TransformException e ) {
e.printStackTrace();
}
return null;
}
示例2: convertLonLatToEuclidean
import org.opengis.referencing.operation.TransformException; //导入方法依赖的package包/类
@Deprecated
public static ProjectedCoordinate convertLonLatToEuclidean(
Coordinate lonlat) {
final MathTransform transform = getTransform(lonlat);
final Coordinate to = new Coordinate();
// the transform seems to swap the lat lon pairs
Coordinate latlon = new Coordinate(lonlat.y, lonlat.x);
try {
JTS.transform(latlon, to,
transform);
} catch (final TransformException e) {
e.printStackTrace();
}
return new ProjectedCoordinate(transform, new Coordinate(to.y, to.x), lonlat);
}
示例3: transform
import org.opengis.referencing.operation.TransformException; //导入方法依赖的package包/类
@Override
public Geometry transform(final Geometry g) {
// Remove uselessly complicated multigeometries
if (g instanceof GeometryCollection && g.getNumGeometries() == 1) { return transform(g.getGeometryN(0)); }
Geometry geom = GeometryUtils.GEOMETRY_FACTORY.createGeometry(g);
if (transformer != null) {
try {
geom = transformer.transform(geom);
} catch (final TransformException e) {
e.printStackTrace();
}
}
translate(geom);
convertUnit(geom);
return geom;
}
示例4: analyze
import org.opengis.referencing.operation.TransformException; //导入方法依赖的package包/类
@Override
public void analyze(IVgiOperation operation, Date timePeriod) {
if (!operation.getVgiOperationType().equals(VgiOperationType.OP_ADD_NODE) && !operation.getVgiOperationType().equals(VgiOperationType.OP_MODIFY_WAY_COORDINATE)) return;
if (!data.containsKey(operation.getVersion())) {
data.put(operation.getVersion(), new GeometryUpdates());
}
GeometryUpdates geomUpdates = data.get(operation.getVersion());
Point currentCoordinate = null;
try {
// transform = CRS.findMathTransform(sourceCRS, targetCRS, true);
Point point = geometryFactory.createPoint(operation.getCoordinate());
point.setSRID(4326);
// MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS);
currentCoordinate = (Point)JTS.transform( point, transform);
// } catch (FactoryException e) {
// e.printStackTrace();
} catch (TransformException e) {
e.printStackTrace();
}
if (geomUpdates.coordinates.containsKey(operation.getRefId())) {
geomUpdates.updatesCount++;
geomUpdates.sumCoordinateDelta += geomUpdates.coordinates.get(operation.getRefId()).distance(currentCoordinate);
}
geomUpdates.coordinates.put(operation.getRefId(), currentCoordinate);
}
示例5: convertToLonLat
import org.opengis.referencing.operation.TransformException; //导入方法依赖的package包/类
@Deprecated
public static Coordinate convertToLonLat(
MathTransform transform, Coordinate xy) {
final Coordinate to = new Coordinate();
final Coordinate yx = new Coordinate(xy.y, xy.x);
try {
JTS.transform(yx, to, transform.inverse());
} catch (final TransformException e) {
e.printStackTrace();
}
return new Coordinate(to.y, to.x);
}
示例6: inverseTransform
import org.opengis.referencing.operation.TransformException; //导入方法依赖的package包/类
@Override
public Geometry inverseTransform(final Geometry g) {
Geometry geom = GeometryUtils.GEOMETRY_FACTORY.createGeometry(g);
inverseConvertUnit(geom);
inverseTranslate(geom);
if (inverseTransformer != null) {
try {
geom = inverseTransformer.transform(geom);
} catch (final TransformException e) {
e.printStackTrace();
}
}
return geom;
}