本文整理汇总了Java中mil.nga.wkb.geom.MultiPoint类的典型用法代码示例。如果您正苦于以下问题:Java MultiPoint类的具体用法?Java MultiPoint怎么用?Java MultiPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiPoint类属于mil.nga.wkb.geom包,在下文中一共展示了MultiPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toLatLngs
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Convert a {@link MultiPoint} to a {@link MultiLatLng}
*
* @param multiPoint
* @return
*/
public MultiLatLng toLatLngs(MultiPoint multiPoint) {
MultiLatLng multiLatLng = new MultiLatLng();
for (Point point : multiPoint.getPoints()) {
LatLng latLng = toLatLng(point);
multiLatLng.add(latLng);
}
return multiLatLng;
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:18,代码来源:GoogleMapShapeConverter.java
示例2: toMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Convert a {@link MultiLatLng} to a {@link MultiPoint}
*
* @param latLngs
* @param hasZ
* @param hasM
* @return
*/
public MultiPoint toMultiPoint(List<LatLng> latLngs, boolean hasZ,
boolean hasM) {
MultiPoint multiPoint = new MultiPoint(hasZ, hasM);
for (LatLng latLng : latLngs) {
Point point = toPoint(latLng);
multiPoint.addPoint(point);
}
return multiPoint;
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:21,代码来源:GoogleMapShapeConverter.java
示例3: convertMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Test the MultiPoint conversion
*
* @param converter
* @param multiPoint
*/
private static void convertMultiPoint(GoogleMapShapeConverter converter,
MultiPoint multiPoint) {
MultiLatLng latLngs = converter.toLatLngs(multiPoint);
TestCase.assertNotNull(latLngs);
TestCase.assertFalse(latLngs.getLatLngs().isEmpty());
List<Point> points = multiPoint.getPoints();
comparePointsAndLatLngs(converter, points, latLngs.getLatLngs());
MultiPoint multiPoint2 = converter.toMultiPoint(latLngs);
comparePoints(multiPoint.getPoints(), multiPoint2.getPoints());
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:20,代码来源:GoogleMapShapeConverterUtils.java
示例4: validateMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Validate Multi Point
*
* @param topGeometry
* @param multiPoint
*/
private static void validateMultiPoint(Geometry topGeometry,
MultiPoint multiPoint) {
TestCase.assertEquals(GeometryType.MULTIPOINT,
multiPoint.getGeometryType());
validateZAndM(topGeometry, multiPoint);
for (Point point : multiPoint.getPoints()) {
validatePoint(topGeometry, point);
}
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:20,代码来源:FeatureUtils.java
示例5: compareMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Compare the two multi points for equality
*
* @param expected
* @param actual
* @param delta
*/
private static void compareMultiPoint(MultiPoint expected,
MultiPoint 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
示例6: transform
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Transform the projected multi point
*
* @param multiPoint
* @return projected multi point
*/
public MultiPoint transform(MultiPoint multiPoint) {
MultiPoint to = new MultiPoint(multiPoint.hasZ(), multiPoint.hasM());
for (Point point : multiPoint.getPoints()) {
Point toPoint = transform(point);
to.addPoint(toPoint);
}
return to;
}
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:18,代码来源:GeometryProjectionTransform.java
示例7: compareMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Compare the two multi points for equality
*
* @param expected
* @param actual
* @param delta
*/
private static void compareMultiPoint(MultiPoint expected,
MultiPoint 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
示例8: addMultiPointMessage
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Add MultiPoint
*
* @param envelope
* @param multiPoint
*/
private static void addMultiPointMessage(GeometryEnvelope envelope,
MultiPoint multiPoint) {
updateHasZandM(envelope, multiPoint);
List<Point> points = multiPoint.getPoints();
for (Point point : points) {
addPointMessage(envelope, point);
}
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:17,代码来源:GeometryEnvelopeBuilder.java
示例9: addMultiPointMessage
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Add MultiPoint message
*
* @param message
* @param multiPoint
*/
private static void addMultiPointMessage(StringBuilder message,
MultiPoint multiPoint) {
message.append(Point.class.getSimpleName() + "s: "
+ multiPoint.numPoints());
List<Point> points = multiPoint.getPoints();
for (int i = 0; i < points.size(); i++) {
Point point = points.get(i);
message.append("\n\n");
message.append(Point.class.getSimpleName() + " " + (i + 1));
message.append("\n");
addPointMessage(message, point);
}
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:20,代码来源:GeometryPrinter.java
示例10: getMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Get MultiPoint object
*
* @param multiPoint
* @return multi point object
*/
private static Object getMultiPoint(MultiPoint multiPoint) {
List<Object> jsonObject = new ArrayList<>();
List<Point> points = multiPoint.getPoints();
for (int i = 0; i < points.size(); i++) {
Point point = points.get(i);
jsonObject.add(getPoint(point));
}
return jsonObject;
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:16,代码来源:GeometryJSONCompatible.java
示例11: add
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Add a point based dimension 0 geometry to the centroid total
*
* @param geometry
* geometry
*/
public void add(Geometry geometry) {
GeometryType geometryType = geometry.getGeometryType();
switch (geometryType) {
case POINT:
add((Point) geometry);
break;
case MULTIPOINT:
MultiPoint multiPoint = (MultiPoint) geometry;
for (Point point : multiPoint.getPoints()) {
add(point);
}
break;
case GEOMETRYCOLLECTION:
@SuppressWarnings("unchecked")
GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
List<Geometry> geometries = geomCollection.getGeometries();
for (Geometry subGeometry : geometries) {
add(subGeometry);
}
break;
default:
throw new WkbException("Unsupported "
+ this.getClass().getSimpleName() + " Geometry Type: "
+ geometryType);
}
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:33,代码来源:CentroidPoint.java
示例12: writeMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Write a Multi Point
*
* @param writer
* @param multiPoint
* @throws IOException
*/
public static void writeMultiPoint(ByteWriter writer, MultiPoint multiPoint)
throws IOException {
writer.writeInt(multiPoint.numPoints());
for (Point point : multiPoint.getPoints()) {
writeGeometry(writer, point);
}
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:17,代码来源:WkbGeometryWriter.java
示例13: testMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
@Test
public void testMultiPoint() throws IOException {
for (int i = 0; i < GEOMETRIES_PER_TEST; i++) {
// Create and test a multi point
MultiPoint multiPoint = WKBTestUtils.createMultiPoint(
WKBTestUtils.coinFlip(), WKBTestUtils.coinFlip());
geometryTester(multiPoint);
}
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:12,代码来源:WKBTest.java
示例14: testMultiPointCentroid
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
@Test
public void testMultiPointCentroid() throws IOException {
for (int i = 0; i < GEOMETRIES_PER_TEST; i++) {
// Create and test a multi point
MultiPoint multiPoint = WKBTestUtils.createMultiPoint(
WKBTestUtils.coinFlip(), WKBTestUtils.coinFlip());
TestCase.assertEquals(0, GeometryUtils.getDimension(multiPoint));
geometryCentroidTester(multiPoint);
}
}
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:13,代码来源:GeometryUtilsTest.java
示例15: compareMultiPoint
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Compare the two multi points for equality
*
* @param expected
* @param actual
*/
public static void compareMultiPoint(MultiPoint expected, MultiPoint 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,代码行数:15,代码来源:WKBTestUtils.java
示例16: toLatLngs
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Convert a {@link MultiPoint} to a {@link MultiLatLng}
*
* @param multiPoint
* @return
*/
public MultiLatLng toLatLngs(MultiPoint multiPoint) {
MultiLatLng multiLatLng = new MultiLatLng();
for (Point point : multiPoint.getPoints()) {
GeoPoint latLng = toLatLng2(point);
multiLatLng.add(latLng);
}
return multiLatLng;
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:18,代码来源:OsmMapShapeConverter.java
示例17: validateGeometry
import mil.nga.wkb.geom.MultiPoint; //导入依赖的package包/类
/**
* Validate the geometry
*
* @param geometryType
* @param geometry
*/
private static void validateGeometry(GeometryType geometryType,
Geometry geometry) {
switch (geometryType) {
case POINT:
TestCase.assertTrue(geometry instanceof Point);
Point point = (Point) geometry;
validatePoint(point, point);
break;
case LINESTRING:
TestCase.assertTrue(geometry instanceof LineString);
LineString lineString = (LineString) geometry;
validateLineString(lineString, lineString);
break;
case POLYGON:
TestCase.assertTrue(geometry instanceof Polygon);
Polygon polygon = (Polygon) geometry;
validatePolygon(polygon, polygon);
break;
case MULTIPOINT:
TestCase.assertTrue(geometry instanceof MultiPoint);
MultiPoint multiPoint = (MultiPoint) geometry;
validateMultiPoint(multiPoint, multiPoint);
break;
case MULTILINESTRING:
TestCase.assertTrue(geometry instanceof MultiLineString);
MultiLineString multiLineString = (MultiLineString) geometry;
validateMultiLineString(multiLineString, multiLineString);
break;
case MULTIPOLYGON:
TestCase.assertTrue(geometry instanceof MultiPolygon);
MultiPolygon multiPolygon = (MultiPolygon) geometry;
validateMultiPolygon(multiPolygon, multiPolygon);
break;
case GEOMETRYCOLLECTION:
TestCase.assertTrue(geometry instanceof GeometryCollection);
GeometryCollection<?> geometryCollection = (GeometryCollection<?>) geometry;
validateGeometryCollection(geometryCollection, geometryCollection);
break;
default:
}
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:50,代码来源:FeatureUtils.java
示例18: buildEnvelope
import mil.nga.wkb.geom.MultiPoint; //导入依赖的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
示例19: getGeometryString
import mil.nga.wkb.geom.MultiPoint; //导入依赖的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
示例20: getJSONCompatibleGeometry
import mil.nga.wkb.geom.MultiPoint; //导入依赖的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
注:本文中的mil.nga.wkb.geom.MultiPoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论