本文整理了Java中com.esri.core.geometry.Point.getZ()
方法的一些代码示例,展示了Point.getZ()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.getZ()
方法的具体详情如下:
包路径:com.esri.core.geometry.Point
类名称:Point
方法名:getZ
[英]Returns the Z coordinate of this point.
[中]返回该点的Z坐标。
代码示例来源:origin: Esri/geometry-api-java
public double Z() {
return point.getZ();
}
代码示例来源:origin: com.esri.geometry/esri-geometry-api
public double Z() {
return point.getZ();
}
代码示例来源:origin: org.apache.sis.core/sis-feature
/**
* If the given point is an implementation of this library, returns its coordinate.
* Otherwise returns {@code null}. If non-null, the returned array may have a length of 2 or 3.
*/
@Override
final double[] tryGetCoordinate(final Object point) {
if (point instanceof Point) {
final Point pt = (Point) point;
final double z = pt.getZ();
final double[] coord;
if (Double.isNaN(z)) {
coord = new double[2];
} else {
coord = new double[3];
coord[2] = z;
}
coord[1] = pt.getY();
coord[0] = pt.getX();
return coord;
}
return null;
}
代码示例来源:origin: apache/sis
/**
* If the given point is an implementation of this library, returns its coordinate.
* Otherwise returns {@code null}. If non-null, the returned array may have a length of 2 or 3.
*/
@Override
final double[] tryGetCoordinate(final Object point) {
if (point instanceof Point) {
final Point pt = (Point) point;
final double z = pt.getZ();
final double[] coord;
if (Double.isNaN(z)) {
coord = new double[2];
} else {
coord = new double[3];
coord[2] = z;
}
coord[1] = pt.getY();
coord[0] = pt.getX();
return coord;
} else if (point instanceof Point2D) {
final Point2D pt = (Point2D) point;
return new double[] {pt.x, pt.y};
} else if (point instanceof Point3D) {
final Point3D pt = (Point3D) point;
return new double[] {pt.x, pt.y, pt.z};
}
return null;
}
代码示例来源:origin: Esri/geometry-api-java
double z = point.getZ();
wkbBuffer.putDouble(offset, z);
offset += 8;
代码示例来源:origin: com.esri.geometry/esri-geometry-api
double z = point.getZ();
wkbBuffer.putDouble(offset, z);
offset += 8;
代码示例来源:origin: Qihoo360/Quicksql
/** Returns the z-value of the first coordinate of {@code geom}. */
public static Double ST_Z(Geom geom) {
return geom.g().getDescription().hasZ() && geom.g() instanceof Point
? ((Point) geom.g()).getZ() : null;
}
代码示例来源:origin: org.apache.calcite/calcite-core
/** Returns the z-value of the first coordinate of {@code geom}. */
public static Double ST_Z(Geom geom) {
return geom.g().getDescription().hasZ() && geom.g() instanceof Point
? ((Point) geom.g()).getZ() : null;
}
代码示例来源:origin: Esri/geometry-api-java
double z = !bEmpty ? point.getZ() : NumberUtils.NaN();
shapeBuffer.putDouble(offset,
bArcViewNaNs ? Interop.translateToAVNaN(z) : z);
代码示例来源:origin: com.esri.geometry/esri-geometry-api
double z = !bEmpty ? point.getZ() : NumberUtils.NaN();
shapeBuffer.putDouble(offset,
bArcViewNaNs ? Interop.translateToAVNaN(z) : z);
代码示例来源:origin: Esri/geometry-api-java
private static void exportPointToGeoJson_(int export_flags, Point point, JsonWriter json_writer) {
int precision = 17 - (31 & (export_flags >> 13));
boolean bFixedPoint = (GeoJsonExportFlags.geoJsonExportPrecisionFixedPoint & export_flags) != 0;
boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
&& (export_flags & GeoJsonExportFlags.geoJsonExportStripZs) == 0;
boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
&& (export_flags & GeoJsonExportFlags.geoJsonExportStripMs) == 0;
if (!b_export_zs && b_export_ms)
throw new IllegalArgumentException("invalid argument");
double x = NumberUtils.NaN();
double y = NumberUtils.NaN();
double z = NumberUtils.NaN();
double m = NumberUtils.NaN();
if (!point.isEmpty()) {
x = point.getX();
y = point.getY();
if (b_export_zs)
z = point.getZ();
if (b_export_ms)
m = point.getM();
}
if ((export_flags & GeoJsonExportFlags.geoJsonExportPreferMultiGeometry) == 0)
pointTaggedText_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
else
multiPointTaggedTextFromPoint_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
}
代码示例来源:origin: Esri/geometry-api-java
static void exportPointToWkt(int export_flags, Point point,
StringBuilder string) {
int precision = 17 - (7 & (export_flags >> 13));
boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
&& (export_flags & WktExportFlags.wktExportStripZs) == 0;
boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
&& (export_flags & WktExportFlags.wktExportStripMs) == 0;
double x = NumberUtils.TheNaN;
double y = NumberUtils.TheNaN;
double z = NumberUtils.TheNaN;
double m = NumberUtils.TheNaN;
if (!point.isEmpty()) {
x = point.getX();
y = point.getY();
if (b_export_zs)
z = point.getZ();
if (b_export_ms)
m = point.getM();
}
if ((export_flags & WktExportFlags.wktExportMultiPoint) != 0) {
multiPointTaggedTextFromPoint_(precision, b_export_zs, b_export_ms,
x, y, z, m, string);
} else {
pointTaggedText_(precision, b_export_zs, b_export_ms, x, y, z, m,
string);
}
}
代码示例来源:origin: com.esri.geometry/esri-geometry-api
static void exportPointToWkt(int export_flags, Point point,
StringBuilder string) {
int precision = 17 - (7 & (export_flags >> 13));
boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
&& (export_flags & WktExportFlags.wktExportStripZs) == 0;
boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
&& (export_flags & WktExportFlags.wktExportStripMs) == 0;
double x = NumberUtils.TheNaN;
double y = NumberUtils.TheNaN;
double z = NumberUtils.TheNaN;
double m = NumberUtils.TheNaN;
if (!point.isEmpty()) {
x = point.getX();
y = point.getY();
if (b_export_zs)
z = point.getZ();
if (b_export_ms)
m = point.getM();
}
if ((export_flags & WktExportFlags.wktExportMultiPoint) != 0) {
multiPointTaggedTextFromPoint_(precision, b_export_zs, b_export_ms,
x, y, z, m, string);
} else {
pointTaggedText_(precision, b_export_zs, b_export_ms, x, y, z, m,
string);
}
}
代码示例来源:origin: com.esri.geometry/esri-geometry-api
private static void exportPointToGeoJson_(int export_flags, Point point, JsonWriter json_writer) {
int precision = 17 - (31 & (export_flags >> 13));
boolean bFixedPoint = (GeoJsonExportFlags.geoJsonExportPrecisionFixedPoint & export_flags) != 0;
boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
&& (export_flags & GeoJsonExportFlags.geoJsonExportStripZs) == 0;
boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
&& (export_flags & GeoJsonExportFlags.geoJsonExportStripMs) == 0;
if (!b_export_zs && b_export_ms)
throw new IllegalArgumentException("invalid argument");
double x = NumberUtils.NaN();
double y = NumberUtils.NaN();
double z = NumberUtils.NaN();
double m = NumberUtils.NaN();
if (!point.isEmpty()) {
x = point.getX();
y = point.getY();
if (b_export_zs)
z = point.getZ();
if (b_export_ms)
m = point.getM();
}
if ((export_flags & GeoJsonExportFlags.geoJsonExportPreferMultiGeometry) == 0)
pointTaggedText_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
else
multiPointTaggedTextFromPoint_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
}
代码示例来源:origin: Esri/geometry-api-java
jsonWriter.addPairDouble("z", pt.getZ());
代码示例来源:origin: com.esri.geometry/esri-geometry-api
jsonWriter.addPairDouble("z", pt.getZ());
内容来源于网络,如有侵权,请联系作者删除!