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

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

本文整理了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

  1. private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
  2. {
  3. Geometry esriGeometry = geometry.getEsriGeometry();
  4. verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  5. Point point = (Point) esriGeometry;
  6. verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
  7. !point.hasAttribute(VertexDescription.Semantics.M) &&
  8. !point.hasAttribute(VertexDescription.Semantics.ID),
  9. "Only 2D points with no ID nor M attribute are supported");
  10. output.appendByte(GeometrySerializationType.POINT.code());
  11. if (!point.isEmpty()) {
  12. output.appendDouble(point.getX());
  13. output.appendDouble(point.getY());
  14. }
  15. else {
  16. output.appendDouble(NaN);
  17. output.appendDouble(NaN);
  18. }
  19. }

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

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

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

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

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

  1. static void exportPointToWkt(int export_flags, Point point,
  2. StringBuilder string) {
  3. int precision = 17 - (7 & (export_flags >> 13));
  4. boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
  5. && (export_flags & WktExportFlags.wktExportStripZs) == 0;
  6. boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
  7. && (export_flags & WktExportFlags.wktExportStripMs) == 0;
  8. double x = NumberUtils.TheNaN;
  9. double y = NumberUtils.TheNaN;
  10. double z = NumberUtils.TheNaN;
  11. double m = NumberUtils.TheNaN;
  12. if (!point.isEmpty()) {
  13. x = point.getX();
  14. y = point.getY();
  15. if (b_export_zs)
  16. z = point.getZ();
  17. if (b_export_ms)
  18. m = point.getM();
  19. }
  20. if ((export_flags & WktExportFlags.wktExportMultiPoint) != 0) {
  21. multiPointTaggedTextFromPoint_(precision, b_export_zs, b_export_ms,
  22. x, y, z, m, string);
  23. } else {
  24. pointTaggedText_(precision, b_export_zs, b_export_ms, x, y, z, m,
  25. string);
  26. }
  27. }

