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


Java CircularString类代码示例

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


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

示例1: compareCircularString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Compare the two circular strings for equality
 *
 * @param expected
 * @param actual
 * @parma delta
 */
private static void compareCircularString(CircularString expected,
										  CircularString actual, double delta) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numPoints(), actual.numPoints());
	for (int i = 0; i < expected.numPoints(); i++) {
		comparePoint(expected.getPoints().get(i),
				actual.getPoints().get(i), delta);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:18,代码来源:GeoPackageGeometryDataUtils.java

示例2: transform

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Transform the projected circular string
 * 
 * @param circularString
 * @return projected circular string
 */
public CircularString transform(CircularString circularString) {

	CircularString to = new CircularString(circularString.hasZ(),
			circularString.hasM());

	for (Point point : circularString.getPoints()) {
		Point toPoint = transform(point);
		to.addPoint(toPoint);
	}

	return to;
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:19,代码来源:GeometryProjectionTransform.java

示例3: compareCircularString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Compare the two circular strings for equality
 * 
 * @param expected
 * @param actual
 * @parma delta
 */
private static void compareCircularString(CircularString expected,
		CircularString actual, double delta) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numPoints(), actual.numPoints());
	for (int i = 0; i < expected.numPoints(); i++) {
		comparePoint(expected.getPoints().get(i),
				actual.getPoints().get(i), delta);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:18,代码来源:GeoPackageGeometryDataUtils.java

示例4: writeCircularString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Write a Circular String
 * 
 * @param writer
 * @param circularString
 * @throws IOException
 */
public static void writeCircularString(ByteWriter writer,
		CircularString circularString) throws IOException {

	writer.writeInt(circularString.numPoints());

	for (Point point : circularString.getPoints()) {
		writePoint(writer, point);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:17,代码来源:WkbGeometryWriter.java

示例5: compareCircularString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Compare the two circular strings for equality
 * 
 * @param expected
 * @param actual
 */
public static void compareCircularString(CircularString expected,
		CircularString actual) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numPoints(), actual.numPoints());
	for (int i = 0; i < expected.numPoints(); i++) {
		comparePoint(expected.getPoints().get(i), actual.getPoints().get(i));
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:16,代码来源:WKBTestUtils.java

示例6: buildEnvelope

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Build Geometry Envelope
 * 
 * @param geometry
 *            geometry to build envelope from
 * @param envelope
 *            envelope to expand
 */
public static void buildEnvelope(Geometry geometry,
		GeometryEnvelope envelope) {

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		addPointMessage(envelope, (Point) geometry);
		break;
	case LINESTRING:
		addLineStringMessage(envelope, (LineString) geometry);
		break;
	case POLYGON:
		addPolygonMessage(envelope, (Polygon) geometry);
		break;
	case MULTIPOINT:
		addMultiPointMessage(envelope, (MultiPoint) geometry);
		break;
	case MULTILINESTRING:
		addMultiLineStringMessage(envelope, (MultiLineString) geometry);
		break;
	case MULTIPOLYGON:
		addMultiPolygonMessage(envelope, (MultiPolygon) geometry);
		break;
	case CIRCULARSTRING:
		addLineStringMessage(envelope, (CircularString) geometry);
		break;
	case COMPOUNDCURVE:
		addCompoundCurveMessage(envelope, (CompoundCurve) geometry);
		break;
	case POLYHEDRALSURFACE:
		addPolyhedralSurfaceMessage(envelope, (PolyhedralSurface) geometry);
		break;
	case TIN:
		addPolyhedralSurfaceMessage(envelope, (TIN) geometry);
		break;
	case TRIANGLE:
		addPolygonMessage(envelope, (Triangle) geometry);
		break;
	case GEOMETRYCOLLECTION:
		updateHasZandM(envelope, geometry);
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		List<Geometry> geometries = geomCollection.getGeometries();
		for (Geometry subGeometry : geometries) {
			buildEnvelope(subGeometry, envelope);
		}
		break;
	default:
	}

}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:60,代码来源:GeometryEnvelopeBuilder.java

示例7: getGeometryString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Get Geometry Information as a String
 * 
 * @param geometry
 *            geometry
 * @return geometry String
 */
public static String getGeometryString(Geometry geometry) {

	StringBuilder message = new StringBuilder();

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		addPointMessage(message, (Point) geometry);
		break;
	case LINESTRING:
		addLineStringMessage(message, (LineString) geometry);
		break;
	case POLYGON:
		addPolygonMessage(message, (Polygon) geometry);
		break;
	case MULTIPOINT:
		addMultiPointMessage(message, (MultiPoint) geometry);
		break;
	case MULTILINESTRING:
		addMultiLineStringMessage(message, (MultiLineString) geometry);
		break;
	case MULTIPOLYGON:
		addMultiPolygonMessage(message, (MultiPolygon) geometry);
		break;
	case CIRCULARSTRING:
		addLineStringMessage(message, (CircularString) geometry);
		break;
	case COMPOUNDCURVE:
		addCompoundCurveMessage(message, (CompoundCurve) geometry);
		break;
	case POLYHEDRALSURFACE:
		addPolyhedralSurfaceMessage(message, (PolyhedralSurface) geometry);
		break;
	case TIN:
		addPolyhedralSurfaceMessage(message, (TIN) geometry);
		break;
	case TRIANGLE:
		addPolygonMessage(message, (Triangle) geometry);
		break;
	case GEOMETRYCOLLECTION:
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		message.append("Geometries: " + geomCollection.numGeometries());
		List<Geometry> geometries = geomCollection.getGeometries();
		for (int i = 0; i < geometries.size(); i++) {
			Geometry subGeometry = geometries.get(i);
			message.append("\n\n");
			message.append(Geometry.class.getSimpleName() + " " + (i + 1));
			message.append("\n");
			message.append(subGeometry.getGeometryType().getName());
			message.append("\n");
			message.append(getGeometryString(subGeometry));
		}
		break;
	default:
	}

	return message.toString();
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:67,代码来源:GeometryPrinter.java

示例8: getJSONCompatibleGeometry

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Get a Geometry object that is JSON compatible
 * 
 * @param geometry
 *            geometry
 * @return geometry JSON object
 */
public static Object getJSONCompatibleGeometry(Geometry geometry) {

	Map<String, Object> jsonObject = new HashMap<>();

	Object geometryObject = null;

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		geometryObject = getPoint((Point) geometry);
		break;
	case LINESTRING:
		geometryObject = getLineString((LineString) geometry);
		break;
	case POLYGON:
		geometryObject = getPolygon((Polygon) geometry);
		break;
	case MULTIPOINT:
		geometryObject = getMultiPoint((MultiPoint) geometry);
		break;
	case MULTILINESTRING:
		geometryObject = getMultiLineString((MultiLineString) geometry);
		break;
	case MULTIPOLYGON:
		geometryObject = getMultiPolygon((MultiPolygon) geometry);
		break;
	case CIRCULARSTRING:
		geometryObject = getLineString((CircularString) geometry);
		break;
	case COMPOUNDCURVE:
		geometryObject = getCompoundCurve((CompoundCurve) geometry);
		break;
	case POLYHEDRALSURFACE:
		geometryObject = getPolyhedralSurface((PolyhedralSurface) geometry);
		break;
	case TIN:
		geometryObject = getPolyhedralSurface((TIN) geometry);
		break;
	case TRIANGLE:
		geometryObject = getPolygon((Triangle) geometry);
		break;
	case GEOMETRYCOLLECTION:
		List<Object> jsonGeoCollectionObject = new ArrayList<>();
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		List<Geometry> geometries = geomCollection.getGeometries();
		for (int i = 0; i < geometries.size(); i++) {
			Geometry subGeometry = geometries.get(i);
			jsonGeoCollectionObject
					.add(getJSONCompatibleGeometry(subGeometry));
		}
		geometryObject = jsonGeoCollectionObject;
		break;
	default:
	}

	if (geometryObject != null) {
		jsonObject.put(geometryType.getName(), geometryObject);
	}

	return jsonObject;
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:70,代码来源:GeometryJSONCompatible.java

示例9: minimizeGeometry

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Minimize the geometry using the shortest x distance between each
 * connected set of points. The resulting geometry point x values will be in
 * the range: (3 * min value <= x <= 3 * max value
 *
 * Example: For WGS84 provide a max x of 180.0. Resulting x values will be
 * in the range: -540.0 <= x <= 540.0
 *
 * Example: For web mercator provide a world width of 20037508.342789244.
 * Resulting x values will be in the range: -60112525.028367732 <= x <=
 * 60112525.028367732
 *
 * @param geometry
 *            geometry
 * @param maxX
 *            max positive x value in the geometry projection
 */
public static void minimizeGeometry(Geometry geometry, double maxX) {

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case LINESTRING:
		minimize((LineString) geometry, maxX);
		break;
	case POLYGON:
		minimize((Polygon) geometry, maxX);
		break;
	case MULTILINESTRING:
		minimize((MultiLineString) geometry, maxX);
		break;
	case MULTIPOLYGON:
		minimize((MultiPolygon) geometry, maxX);
		break;
	case CIRCULARSTRING:
		minimize((CircularString) geometry, maxX);
		break;
	case COMPOUNDCURVE:
		minimize((CompoundCurve) geometry, maxX);
		break;
	case POLYHEDRALSURFACE:
		minimize((PolyhedralSurface) geometry, maxX);
		break;
	case TIN:
		minimize((TIN) geometry, maxX);
		break;
	case TRIANGLE:
		minimize((Triangle) geometry, maxX);
		break;
	case GEOMETRYCOLLECTION:
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		for (Geometry subGeometry : geomCollection.getGeometries()) {
			minimizeGeometry(subGeometry, maxX);
		}
		break;
	default:
		break;

	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:61,代码来源:GeometryUtils.java

示例10: normalizeGeometry

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Normalize the geometry so all points outside of the min and max value
 * range are adjusted to fall within the range.
 *
 * Example: For WGS84 provide a max x of 180.0. Resulting x values will be
 * in the range: -180.0 <= x <= 180.0.
 *
 * Example: For web mercator provide a world width of 20037508.342789244.
 * Resulting x values will be in the range: -20037508.342789244 <= x <=
 * 20037508.342789244.
 *
 * @param geometry
 *            geometry
 * @param maxX
 *            max positive x value in the geometry projection
 */
public static void normalizeGeometry(Geometry geometry, double maxX) {

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		normalize((Point) geometry, maxX);
		break;
	case LINESTRING:
		normalize((LineString) geometry, maxX);
		break;
	case POLYGON:
		normalize((Polygon) geometry, maxX);
		break;
	case MULTIPOINT:
		normalize((MultiPoint) geometry, maxX);
		break;
	case MULTILINESTRING:
		normalize((MultiLineString) geometry, maxX);
		break;
	case MULTIPOLYGON:
		normalize((MultiPolygon) geometry, maxX);
		break;
	case CIRCULARSTRING:
		normalize((CircularString) geometry, maxX);
		break;
	case COMPOUNDCURVE:
		normalize((CompoundCurve) geometry, maxX);
		break;
	case POLYHEDRALSURFACE:
		normalize((PolyhedralSurface) geometry, maxX);
		break;
	case TIN:
		normalize((TIN) geometry, maxX);
		break;
	case TRIANGLE:
		normalize((Triangle) geometry, maxX);
		break;
	case GEOMETRYCOLLECTION:
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		for (Geometry subGeometry : geomCollection.getGeometries()) {
			normalizeGeometry(subGeometry, maxX);
		}
		break;
	default:
		break;

	}

}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:67,代码来源:GeometryUtils.java

示例11: readCircularString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Read a Circular String
 * 
 * @param reader
 * @param hasZ
 * @param hasM
 * @return circular string
 */
public static CircularString readCircularString(ByteReader reader,
		boolean hasZ, boolean hasM) {

	CircularString circularString = new CircularString(hasZ, hasM);

	int numPoints = reader.readInt();

	for (int i = 0; i < numPoints; i++) {
		Point point = readPoint(reader, hasZ, hasM);
		circularString.addPoint(point);

	}

	return circularString;
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:24,代码来源:WkbGeometryReader.java

示例12: toCircularString

import mil.nga.wkb.geom.CircularString; //导入依赖的package包/类
/**
 * Convert a list of {@link LatLng} to a {@link CircularString}
 *
 * @param latLngs
 * @param hasZ
 * @param hasM
 * @return
 */
public CircularString toCircularString(List<LatLng> latLngs, boolean hasZ,
                                       boolean hasM) {

    CircularString circularString = new CircularString(hasZ, hasM);

    populateLineString(circularString, latLngs);

    return circularString;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:18,代码来源:GoogleMapShapeConverter.java


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