当前位置: 首页>>代码示例>>Java>>正文


Java CRS.getProjectedCRS方法代码示例

本文整理汇总了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)
            ));
        }
    }
}
 
开发者ID:gdi-by,项目名称:downloadclient,代码行数:58,代码来源:WMSMapSwing.java

示例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());
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:15,代码来源:Projection.java


注:本文中的org.geotools.referencing.CRS.getProjectedCRS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。