com.esri.core.geometry.Point.hasAttribute()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(13.0k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中com.esri.core.geometry.Point.hasAttribute()方法的一些代码示例,展示了Point.hasAttribute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.hasAttribute()方法的具体详情如下:
包路径:com.esri.core.geometry.Point
类名称:Point
方法名:hasAttribute

Point.hasAttribute介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
{
  Geometry esriGeometry = geometry.getEsriGeometry();
  verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  Point point = (Point) esriGeometry;
  verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
          !point.hasAttribute(VertexDescription.Semantics.M) &&
          !point.hasAttribute(VertexDescription.Semantics.ID),
      "Only 2D points with no ID nor M attribute are supported");
  output.appendByte(GeometrySerializationType.POINT.code());
  if (!point.isEmpty()) {
    output.appendDouble(point.getX());
    output.appendDouble(point.getY());
  }
  else {
    output.appendDouble(NaN);
    output.appendDouble(NaN);
  }
}

代码示例来源:origin: Esri/geometry-api-java

private static int exportPointToWKB(int exportFlags, Point point,
    ByteBuffer wkbBuffer) {
  boolean bExportZs = point.hasAttribute(VertexDescription.Semantics.Z)
      && (exportFlags & WkbExportFlags.wkbExportStripZs) == 0;
  boolean bExportMs = point.hasAttribute(VertexDescription.Semantics.M)
      && (exportFlags & WkbExportFlags.wkbExportStripMs) == 0;

代码示例来源:origin: com.esri.geometry/esri-geometry-api

private static int exportPointToWKB(int exportFlags, Point point,
    ByteBuffer wkbBuffer) {
  boolean bExportZs = point.hasAttribute(VertexDescription.Semantics.Z)
      && (exportFlags & WkbExportFlags.wkbExportStripZs) == 0;
  boolean bExportMs = point.hasAttribute(VertexDescription.Semantics.M)
      && (exportFlags & WkbExportFlags.wkbExportStripMs) == 0;

代码示例来源: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.facebook.presto/presto-geospatial-toolkit

private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
{
  Geometry esriGeometry = geometry.getEsriGeometry();
  verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  Point point = (Point) esriGeometry;
  verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
          !point.hasAttribute(VertexDescription.Semantics.M) &&
          !point.hasAttribute(VertexDescription.Semantics.ID),
      "Only 2D points with no ID nor M attribute are supported");
  output.appendByte(GeometrySerializationType.POINT.code());
  if (!point.isEmpty()) {
    output.appendDouble(point.getX());
    output.appendDouble(point.getY());
  }
  else {
    output.appendDouble(NaN);
    output.appendDouble(NaN);
  }
}

代码示例来源:origin: io.prestosql/presto-geospatial-toolkit

private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
{
  Geometry esriGeometry = geometry.getEsriGeometry();
  verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  Point point = (Point) esriGeometry;
  verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
          !point.hasAttribute(VertexDescription.Semantics.M) &&
          !point.hasAttribute(VertexDescription.Semantics.ID),
      "Only 2D points with no ID nor M attribute are supported");
  output.appendByte(GeometrySerializationType.POINT.code());
  if (!point.isEmpty()) {
    output.appendDouble(point.getX());
    output.appendDouble(point.getY());
  }
  else {
    output.appendDouble(NaN);
    output.appendDouble(NaN);
  }
}

代码示例来源:origin: prestosql/presto

private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
{
  Geometry esriGeometry = geometry.getEsriGeometry();
  verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  Point point = (Point) esriGeometry;
  verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
          !point.hasAttribute(VertexDescription.Semantics.M) &&
          !point.hasAttribute(VertexDescription.Semantics.ID),
      "Only 2D points with no ID nor M attribute are supported");
  output.appendByte(GeometrySerializationType.POINT.code());
  if (!point.isEmpty()) {
    output.appendDouble(point.getX());
    output.appendDouble(point.getY());
  }
  else {
    output.appendDouble(NaN);
    output.appendDouble(NaN);
  }
}

代码示例来源: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: Esri/geometry-api-java

/**
 * Sets the XYZ coordinates of this point.
 * 
 * @param pt
 *            The point to create the XYZ coordinate from.
 */
public void setXYZ(Point3D pt) {
  _touch();
  boolean bHasZ = hasAttribute(Semantics.Z);
  if (!bHasZ && !VertexDescription.isDefaultValue(Semantics.Z, pt.z)) {// add
                                      // Z
                                      // only
                                      // if
                                      // pt.z
                                      // is
                                      // not
                                      // a
                                      // default
                                      // value.
    addAttribute(Semantics.Z);
    bHasZ = true;
  }
  if (m_attributes == null)
    _setToDefault();
  m_attributes[0] = pt.x;
  m_attributes[1] = pt.y;
  if (bHasZ)
    m_attributes[2] = pt.z;
}

代码示例来源:origin: com.esri.geometry/esri-geometry-api

