本文整理汇总了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;
}
}
示例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
}
示例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;
}
示例4: getCoordinateSystem
import org.opengis.referencing.cs.CartesianCS; //导入依赖的package包/类
public CartesianCS getCoordinateSystem() {
return base.getCoordinateSystem();
}