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 Point difference(Point point, Point point2, double tolerance) { if (point.isEmpty()) return (Point) point.createInstance(); if (point2.isEmpty()) return point; if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point, point2)) { return (Point) point.createInstance(); } return point; }
static Point difference(Point point, Point point2, double tolerance) { if (point.isEmpty()) return (Point) point.createInstance(); if (point2.isEmpty()) return point; if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point, point2)) { return (Point) point.createInstance(); } return point; }
public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint, double tolerance) { if (inputPoint.isEmpty()) return 0; return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance); }
static Point intersection(Point point, Point point2, double tolerance) { if (point.isEmpty() || point2.isEmpty()) return (Point) point.createInstance(); if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point, point2)) { return CrackAndCluster.cluster_non_empty_points(point, point2, 1, 1, 1, 1); } return (Point) point.createInstance(); }
static Point intersection(Point point, Point point2, double tolerance) { if (point.isEmpty() || point2.isEmpty()) return (Point) point.createInstance(); if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point, point2)) { return CrackAndCluster.cluster_non_empty_points(point, point2, 1, 1, 1, 1); } return (Point) point.createInstance(); }
public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint, double tolerance) { if (inputPoint.isEmpty()) return 0; return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance); }
/** * Checks if this envelope contains (covers) the specified point. * * @param p * The Point to be tested for coverage. * @return TRUE if this envelope contains (covers) the specified point. */ public boolean contains(Point p) { if (p.isEmpty()) return false; return m_envelope.contains(p.getX(), p.getY()); }
public void startPath(Point point) { if (point.isEmpty()) throw new IllegalArgumentException();// throw new // IllegalArgumentException(); mergeVertexDescription(point.getDescription()); _initPathStartPoint(); point.copyTo(m_moveToPoint); // TODO check MultiPathImpl.cpp comment // "//the description will be merged later" // assignVertexDescription(m_moveToPoint.getDescription()); m_bPathStarted = true; }
public void startPath(Point point) { if (point.isEmpty()) throw new IllegalArgumentException();// throw new // IllegalArgumentException(); mergeVertexDescription(point.getDescription()); _initPathStartPoint(); point.copyTo(m_moveToPoint); // TODO check MultiPathImpl.cpp comment // "//the description will be merged later" // assignVertexDescription(m_moveToPoint.getDescription()); m_bPathStarted = true; }
@Override public void replaceNaNs(int semantics, double value) { addAttribute(semantics); if (isEmpty()) return; int ncomps = VertexDescription.getComponentCount(semantics); for (int i = 0; i < ncomps; i++) { double v = getAttributeAsDbl(semantics, i); if (Double.isNaN(v)) setAttribute(semantics, i, value); } } }
/** * Constructs an envelope that covers the given point. The coordinates of * the point are used to set the extent of the envelope. * * @param point The point that the envelope covers. */ public Envelope(Point point) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); m_envelope.setEmpty(); if (point.isEmpty()) return; _setFromPoint(point); }
/** * Checks if this envelope contains (covers) the specified point. * * @param p * The Point to be tested for coverage. * @return TRUE if this envelope contains (covers) the specified point. */ public boolean contains(Point p) { if (p.isEmpty()) return false; return m_envelope.contains(p.getX(), p.getY()); }
/** * Constructs an envelope that covers the given point. The coordinates of * the point are used to set the extent of the envelope. * * @param point The point that the envelope covers. */ public Envelope(Point point) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); m_envelope.setEmpty(); if (point.isEmpty()) return; _setFromPoint(point); }
@Override public void replaceNaNs(int semantics, double value) { addAttribute(semantics); if (isEmpty()) return; int ncomps = VertexDescription.getComponentCount(semantics); for (int i = 0; i < ncomps; i++) { double v = getAttributeAsDbl(semantics, i); if (Double.isNaN(v)) setAttribute(semantics, i, value); } } }
/** * Creates an envelope by defining its center, width, and height. * * @param center * The center point of the envelope. * @param width * The width of the envelope. * @param height * The height of the envelope. */ public Envelope(Point center, double width, double height) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); m_envelope.setEmpty(); if (center.isEmpty()) return; _setFromPoint(center, width, height); }
/** * Sets the envelope's corners to be centered around the specified point, * using its center, width, and height. * * @param c * The point around which to center the envelope. * @param w * The width to be set for the envelope. * @param h * The height to be set for this envelope. */ public void centerAt(Point c, double w, double h) { _touch(); if (c.isEmpty()) { setEmpty(); return; } _setFromPoint(c, w, h); }
/** * Centers the envelope around the specified point preserving the envelope's * width and height. * * @param c * The new center point. */ public void centerAt(Point c) { _touch(); if (c.isEmpty()) { setEmpty(); return; } m_envelope.centerAt(c.getX(), c.getY()); }
/** * Centers the envelope around the specified point preserving the envelope's * width and height. * * @param c * The new center point. */ public void centerAt(Point c) { _touch(); if (c.isEmpty()) { setEmpty(); return; } m_envelope.centerAt(c.getX(), c.getY()); }
@Override public void setPointByVal(int index, Point src) { if (index < 0 || index >= m_pointCount) throw new GeometryException("index out of bounds"); Point point = src; if (src.isEmpty())// can not assign an empty point to a multipoint // vertex throw new IllegalArgumentException(); _verifyAllStreams();// verify all allocated streams are of necessary // size. VertexDescription vdin = point.getDescription(); for (int attributeIndex = 0; attributeIndex < vdin.getAttributeCount(); attributeIndex++) { int semantics = vdin._getSemanticsImpl(attributeIndex); int ncomp = VertexDescription.getComponentCount(semantics); for (int icomp = 0; icomp < ncomp; icomp++) { double v = point.getAttributeAsDbl(semantics, icomp); setAttribute(semantics, index, icomp, v); } } }