• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CoordinateSystem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: toText

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
/**
 * Returns the string representation of this coordinates.
 * 
 * @return the coordinates values/units.
 */
public Text toText() {
    double[] coordinates = getCoordinates();
    CoordinateSystem cs = this.getCoordinateReferenceSystem().getCoordinateSystem();
    TextBuilder tb = TextBuilder.newInstance();
    tb.append('[');
    for (int i=0; i < coordinates.length; i++) {
        if (i != 0) {
            tb.append(", ");
        }
        tb.append(getOrdinate(i));
        tb.append(' ');
        tb.append(cs.getAxis(i).getUnit());
    }
    tb.append(']');
    return tb.toText();
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:22,代码来源:Coordinates.java


示例2: 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


示例3: 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


示例4: updatePixelUnit

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
public void updatePixelUnit(CoordinateReferenceSystem crs) {
    final CoordinateSystem coordinateSystem = crs.getCoordinateSystem();
    final String unitX = coordinateSystem.getAxis(0).getUnit().toString();
    if (!unitX.equals(pixelXUnit.getText())) {
        pixelXUnit.setText(unitX);
        pixelSizeXField.setValue(unitMap.get(unitX));
    }
    final String unitY = coordinateSystem.getAxis(1).getUnit().toString();
    if (!unitY.equals(pixelYUnit.getText())) {
        pixelYUnit.setText(unitY);
        pixelSizeYField.setValue(unitMap.get(unitY));
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:14,代码来源:BoundsInputPanel.java


示例5: 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


示例6: 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


示例7: 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


示例8: 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


示例9: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
    return TemporalCRS.TIME_CS;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:5,代码来源:Time.java


示例10: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
    return ProjectedCRS.EASTING_NORTHING_CS;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:5,代码来源:UTM.java


示例11: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
    return GeographicCRS.LATITUDE_LONGITUDE_CS;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:5,代码来源:LatLong.java


示例12: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
    return VerticalCRS.HEIGHT_CS;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:5,代码来源:Height.java


示例13: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
    return _coordinateSystem;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:5,代码来源:CompoundCRS.java


示例14: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
    return GeocentricCRS.XYZ_CS;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:5,代码来源:XYZ.java


示例15: RegularGridImpl

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
/**
 * Constructs a RegularGrid from the given bounding box, with the given
 * width and height. Note that the bounding box represents the edges of the
 * grid, whereas grid coordinates represent the centre of the grid points.
 * 
 * @param minx
 *            the minimum x value of the bounding box
 * @param miny
 *            the minimum y value of the bounding box
 * @param maxx
 *            the maximum x value of the bounding box
 * @param maxy
 *            the maximum y value of the bounding box
 * @param crs
 *            the {@link CoordinateReferenceSystem}
 * @param width
 *            the number of grid points in the x-direction
 * @param height
 *            the number of grid points in the y-direction
 */
public RegularGridImpl(double minx, double miny, double maxx, double maxy,
        CoordinateReferenceSystem crs, int width, int height) {
    super(crs);
    if (maxx < minx || maxy < miny) {
        throw new IllegalArgumentException("Invalid bounding box");
    }

    this.crs = crs;

    double xSpacing = (maxx - minx) / width;
    double ySpacing = (maxy - miny) / height;

    // The axis values represent the centres of the grid points
    double firstXAxisValue = minx + (0.5 * xSpacing);
    double firstYAxisValue = miny + (0.5 * ySpacing);

    if (crs == null) {
        /*
         * If we don't have a crs, we can't tell if an axis is longitude
         */
        xAxis = new RegularAxisImpl("Unknown X axis", firstXAxisValue, xSpacing, width, false);
        yAxis = new RegularAxisImpl("Unknown Y axis", firstYAxisValue, ySpacing, height, false);
    } else {
        /*
         * If we do have a crs, we can use rangeMeaning==WRAPAROUND to
         * determine whether the axis is longitude
         * 
         * TODO There may be wrapped axes where this is inappropriate.
         * Perhaps change isLongitude to wraps in RegularAxisImpl, and set a
         * wrap value?
         */
        CoordinateSystem cs = crs.getCoordinateSystem();
        xAxis = new RegularAxisImpl(cs.getAxis(0).getName().toString(), firstXAxisValue,
                xSpacing, width, (cs.getAxis(0).getRangeMeaning() == RangeMeaning.WRAPAROUND));
        /*
         * y axis is very unlikely to be longitude
         */
        yAxis = new RegularAxisImpl(cs.getAxis(1).getName().toString(), firstYAxisValue,
                ySpacing, height, (cs.getAxis(1).getRangeMeaning() == RangeMeaning.WRAPAROUND));
    }
}
 
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:62,代码来源:RegularGridImpl.java


示例16: 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


示例17: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
@Override
public CoordinateSystem getCoordinateSystem() {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:opengeospatial,项目名称:Java-OpenMobility,代码行数:6,代码来源:CoordinateReferenceSystemImpl.java


示例18: getCoordinateSystem

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


示例19: getCoordinateSystem

import org.opengis.referencing.cs.CoordinateSystem; //导入依赖的package包/类
/**
 * Returns the OpenGIS coordinate system associated to this 
 * coordinate reference system.
 * 
 * @return the corresponding coordinate system. 
 */
public abstract CoordinateSystem getCoordinateSystem();
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:8,代码来源:CoordinateReferenceSystem.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WXFileUtils类代码示例发布时间:2022-05-22
下一篇:
Java Timespan类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap