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


Java CartesianCS类代码示例

本文整理汇总了Java中org.opengis.referencing.cs.CartesianCS的典型用法代码示例。如果您正苦于以下问题:Java CartesianCS类的具体用法?Java CartesianCS怎么用?Java CartesianCS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CartesianCS类属于org.opengis.referencing.cs包,在下文中一共展示了CartesianCS类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeTargetCRS

import org.opengis.referencing.cs.CartesianCS; //导入依赖的package包/类
void computeTargetCRS(final IScope scope, final CoordinateReferenceSystem crs, final double longitude,
		final double latitude) {
	// If we already know in which CRS we project the data in GAMA, no need to recompute it. This information is
	// normally wiped when an experiment is disposed
	if (targetCRS != null) { return; }
	try {
		if (!GamaPreferences.External.LIB_TARGETED.getValue()) {
			targetCRS = computeDefaultCRS(scope, GamaPreferences.External.LIB_TARGET_CRS.getValue(), true);
		} else {
			if (crs != null && crs instanceof ProjectedCRS) { // Temporary fix of issue 766... a better solution
				CartesianCS ccs = ((ProjectedCRS) crs).getCoordinateSystem();
				Unit<?> unitX = ccs.getAxis(0).getUnit();
				if (unitX != null && !unitX.equals(SI.METER)) {
					unitConverter = unitX.getConverterTo(SI.METER);
				} 
				targetCRS = crs;
			} else {
				final int index = (int) (0.5 + (longitude + 186.0) / 6);
				final boolean north = latitude > 0;
				final String newCode = EPSGPrefix + (32600 + index + (north ? 0 : 100));
				targetCRS = getCRS(scope, newCode);
			}
		}
	} catch (final GamaRuntimeException e) {
		e.addContext(
				"The cause could be that you try to re-project already projected data (see Gama > Preferences... > External for turning the option to true)");
		throw e;
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:30,代码来源:ProjectionFactory.java

示例2: premadeObjects

import org.opengis.referencing.cs.CartesianCS; //导入依赖的package包/类
/**
 * A method with some examples of premade static objects.
 */
void premadeObjects() {
    // premadeObjects start
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    GeodeticDatum wgs84Datum = org.geotools.referencing.datum.DefaultGeodeticDatum.WGS84;
    PrimeMeridian greenwichMeridian = org.geotools.referencing.datum.DefaultPrimeMeridian.GREENWICH;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
    CoordinateSystemAxis latAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LATITUDE;
    // premadeObjects end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:13,代码来源:ReferencingExamples.java

示例3: createCRSByHand1

import org.opengis.referencing.cs.CartesianCS; //导入依赖的package包/类
/**
 * Creates a WGS 84/UTM Zone 10N CRS mostly (uses some premade objects) by hand. Uses the higher
 * level FactoryGroup instead of the lower level MathTransformFactory (commented out).
 * 
 * @throws Exception
 */
void createCRSByHand1() throws Exception {
    System.out.println("------------------------------------------");
    System.out.println("Creating a CRS by hand:");
    // createCRSByHand1 start
    MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);
    CRSFactory crsFactory = ReferencingFactoryFinder.getCRSFactory(null);
    
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
    
    ParameterValueGroup parameters = mtFactory.getDefaultParameters("Transverse_Mercator");
    parameters.parameter("central_meridian").setValue(-111.0);
    parameters.parameter("latitude_of_origin").setValue(0.0);
    parameters.parameter("scale_factor").setValue(0.9996);
    parameters.parameter("false_easting").setValue(500000.0);
    parameters.parameter("false_northing").setValue(0.0);
    Conversion conversion = new DefiningConversion("Transverse_Mercator", parameters);
    
    Map<String, ?> properties = Collections.singletonMap("name", "WGS 84 / UTM Zone 12N");
    ProjectedCRS projCRS = crsFactory.createProjectedCRS(properties, geoCRS, conversion, cartCS);
    // createCRSByHand1 end
    
    // parameters.parameter("semi_major").setValue(((GeodeticDatum)geoCRS.getDatum()).getEllipsoid().getSemiMajorAxis());
    // parameters.parameter("semi_minor").setValue(((GeodeticDatum)geoCRS.getDatum()).getEllipsoid().getSemiMinorAxis());
    
    // MathTransform trans = mtFactory.createParameterizedTransform(parameters);
    // ProjectedCRS projCRS = crsFactory.createProjectedCRS(
    // Collections.singletonMap("name", "WGS 84 / UTM Zone 12N"),
    // new org.geotools.referencing.operation.OperationMethod(trans),
    // geoCRS, trans, cartCS);
    System.out.println("  Projected CRS: " + projCRS.toWKT());
    System.out.println("------------------------------------------");
    
    // save for later use in createMathTransformBetweenCRSs()
    this.utm10NCRS = projCRS;
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:43,代码来源:ReferencingExamples.java

示例4: getCoordinateSystem

import org.opengis.referencing.cs.CartesianCS; //导入依赖的package包/类
public CartesianCS getCoordinateSystem() {
	return base.getCoordinateSystem();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:ProjectedCrsImpl.java


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