本文整理匯總了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());
}
}