代码示例来源:origin: com.facebook.presto/presto-geospatial-toolkit

  1. private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
  2. {
  3. Geometry esriGeometry = geometry.getEsriGeometry();
  4. verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  5. Point point = (Point) esriGeometry;
  6. verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
  7. !point.hasAttribute(VertexDescription.Semantics.M) &&
  8. !point.hasAttribute(VertexDescription.Semantics.ID),
  9. "Only 2D points with no ID nor M attribute are supported");
  10. output.appendByte(GeometrySerializationType.POINT.code());
  11. if (!point.isEmpty()) {
  12. output.appendDouble(point.getX());
  13. output.appendDouble(point.getY());
  14. }
  15. else {
  16. output.appendDouble(NaN);
  17. output.appendDouble(NaN);
  18. }
  19. }

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

  1. private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
  2. {
  3. Geometry esriGeometry = geometry.getEsriGeometry();
  4. verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  5. Point point = (Point) esriGeometry;
  6. verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
  7. !point.hasAttribute(VertexDescription.Semantics.M) &&
  8. !point.hasAttribute(VertexDescription.Semantics.ID),
  9. "Only 2D points with no ID nor M attribute are supported");
  10. output.appendByte(GeometrySerializationType.POINT.code());
  11. if (!point.isEmpty()) {
  12. output.appendDouble(point.getX());
  13. output.appendDouble(point.getY());
  14. }
  15. else {
  16. output.appendDouble(NaN);
  17. output.appendDouble(NaN);
  18. }
  19. }

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

  1. private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
  2. {
  3. Geometry esriGeometry = geometry.getEsriGeometry();
  4. verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  5. Point point = (Point) esriGeometry;
  6. verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
  7. !point.hasAttribute(VertexDescription.Semantics.M) &&
  8. !point.hasAttribute(VertexDescription.Semantics.ID),
  9. "Only 2D points with no ID nor M attribute are supported");
  10. output.appendByte(GeometrySerializationType.POINT.code());
  11. if (!point.isEmpty()) {
  12. output.appendDouble(point.getX());
  13. output.appendDouble(point.getY());
  14. }
  15. else {
  16. output.appendDouble(NaN);
  17. output.appendDouble(NaN);
  18. }
  19. }

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

  1. static void exportPointToWkt(int export_flags, Point point,
  2. StringBuilder string) {
  3. int precision = 17 - (7 & (export_flags >> 13));
  4. boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
  5. && (export_flags & WktExportFlags.wktExportStripZs) == 0;
  6. boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
  7. && (export_flags & WktExportFlags.wktExportStripMs) == 0;
  8. double x = NumberUtils.TheNaN;
  9. double y = NumberUtils.TheNaN;
  10. double z = NumberUtils.TheNaN;
  11. double m = NumberUtils.TheNaN;
  12. if (!point.isEmpty()) {
  13. x = point.getX();
  14. y = point.getY();
  15. if (b_export_zs)
  16. z = point.getZ();
  17. if (b_export_ms)
  18. m = point.getM();
  19. }
  20. if ((export_flags & WktExportFlags.wktExportMultiPoint) != 0) {
  21. multiPointTaggedTextFromPoint_(precision, b_export_zs, b_export_ms,
  22. x, y, z, m, string);
  23. } else {
  24. pointTaggedText_(precision, b_export_zs, b_export_ms, x, y, z, m,
  25. string);
  26. }
  27. }

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

  1. /**
  2. * Sets the XYZ coordinates of this point.
  3. *
  4. * @param pt
  5. * The point to create the XYZ coordinate from.
  6. */
  7. public void setXYZ(Point3D pt) {
  8. _touch();
  9. boolean bHasZ = hasAttribute(Semantics.Z);
  10. if (!bHasZ && !VertexDescription.isDefaultValue(Semantics.Z, pt.z)) {// add
  11. // Z
  12. // only
  13. // if
  14. // pt.z
  15. // is
  16. // not
  17. // a
  18. // default
  19. // value.
  20. addAttribute(Semantics.Z);
  21. bHasZ = true;
  22. }
  23. if (m_attributes == null)
  24. _setToDefault();
  25. m_attributes[0] = pt.x;
  26. m_attributes[1] = pt.y;
  27. if (bHasZ)
  28. m_attributes[2] = pt.z;
  29. }

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

  1. private static int exportPointToESRIShape(int exportFlags, Point point,
  2. ByteBuffer shapeBuffer) {
  3. boolean bExportZ = point.hasAttribute(Semantics.Z)
  4. && (exportFlags & ShapeExportFlags.ShapeExportStripZs) == 0;
  5. boolean bExportM = point.hasAttribute(Semantics.M)
  6. && (exportFlags & ShapeExportFlags.ShapeExportStripMs) == 0;
  7. boolean bExportID = point.hasAttribute(Semantics.ID)
  8. && (exportFlags & ShapeExportFlags.ShapeExportStripIDs) == 0;
  9. boolean bArcViewNaNs = (exportFlags & ShapeExportFlags.ShapeExportTrueNaNs) == 0;

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

  1. private static int exportPointToESRIShape(int exportFlags, Point point,
  2. ByteBuffer shapeBuffer) {
  3. boolean bExportZ = point.hasAttribute(Semantics.Z)
  4. && (exportFlags & ShapeExportFlags.ShapeExportStripZs) == 0;
  5. boolean bExportM = point.hasAttribute(Semantics.M)
  6. && (exportFlags & ShapeExportFlags.ShapeExportStripMs) == 0;
  7. boolean bExportID = point.hasAttribute(Semantics.ID)
  8. && (exportFlags & ShapeExportFlags.ShapeExportStripIDs) == 0;
  9. boolean bArcViewNaNs = (exportFlags & ShapeExportFlags.ShapeExportTrueNaNs) == 0;

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

  1. /**
  2. * Sets the XYZ coordinates of this point.
  3. *
  4. * @param pt
  5. * The point to create the XYZ coordinate from.
  6. */
  7. public void setXYZ(Point3D pt) {
  8. _touch();
  9. boolean bHasZ = hasAttribute(Semantics.Z);
  10. if (!bHasZ && !VertexDescription.isDefaultValue(Semantics.Z, pt.z)) {// add
  11. // Z
  12. // only
  13. // if
  14. // pt.z
  15. // is
  16. // not
  17. // a
  18. // default
  19. // value.
  20. addAttribute(Semantics.Z);
  21. bHasZ = true;
  22. }
  23. if (m_attributes == null)
  24. _setToDefault();
  25. m_attributes[0] = pt.x;
  26. m_attributes[1] = pt.y;
  27. if (bHasZ)
  28. m_attributes[2] = pt.z;
  29. }

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

  1. private static void exportPointToGeoJson_(int export_flags, Point point, JsonWriter json_writer) {
  2. int precision = 17 - (31 & (export_flags >> 13));
  3. boolean bFixedPoint = (GeoJsonExportFlags.geoJsonExportPrecisionFixedPoint & export_flags) != 0;
  4. boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
  5. && (export_flags & GeoJsonExportFlags.geoJsonExportStripZs) == 0;
  6. boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
  7. && (export_flags & GeoJsonExportFlags.geoJsonExportStripMs) == 0;
  8. if (!b_export_zs && b_export_ms)
  9. throw new IllegalArgumentException("invalid argument");
  10. double x = NumberUtils.NaN();
  11. double y = NumberUtils.NaN();
  12. double z = NumberUtils.NaN();
  13. double m = NumberUtils.NaN();
  14. if (!point.isEmpty()) {
  15. x = point.getX();
  16. y = point.getY();
  17. if (b_export_zs)
  18. z = point.getZ();
  19. if (b_export_ms)
  20. m = point.getM();
  21. }
  22. if ((export_flags & GeoJsonExportFlags.geoJsonExportPreferMultiGeometry) == 0)
  23. pointTaggedText_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
  24. else
  25. multiPointTaggedTextFromPoint_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
  26. }

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

  1. private static void exportPointToGeoJson_(int export_flags, Point point, JsonWriter json_writer) {
  2. int precision = 17 - (31 & (export_flags >> 13));
  3. boolean bFixedPoint = (GeoJsonExportFlags.geoJsonExportPrecisionFixedPoint & export_flags) != 0;
  4. boolean b_export_zs = point.hasAttribute(VertexDescription.Semantics.Z)
  5. && (export_flags & GeoJsonExportFlags.geoJsonExportStripZs) == 0;
  6. boolean b_export_ms = point.hasAttribute(VertexDescription.Semantics.M)
  7. && (export_flags & GeoJsonExportFlags.geoJsonExportStripMs) == 0;
  8. if (!b_export_zs && b_export_ms)
  9. throw new IllegalArgumentException("invalid argument");
  10. double x = NumberUtils.NaN();
  11. double y = NumberUtils.NaN();
  12. double z = NumberUtils.NaN();
  13. double m = NumberUtils.NaN();
  14. if (!point.isEmpty()) {
  15. x = point.getX();
  16. y = point.getY();
  17. if (b_export_zs)
  18. z = point.getZ();
  19. if (b_export_ms)
  20. m = point.getM();
  21. }
  22. if ((export_flags & GeoJsonExportFlags.geoJsonExportPreferMultiGeometry) == 0)
  23. pointTaggedText_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
  24. else
  25. multiPointTaggedTextFromPoint_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
  26. }

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

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

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

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

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

  1. public void insertPoint(int beforePointIndex, Point pt) {
  2. if (beforePointIndex > getPointCount())
  3. throw new GeometryException("index out of bounds");
  4. if (beforePointIndex < 0)
  5. beforePointIndex = getPointCount();
  6. mergeVertexDescription(pt.getDescription());
  7. int oldPointCount = m_pointCount;
  8. _resizeImpl(m_pointCount + 1);
  9. _verifyAllStreams();
  10. for (int iattr = 0, nattr = m_description.getAttributeCount(); iattr < nattr; iattr++) {
  11. int semantics = m_description._getSemanticsImpl(iattr);
  12. int comp = VertexDescription.getComponentCount(semantics);
  13. AttributeStreamBase stream = AttributeStreamBase
  14. .createAttributeStreamWithSemantics(semantics, 1);
  15. if (pt.hasAttribute(semantics)) {
  16. m_vertexAttributes[iattr]
  17. .insertAttributes(comp * beforePointIndex, pt,
  18. semantics, comp * oldPointCount);
  19. } else {
  20. // Need to make room for the attribute, so we copy a default
  21. // value in
  22. double v = VertexDescription.getDefaultValue(semantics);
  23. m_vertexAttributes[iattr].insertRange(comp * beforePointIndex,
  24. v, comp, comp * oldPointCount);
  25. }
  26. }
  27. notifyModified(DirtyFlags.DirtyCoordinates);
  28. }

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

  1. public void insertPoint(int beforePointIndex, Point pt) {
  2. if (beforePointIndex > getPointCount())
  3. throw new GeometryException("index out of bounds");
  4. if (beforePointIndex < 0)
  5. beforePointIndex = getPointCount();
  6. mergeVertexDescription(pt.getDescription());
  7. int oldPointCount = m_pointCount;
  8. _resizeImpl(m_pointCount + 1);
  9. _verifyAllStreams();
  10. for (int iattr = 0, nattr = m_description.getAttributeCount(); iattr < nattr; iattr++) {
  11. int semantics = m_description._getSemanticsImpl(iattr);
  12. int comp = VertexDescription.getComponentCount(semantics);
  13. AttributeStreamBase stream = AttributeStreamBase
  14. .createAttributeStreamWithSemantics(semantics, 1);
  15. if (pt.hasAttribute(semantics)) {
  16. m_vertexAttributes[iattr]
  17. .insertAttributes(comp * beforePointIndex, pt,
  18. semantics, comp * oldPointCount);
  19. } else {
  20. // Need to make room for the attribute, so we copy a default
  21. // value in
  22. double v = VertexDescription.getDefaultValue(semantics);
  23. m_vertexAttributes[iattr].insertRange(comp * beforePointIndex,
  24. v, comp, comp * oldPointCount);
  25. }
  26. }
  27. notifyModified(DirtyFlags.DirtyCoordinates);
  28. }

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

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

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

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

相关文章