com.esri.core.geometry.Point point = vertexGeom.getPoint(i); result = transform.transform(new org.osgeo.proj4j.ProjCoordinate(point.getX(), point.getY()), result); point.setXY(result.x, result.y); vertexGeom.setPoint(i, point);
public void startPath(Point2D point) { _initPathStartPoint(); m_moveToPoint.setXY(point); m_bPathStarted = true; }
/** * Sets the XY coordinates of this point. param pt The point to create the X * and Y coordinate from. */ public final void setXY(Point2D pt) { _touch(); setXY(pt.x, pt.y); }
public Point(Point2D pt) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); setXY(pt); }
public void startPath(Point2D point) { _initPathStartPoint(); m_moveToPoint.setXY(point); m_bPathStarted = true; }
/** * Sets the XY coordinates of this point. param pt The point to create the X * and Y coordinate from. */ public final void setXY(Point2D pt) { _touch(); setXY(pt.x, pt.y); }
public Point(Point2D pt) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); setXY(pt); }
/** * Creates a 2D Point with specified X and Y coordinates. In case of * Geographic Coordinate Systems, the X coordinate is the longitude and the * Y is the latitude. * * @param x * The X coordinate of the new 2D point. * @param y * The Y coordinate of the new 2D point. */ public Point(double x, double y) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); setXY(x, y); } public Point(Point2D pt) {
/** * Creates a 2D Point with specified X and Y coordinates. In case of * Geographic Coordinate Systems, the X coordinate is the longitude and the * Y is the latitude. * * @param x * The X coordinate of the new 2D point. * @param y * The Y coordinate of the new 2D point. */ public Point(double x, double y) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); setXY(x, y); } public Point(Point2D pt) {
@Override public void applyTransformation(Transformation2D transform) { if (isEmptyImpl()) return; Point2D pt = getXY(); transform.transform(pt, pt); setXY(pt); }
@Override public void applyTransformation(Transformation2D transform) { if (isEmptyImpl()) return; Point2D pt = getXY(); transform.transform(pt, pt); setXY(pt); }
public Object readResolve() throws ObjectStreamException { Point point = null; try { VertexDescription vd = VertexDescriptionDesignerImpl .getVertexDescription(descriptionBitMask); point = new Point(vd); if (attribs != null) { point.setXY(attribs[0], attribs[1]); int index = 2; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { point.setAttribute(semantics, ord, attribs[index++]); } } } } catch (Exception ex) { throw new InvalidObjectException("Cannot read geometry from stream"); } return point; }
public Object readResolve() throws ObjectStreamException { Point point = null; try { VertexDescription vd = VertexDescriptionDesignerImpl .getVertexDescription(descriptionBitMask); point = new Point(vd); if (attribs != null) { point.setXY(attribs[0], attribs[1]); int index = 2; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { point.setAttribute(semantics, ord, attribs[index++]); } } } } catch (Exception ex) { throw new InvalidObjectException("Cannot read geometry from stream"); } return point; }
void queryCoord(double t, Point point) { point.assignVertexDescription(m_description); point.setXY(getCoord2D(t)); for (int iattrib = 1, nattrib = m_description.getAttributeCount(); iattrib < nattrib; iattrib++) { int semantics = m_description._getSemanticsImpl(iattrib); int ncomp = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomp; iord++) { double value = getAttributeAsDbl(t, semantics, iord); point.setAttribute(semantics, iord, value); } } }
void queryCoord(double t, Point point) { point.assignVertexDescription(m_description); point.setXY(getCoord2D(t)); for (int iattrib = 1, nattrib = m_description.getAttributeCount(); iattrib < nattrib; iattrib++) { int semantics = m_description._getSemanticsImpl(iattrib); int ncomp = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomp; iord++) { double value = getAttributeAsDbl(t, semantics, iord); point.setAttribute(semantics, iord, value); } } }
public void getCenter(Point point_out) { point_out.assignVertexDescription(m_description); if (isEmpty()) { point_out.setEmpty(); return; } int nattrib = m_description.getAttributeCount(); for (int i = 1; i < nattrib; i++) { int semantics = m_description.getSemantics(i); int ncomp = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomp; iord++) { double v = 0.5 * (getAttributeAsDblImpl_(0, semantics, iord) + getAttributeAsDblImpl_( 1, semantics, iord)); point_out.setAttribute(semantics, iord, v); } } point_out.setXY(m_envelope.getCenter()); }
public void getCenter(Point point_out) { point_out.assignVertexDescription(m_description); if (isEmpty()) { point_out.setEmpty(); return; } int nattrib = m_description.getAttributeCount(); for (int i = 1; i < nattrib; i++) { int semantics = m_description.getSemantics(i); int ncomp = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomp; iord++) { double v = 0.5 * (getAttributeAsDblImpl_(0, semantics, iord) + getAttributeAsDblImpl_( 1, semantics, iord)); point_out.setAttribute(semantics, iord, v); } } point_out.setXY(m_envelope.getCenter()); }
/** * Returns the center point of the envelope. * * @return The center point of the envelope. */ public Point getCenter() { Point pointOut = new Point(m_description); if (isEmpty()) { return pointOut; } int nattrib = m_description.getAttributeCount(); for (int i = 1; i < nattrib; i++) { int semantics = m_description._getSemanticsImpl(i); int ncomp = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomp; iord++) { double v = 0.5 * (_getAttributeAsDbl(0, semantics, iord) + _getAttributeAsDbl( 1, semantics, iord)); pointOut.setAttribute(semantics, iord, v); } } pointOut.setXY(m_envelope.getCenterX(), m_envelope.getCenterY()); return pointOut; }
private Geometry bufferPolyline_() { if (isDegenerateGeometry_(m_geometry)) { Point point = new Point(); ((MultiVertexGeometry) m_geometry).getPointByVal(0, point); Envelope2D env2D = new Envelope2D(); m_geometry.queryEnvelope2D(env2D); point.setXY(env2D.getCenter()); return bufferPoint_(point); } assert (m_distance > 0); Polyline poly = (Polyline)m_geometry; m_geometry = null; GeometryCursor glueing_cursor = new GlueingCursorForPolyline(poly);//glues paths together if they connect at one point poly = null; GeometryCursor generalized_paths = OperatorGeneralize.local().execute(glueing_cursor, m_densify_dist * 0.25, false, m_progress_tracker); GeometryCursor simple_paths = OperatorSimplifyOGC.local().execute(generalized_paths, null, true, m_progress_tracker);//make a planar graph. generalized_paths = null; GeometryCursor path_buffering_cursor = new GeometryCursorForPolyline(this, simple_paths, m_bfilter); simple_paths = null; GeometryCursor union_cursor = OperatorUnion.local().execute(path_buffering_cursor, m_spatialReference, m_progress_tracker);//(int)Operator_union::Options::enum_disable_edge_dissolver Geometry result = union_cursor.next(); return result; }
private Geometry bufferPolyline_() { if (isDegenerateGeometry_(m_geometry)) { Point point = new Point(); ((MultiVertexGeometry) m_geometry).getPointByVal(0, point); Envelope2D env2D = new Envelope2D(); m_geometry.queryEnvelope2D(env2D); point.setXY(env2D.getCenter()); return bufferPoint_(point); } assert (m_distance > 0); Polyline poly = (Polyline)m_geometry; m_geometry = null; GeometryCursor glueing_cursor = new GlueingCursorForPolyline(poly);//glues paths together if they connect at one point poly = null; GeometryCursor generalized_paths = OperatorGeneralize.local().execute(glueing_cursor, m_densify_dist * 0.25, false, m_progress_tracker); GeometryCursor simple_paths = OperatorSimplifyOGC.local().execute(generalized_paths, null, true, m_progress_tracker);//make a planar graph. generalized_paths = null; GeometryCursor path_buffering_cursor = new GeometryCursorForPolyline(this, simple_paths, m_bfilter); simple_paths = null; GeometryCursor union_cursor = OperatorUnion.local().execute(path_buffering_cursor, m_spatialReference, m_progress_tracker);//(int)Operator_union::Options::enum_disable_edge_dissolver Geometry result = union_cursor.next(); return result; }