double radius = dim.getMinSize() / 2; Coordinate centre = dim.getCentre();
Envelope env = dim.getEnvelope(); double radius = env.getWidth() / 2.0;
Envelope env = dim.getEnvelope(); double radius = env.getWidth() / 2.0;
double radius = dim.getMinSize() / 2; Coordinate centre = dim.getCentre();
int nSide = nPts / 4; if (nSide < 1) nSide = 1; double XsegLen = dim.getEnvelope().getWidth() / nSide; double YsegLen = dim.getEnvelope().getHeight() / nSide; Envelope env = dim.getEnvelope();
Envelope env = dim.getEnvelope(); double xRadius = env.getWidth() / 2.0; double yRadius = env.getHeight() / 2.0;
double angExtent) Envelope env = dim.getEnvelope(); double xRadius = env.getWidth() / 2.0; double yRadius = env.getHeight() / 2.0;
/** * Creates an elliptical {@link Polygon}. * If the supplied envelope is square the * result will be a circle. * * @return an ellipse or circle */ public Polygon createEllipse() { Envelope env = dim.getEnvelope(); double xRadius = env.getWidth() / 2.0; double yRadius = env.getHeight() / 2.0; double centreX = env.getMinX() + xRadius; double centreY = env.getMinY() + yRadius; Coordinate[] pts = new Coordinate[nPts + 1]; int iPt = 0; for (int i = 0; i < nPts; i++) { double ang = i * (2 * Math.PI / nPts); double x = xRadius * Math.cos(ang) + centreX; double y = yRadius * Math.sin(ang) + centreY; pts[iPt++] = coord(x, y); } pts[iPt] = new Coordinate(pts[0]); LinearRing ring = geomFact.createLinearRing(pts); Polygon poly = geomFact.createPolygon(ring, null); return (Polygon) rotate(poly); } /**
public void setEnvelope(Envelope env) { dim.setEnvelope(env); }
/** * Sets the width of the shape. * * @param width the width of the shape */ public void setWidth(double width) { dim.setWidth(width); }
/** * Sets the size of the extent of the shape in both x and y directions. * * @param size the size of the shape's extent */ public void setSize(double size) { dim.setSize(size); }
/** * Sets the height of the shape. * * @param height the height of the shape */ public void setHeight(double height) { dim.setHeight(height); }
/** * Sets the location of the shape by specifying the base coordinate * (which in most cases is the * lower left point of the envelope containing the shape). * * @param base the base coordinate of the shape */ public void setBase(Coordinate base) { dim.setBase(base); } /**
/** * Sets the location of the shape by specifying the centre of * the shape's bounding box * * @param centre the centre coordinate of the shape */ public void setCentre(Coordinate centre) { dim.setCentre(centre); }
int nSide = nPts / 4; if (nSide < 1) nSide = 1; double XsegLen = dim.getEnvelope().getWidth() / nSide; double YsegLen = dim.getEnvelope().getHeight() / nSide; Envelope env = dim.getEnvelope();
double angExtent) Envelope env = dim.getEnvelope(); double xRadius = env.getWidth() / 2.0; double yRadius = env.getHeight() / 2.0;
Envelope env = dim.getEnvelope(); double xRadius = env.getWidth() / 2.0; double yRadius = env.getHeight() / 2.0;
/** * Creates an elliptical {@link Polygon}. * If the supplied envelope is square the * result will be a circle. * * @return an ellipse or circle */ public Polygon createEllipse() { Envelope env = dim.getEnvelope(); double xRadius = env.getWidth() / 2.0; double yRadius = env.getHeight() / 2.0; double centreX = env.getMinX() + xRadius; double centreY = env.getMinY() + yRadius; Coordinate[] pts = new Coordinate[nPts + 1]; int iPt = 0; for (int i = 0; i < nPts; i++) { double ang = i * (2 * Math.PI / nPts); double x = xRadius * Math.cos(ang) + centreX; double y = yRadius * Math.sin(ang) + centreY; pts[iPt++] = coord(x, y); } pts[iPt] = new Coordinate(pts[0]); LinearRing ring = geomFact.createLinearRing(pts); Polygon poly = geomFact.createPolygon(ring, null); return (Polygon) rotate(poly); } /**
public void setEnvelope(Envelope env) { dim.setEnvelope(env); }