private static int exportPointToESRIShape(int exportFlags, Point point,
    ByteBuffer shapeBuffer) {
  boolean bExportZ = point.hasAttribute(Semantics.Z)
      && (exportFlags & ShapeExportFlags.ShapeExportStripZs) == 0;
  boolean bExportM = point.hasAttribute(Semantics.M)
      && (exportFlags & ShapeExportFlags.ShapeExportStripMs) == 0;
  boolean bExportID = point.hasAttribute(Semantics.ID)
      && (exportFlags & ShapeExportFlags.ShapeExportStripIDs) == 0;
  boolean bArcViewNaNs = (exportFlags & ShapeExportFlags.ShapeExportTrueNaNs) == 0;

代码示例来源:origin: Esri/geometry-api-java

private static int exportPointToESRIShape(int exportFlags, Point point,
    ByteBuffer shapeBuffer) {
  boolean bExportZ = point.hasAttribute(Semantics.Z)
      && (exportFlags & ShapeExportFlags.ShapeExportStripZs) == 0;
  boolean bExportM = point.hasAttribute(Semantics.M)
      && (exportFlags & ShapeExportFlags.ShapeExportStripMs) == 0;
  boolean bExportID = point.hasAttribute(Semantics.ID)
      && (exportFlags & ShapeExportFlags.ShapeExportStripIDs) == 0;
  boolean bArcViewNaNs = (exportFlags & ShapeExportFlags.ShapeExportTrueNaNs) == 0;

代码示例来源:origin: com.esri.geometry/esri-geometry-api

/**
 * Sets the XYZ coordinates of this point.
 * 
 * @param pt
 *            The point to create the XYZ coordinate from.
 */
public void setXYZ(Point3D pt) {
  _touch();
  boolean bHasZ = hasAttribute(Semantics.Z);
  if (!bHasZ && !VertexDescription.isDefaultValue(Semantics.Z, pt.z)) {// add
                                      // Z
                                      // only
                                      // if
                                      // pt.z
                                      // is
                                      // not
                                      // a
                                      // default
                                      // value.
    addAttribute(Semantics.Z);
    bHasZ = true;
  }
  if (m_attributes == null)
    _setToDefault();
  m_attributes[0] = pt.x;
  m_attributes[1] = pt.y;
  if (bHasZ)
    m_attributes[2] = pt.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: 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

private static void exportPointToJson(Point pt, SpatialReference spatialReference, JsonWriter jsonWriter, Map<String, Object> exportProperties) {
  boolean bExportZs = pt.hasAttribute(Semantics.Z);
  boolean bExportMs = pt.hasAttribute(Semantics.M);

代码示例来源:origin: com.esri.geometry/esri-geometry-api

private static void exportPointToJson(Point pt, SpatialReference spatialReference, JsonWriter jsonWriter, Map<String, Object> exportProperties) {
  boolean bExportZs = pt.hasAttribute(Semantics.Z);
  boolean bExportMs = pt.hasAttribute(Semantics.M);

代码示例来源:origin: Esri/geometry-api-java

public void insertPoint(int beforePointIndex, Point pt) {
  if (beforePointIndex > getPointCount())
    throw new GeometryException("index out of bounds");
  if (beforePointIndex < 0)
    beforePointIndex = getPointCount();
  mergeVertexDescription(pt.getDescription());
  int oldPointCount = m_pointCount;
  _resizeImpl(m_pointCount + 1);
  _verifyAllStreams();
  for (int iattr = 0, nattr = m_description.getAttributeCount(); iattr < nattr; iattr++) {
    int semantics = m_description._getSemanticsImpl(iattr);
    int comp = VertexDescription.getComponentCount(semantics);
    AttributeStreamBase stream = AttributeStreamBase
        .createAttributeStreamWithSemantics(semantics, 1);
    if (pt.hasAttribute(semantics)) {
      m_vertexAttributes[iattr]
          .insertAttributes(comp * beforePointIndex, pt,
              semantics, comp * oldPointCount);
    } else {
      // Need to make room for the attribute, so we copy a default
      // value in
      double v = VertexDescription.getDefaultValue(semantics);
      m_vertexAttributes[iattr].insertRange(comp * beforePointIndex,
          v, comp, comp * oldPointCount);
    }
  }
  notifyModified(DirtyFlags.DirtyCoordinates);
}

代码示例来源:origin: com.esri.geometry/esri-geometry-api

public void insertPoint(int beforePointIndex, Point pt) {
  if (beforePointIndex > getPointCount())
    throw new GeometryException("index out of bounds");
  if (beforePointIndex < 0)
    beforePointIndex = getPointCount();
  mergeVertexDescription(pt.getDescription());
  int oldPointCount = m_pointCount;
  _resizeImpl(m_pointCount + 1);
  _verifyAllStreams();
  for (int iattr = 0, nattr = m_description.getAttributeCount(); iattr < nattr; iattr++) {
    int semantics = m_description._getSemanticsImpl(iattr);
    int comp = VertexDescription.getComponentCount(semantics);
    AttributeStreamBase stream = AttributeStreamBase
        .createAttributeStreamWithSemantics(semantics, 1);
    if (pt.hasAttribute(semantics)) {
      m_vertexAttributes[iattr]
          .insertAttributes(comp * beforePointIndex, pt,
              semantics, comp * oldPointCount);
    } else {
      // Need to make room for the attribute, so we copy a default
      // value in
      double v = VertexDescription.getDefaultValue(semantics);
      m_vertexAttributes[iattr].insertRange(comp * beforePointIndex,
          v, comp, comp * oldPointCount);
    }
  }
  notifyModified(DirtyFlags.DirtyCoordinates);
}

代码示例来源:origin: Esri/geometry-api-java

int comp = VertexDescription.getComponentCount(semantics);
if (pt.hasAttribute(semantics)) {
  m_vertexAttributes[iattr].insertAttributes(comp

代码示例来源:origin: com.esri.geometry/esri-geometry-api

int comp = VertexDescription.getComponentCount(semantics);
if (pt.hasAttribute(semantics)) {
  m_vertexAttributes[iattr].insertAttributes(comp

相关文章