本文整理汇总了Java中mil.nga.wkb.geom.Point.hasZ方法的典型用法代码示例。如果您正苦于以下问题:Java Point.hasZ方法的具体用法?Java Point.hasZ怎么用?Java Point.hasZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.wkb.geom.Point
的用法示例。
在下文中一共展示了Point.hasZ方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toPolyline
import mil.nga.wkb.geom.Point; //导入方法依赖的package包/类
/**
* Convert a {@link LineString} to a {@link PolylineOptions}
*
* @param lineString
* @return
*/
public PolylineOptions toPolyline(LineString lineString) {
PolylineOptions polylineOptions = new PolylineOptions();
Double z = null;
// Try to simplify the number of points in the line string
List<Point> points = simplifyPoints(lineString.getPoints());
for (Point point : points) {
LatLng latLng = toLatLng(point);
polylineOptions.add(latLng);
if (point.hasZ()) {
z = (z == null) ? point.getZ() : Math.max(z, point.getZ());
}
}
if (lineString.hasZ() && z != null) {
polylineOptions.zIndex(z.floatValue());
}
return polylineOptions;
}
示例2: updatePoint
import mil.nga.wkb.geom.Point; //导入方法依赖的package包/类
/**
* Update a point
*
* @param point
*/
private static void updatePoint(Point point) {
point.setX(POINT_UPDATED_X);
point.setY(POINT_UPDATED_Y);
if (point.hasZ()) {
point.setZ(POINT_UPDATED_Z);
}
if (point.hasM()) {
point.setM(POINT_UPDATED_M);
}
}
示例3: validateUpdatedPoint
import mil.nga.wkb.geom.Point; //导入方法依赖的package包/类
/**
* Validate an updated point
*
* @param point
*/
private static void validateUpdatedPoint(Point point) {
TestCase.assertEquals(POINT_UPDATED_X, point.getX());
TestCase.assertEquals(POINT_UPDATED_Y, point.getY());
if (point.hasZ()) {
TestCase.assertEquals(POINT_UPDATED_Z, point.getZ());
}
if (point.hasM()) {
TestCase.assertEquals(POINT_UPDATED_M, point.getM());
}
}
示例4: getPoint
import mil.nga.wkb.geom.Point; //导入方法依赖的package包/类
/**
* Get Point object
*
* @param point
* @return point object
*/
private static Object getPoint(Point point) {
Map<String, Double> jsonObject = new HashMap<>();
jsonObject.put("x", point.getX());
jsonObject.put("y", point.getY());
if (point.hasZ()) {
jsonObject.put("z", point.getZ());
}
if (point.hasM()) {
jsonObject.put("m", point.getM());
}
return jsonObject;
}
示例5: writePoint
import mil.nga.wkb.geom.Point; //导入方法依赖的package包/类
/**
* Write a Point
*
* @param writer
* @param point
* @throws IOException
*/
public static void writePoint(ByteWriter writer, Point point)
throws IOException {
writer.writeDouble(point.getX());
writer.writeDouble(point.getY());
if (point.hasZ()) {
writer.writeDouble(point.getZ());
}
if (point.hasM()) {
writer.writeDouble(point.getM());
}
}
示例6: addPointMessage
import mil.nga.wkb.geom.Point; //导入方法依赖的package包/类
/**
* Add Point
*
* @param envelope
* @param point
*/
private static void addPointMessage(GeometryEnvelope envelope, Point point) {
updateHasZandM(envelope, point);
double x = point.getX();
double y = point.getY();
if (x < envelope.getMinX()) {
envelope.setMinX(x);
}
if (x > envelope.getMaxX()) {
envelope.setMaxX(x);
}
if (y < envelope.getMinY()) {
envelope.setMinY(y);
}
if (y > envelope.getMaxY()) {
envelope.setMaxY(y);
}
if (point.hasZ()) {
Double z = point.getZ();
if (z != null) {
if (envelope.getMinZ() == null || z < envelope.getMinZ()) {
envelope.setMinZ(z);
}
if (envelope.getMaxZ() == null || z > envelope.getMaxZ()) {
envelope.setMaxZ(z);
}
}
}
if (point.hasM()) {
Double m = point.getM();
if (m != null) {
if (envelope.getMinM() == null || m < envelope.getMinM()) {
envelope.setMinM(m);
}
if (envelope.getMaxM() == null || m > envelope.getMaxM()) {
envelope.setMaxM(m);
}
}
}
}