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


Java CoordinateSystem.getDimension方法代码示例

本文整理汇总了Java中org.opengis.referencing.cs.CoordinateSystem.getDimension方法的典型用法代码示例。如果您正苦于以下问题:Java CoordinateSystem.getDimension方法的具体用法?Java CoordinateSystem.getDimension怎么用?Java CoordinateSystem.getDimension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opengis.referencing.cs.CoordinateSystem的用法示例。


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

示例1: clipRange

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
/**
 *
 * @param val
 *            the value
 * @param crs
 * @param axis
 *            the coordinate axis
 * @return
 */
private static double clipRange(
		final double val,
		final CoordinateReferenceSystem crs,
		final int axis ) {
	final CoordinateSystem coordinateSystem = crs.getCoordinateSystem();
	if (coordinateSystem.getDimension() > axis) {
		final CoordinateSystemAxis coordinateAxis = coordinateSystem.getAxis(axis);
		if (val < coordinateAxis.getMinimumValue()) {
			return coordinateAxis.getMinimumValue();
		}
		else if (val > coordinateAxis.getMaximumValue()) {
			return coordinateAxis.getMaximumValue();
		}
	}
	return val;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:26,代码来源:FeatureGeometryUtils.java

示例2: adjustCoordinateDimensionToRange

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
/**
 * This is perhaps a brain dead approach to do this, but it does handle wrap
 * around cases. Also supports cases where the wrap around occurs many
 * times.
 *
 * @param val
 *            the value
 * @param crs
 * @param axis
 *            the coordinate axis
 * @return
 */
public static double adjustCoordinateDimensionToRange(
		final double val,
		final CoordinateReferenceSystem crs,
		final int axis ) {
	final CoordinateSystem coordinateSystem = crs.getCoordinateSystem();
	if (coordinateSystem.getDimension() > axis) {
		final double lowerBound = coordinateSystem.getAxis(
				axis).getMinimumValue();
		final double bound = coordinateSystem.getAxis(
				axis).getMaximumValue() - lowerBound;
		final double sign = sign(val);
		// re-scale to 0 to n, then determine how many times to 'loop
		// around'
		final double mult = Math.floor(Math.abs((val + (sign * (-1.0 * lowerBound))) / bound));
		return val + (mult * bound * sign * (-1.0));
	}
	return val;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:31,代码来源:FeatureGeometryUtils.java

示例3: contains

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
/**
 * Provides a more efficient contains() method than the one in
 * AbstractPolygon
 */
@Override
public boolean contains(double x, double y) {
    CoordinateSystem coordinateSystem = crs.getCoordinateSystem();
    if (coordinateSystem.getDimension() >= 2) {
        if (coordinateSystem.getAxis(0).getRangeMeaning() == RangeMeaning.WRAPAROUND) {
            x = GISUtils.getNextEquivalentLongitude(minx, x);
        }
        if (coordinateSystem.getAxis(1).getRangeMeaning() == RangeMeaning.WRAPAROUND) {
            y = GISUtils.getNextEquivalentLongitude(miny, y);
        }
    }
    return (x >= minx && x <= maxx && y >= miny && y <= maxy);
}
 
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:18,代码来源:BoundingBoxImpl.java

示例4: toPolygonCoordinates

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
private static Coordinate[] toPolygonCoordinates(
		final CoordinateSystem coordinateSystem ) {
	final Coordinate[] coordinates = new Coordinate[(int) Math.pow(
			2,
			coordinateSystem.getDimension()) + 1];
	final BitSet greyCode = new BitSet(
			coordinateSystem.getDimension());
	final BitSet mask = getGreyCodeMask(coordinateSystem.getDimension());
	for (int i = 0; i < coordinates.length; i++) {
		coordinates[i] = new Coordinate(
				getValue(
						greyCode,
						coordinateSystem.getAxis(0),
						0),
				getValue(
						greyCode,
						coordinateSystem.getAxis(1),
						1),
				coordinateSystem.getDimension() > 2 ? getValue(
						greyCode,
						coordinateSystem.getAxis(2),
						2) : Double.NaN);

		grayCode(
				greyCode,
				mask);
	}
	return coordinates;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:30,代码来源:FeatureGeometryUtils.java

示例5: getAxis

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
public static String getAxis(
		final CoordinateReferenceSystem crs ) {
	// Some geometries do not have a CRS provided. Thus we default to
	// urn:ogc:def:crs:EPSG::4326
	final CoordinateSystem cs = crs == null ? null : crs.getCoordinateSystem();
	if ((cs != null) && (cs.getDimension() > 0)) {
		return cs.getAxis(
				0).getDirection().name().toString();
	}
	return "EAST";
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:12,代码来源:FeatureDataUtils.java

示例6: indexOf

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
private static int indexOf(
		final CoordinateReferenceSystem crs,
		final Set<AxisDirection> direction ) {
	final CoordinateSystem cs = crs.getCoordinateSystem();
	for (int index = 0; index < cs.getDimension(); index++) {
		final CoordinateSystemAxis axis = cs.getAxis(index);
		if (direction.contains(axis.getDirection())) {
			return index;
		}
	}
	return -1;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:13,代码来源:GeoWaveRasterReader.java

示例7: internalCreatePrimaryIndex

import org.opengis.referencing.cs.CoordinateSystem; //导入方法依赖的package包/类
private static PrimaryIndex internalCreatePrimaryIndex(
		final SpatialTemporalOptions options ) {

	NumericDimensionDefinition[] dimensions;
	NumericDimensionField<?>[] fields = null;
	CoordinateReferenceSystem crs = null;
	boolean isDefaultCRS;
	String crsCode = null;

	if (options.crs == null || options.crs.isEmpty() || options.crs.equalsIgnoreCase(GeometryUtils.DEFAULT_CRS_STR)) {
		dimensions = SPATIAL_TEMPORAL_DIMENSIONS;
		fields = SPATIAL_TEMPORAL_FIELDS;
		isDefaultCRS = true;
		crsCode = "EPSG:4326";
	}
	else {
		crs = decodeCRS(options.crs);
		CoordinateSystem cs = crs.getCoordinateSystem();
		isDefaultCRS = false;
		crsCode = options.crs;
		dimensions = new NumericDimensionDefinition[cs.getDimension() + 1];
		fields = new NumericDimensionField[dimensions.length];

		for (int d = 0; d < dimensions.length - 1; d++) {
			CoordinateSystemAxis csa = cs.getAxis(d);
			dimensions[d] = new CustomCRSSpatialDimension(
					(byte) d,
					csa.getMinimumValue(),
					csa.getMaximumValue());
			fields[d] = new CustomCRSSpatialField(
					(CustomCRSSpatialDimension) dimensions[d]);
		}

		dimensions[dimensions.length - 1] = new TimeDefinition(
				options.periodicity);
		fields[dimensions.length - 1] = new TimeField(
				options.periodicity);
	}

	BasicIndexModel indexModel = null;
	if (isDefaultCRS) {
		indexModel = new BasicIndexModel(
				fields);
	}
	else {
		indexModel = new CustomCrsIndexModel(
				fields,
				crsCode);
	}

	String combinedArrayID;
	if (isDefaultCRS) {
		combinedArrayID = DEFAULT_SPATIAL_TEMPORAL_ID_STR + "_" + options.bias + "_" + options.periodicity;
	}
	else {
		combinedArrayID = DEFAULT_SPATIAL_TEMPORAL_ID_STR + "_" + (crsCode.substring(crsCode.indexOf(":") + 1))
				+ "_" + options.bias + "_" + options.periodicity;
	}
	final String combinedId = combinedArrayID;

	return new CustomIdIndex(
			XZHierarchicalIndexFactory.createFullIncrementalTieredStrategy(
					dimensions,
					new int[] {
						options.bias.getSpatialPrecision(),
						options.bias.getSpatialPrecision(),
						options.bias.getTemporalPrecision()
					},
					SFCType.HILBERT,
					options.maxDuplicates),
			indexModel,
			new ByteArrayId(
					combinedId));
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:75,代码来源:SpatialTemporalDimensionalityTypeProvider.java


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