本文整理汇总了Java中org.geotools.referencing.CRS.getProjectedCRS方法的典型用法代码示例。如果您正苦于以下问题:Java CRS.getProjectedCRS方法的具体用法?Java CRS.getProjectedCRS怎么用?Java CRS.getProjectedCRS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.referencing.CRS
的用法示例。
在下文中一共展示了CRS.getProjectedCRS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertAndDisplayBoundingBox
import org.geotools.referencing.CRS; //导入方法依赖的package包/类
private void convertAndDisplayBoundingBox(
Double x1,
Double x2,
Double y1,
Double y2,
CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS
) throws TransformException, FactoryException {
com.vividsolutions.jts.geom.Point p1 = convertDoublesToPoint(
x1,
y1,
sourceCRS,
targetCRS);
com.vividsolutions.jts.geom.Point p2 = convertDoublesToPoint(
x2,
y2,
sourceCRS,
targetCRS);
ReferencedEnvelope re = new ReferencedEnvelope(targetCRS);
re.include(p1.getX(), p1.getY());
re.include(p2.getX(), p2.getY());
DirectPosition lowerCorner = re.getLowerCorner();
DirectPosition upperCorner = re.getUpperCorner();
if (lowerCorner != null && upperCorner != null) {
double valX1 = lowerCorner.getCoordinate()[0];
double valY1 = lowerCorner.getCoordinate()[1];
double valX2 = upperCorner.getCoordinate()[0];
double valY2 = upperCorner.getCoordinate()[1];
if (CRS.getProjectedCRS(targetCRS) == null) {
this.coordinateX1TextField.setText(String.valueOf(
Math.round(valX1 * HOUNDREDTHOUSAND) / HOUNDREDTHOUSAND
));
this.coordinateY1TextField.setText(String.valueOf(
Math.round(valY1 * HOUNDREDTHOUSAND) / HOUNDREDTHOUSAND
));
this.coordinateX2TextField.setText(String.valueOf(
Math.round(valX2 * HOUNDREDTHOUSAND) / HOUNDREDTHOUSAND
));
this.coordinateY2TextField.setText(String.valueOf(
Math.round(valY2 * HOUNDREDTHOUSAND) / HOUNDREDTHOUSAND
));
} else {
this.coordinateX1TextField.setText(String.valueOf(
Math.round((float) valX1)
));
this.coordinateY1TextField.setText(String.valueOf(
Math.round((float) valY1)
));
this.coordinateX2TextField.setText(String.valueOf(
Math.round((float) valX2)
));
this.coordinateY2TextField.setText(String.valueOf(
Math.round((float) valY2)
));
}
}
}
示例2: Projection
import org.geotools.referencing.CRS; //导入方法依赖的package包/类
Projection(final IScope scope, final IProjection world, final CoordinateReferenceSystem crs, final Envelope3D env,
final ProjectionFactory fact) {
this.factory = fact;
this.referenceProjection = world;
initialCRS = crs;
if (env != null) {
if (CRS.getProjectedCRS(initialCRS) == null) {
createTransformation(computeProjection(scope));
}
// We project the envelope and we use it for initializing the translations
projectedEnv = transform(env);
// createTranslations(projectedEnv.getMinX(), projectedEnv.getHeight(), projectedEnv.getMinY());
}
}