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); } }
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;
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;
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); } }
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); } }
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); } }
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); } }
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); } }
/** * 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; }
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;
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;
/** * 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; }
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); }
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); }
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);
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);
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); }
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); }
int comp = VertexDescription.getComponentCount(semantics); if (pt.hasAttribute(semantics)) { m_vertexAttributes[iattr].insertAttributes(comp
int comp = VertexDescription.getComponentCount(semantics); if (pt.hasAttribute(semantics)) { m_vertexAttributes[iattr].insertAttributes(comp