@Override public DirectPosition getRepresentativePoint() { // Use start point of Boundary as representative point return this.startPoint.getPosition(); }
private String pointCoordToString(Point p) { return this.directPositionToString(p.getPosition()); }
/** * Adds the point(s) defined by a Geometry to the centroid total. If the * geometry is not of dimension 0 it does not contribute to the centroid. * * @param geom * the geometry to add */ public void add(GeometryImpl geom) { if (geom instanceof PointImpl) { this.add(((PointImpl)geom).getPosition()); } else if (geom instanceof MultiPointImpl) { Iterator<Point> points = ((MultiPointImpl) geom).getElements().iterator(); while (points.hasNext()) { this.add((DirectPositionImpl) points.next().getPosition()); } } else if (geom instanceof CompositePointImpl) { this.add((DirectPositionImpl) ((CompositePointImpl)geom).getGenerators().get(0)); } }
public EnvelopeImpl getEnvelope() { // TODO Test /* Build Envelope with StartPoint */ // EnvelopeImpl tmpEnv = new EnvelopeImpl(this.startPoint.getPosition(), this.startPoint.getPosition()); EnvelopeImpl tmpEnv = new EnvelopeImpl(this.startPoint.getEnvelope()); /* Extend Envelope with EndPoint */ tmpEnv.expand(this.endPoint.getPosition().getCoordinates()); return tmpEnv; }