double x = point.getOrdinate(0); double y = point.getOrdinate(1); try { result = region.evaluate(point, values);
public void setBounds(BoundingBox bounds) { this.crs = bounds.getCoordinateReferenceSystem(); this.x = bounds.getMinX(); this.y = bounds.getMinY(); this.width = bounds.getWidth(); this.height = bounds.getHeight(); }
/** * Constructs a position initialized to the same values than the specified point. * * @param point The position to copy. * @since 2.2 */ public GeneralDirectPosition(final DirectPosition point) { ordinates = point.getCoordinate(); // Should already be cloned. crs = point.getCoordinateReferenceSystem(); }
public String getBoundsStr() { if (bounds == null) { return null; } else { return bounds.getMinimum(0) + "," + bounds.getMinimum(1) + "," + bounds.getMaximum(0) + "," + bounds.getMaximum(1); } }
/** Ensure the specified point is one-dimensional. */ static void checkDimension(final DirectPosition point) { final int dim = point.getDimension(); if (dim != 1) { throw new MismatchedDimensionException( Errors.format( ErrorKeys.MISMATCHED_DIMENSION_$2, Integer.valueOf(1), Integer.valueOf(dim))); } } /**
/** * Returns the LINESTRING representation in WKT. * * @return WKT format. */ public String toString() { String wkt = ""; for (int i = 0; i < vertices.length; i++) { wkt = wkt + vertices[i].getCoordinate()[0] + " " + vertices[i].getCoordinate()[1]; if (i != (vertices.length - 1)) { wkt = wkt + ", "; } } return "LINESTRING (" + wkt + ")"; }
public boolean contains(DirectPosition point) { return point.equals(position); }
/** Returns the list of enumerations of the same kind than this enum. */ public PrecisionType[] family() { return values(); }
/** * Returns the precision type that matches the given string, or returns a new one if none match * it. * * @param code The name of the code to fetch or to create. * @return A code matching the given name. */ public static PrecisionType valueOf(String code) { return valueOf(PrecisionType.class, code); } }
public boolean contains(TransfiniteSet pointSet) { return pointSet.contains(position); }
double lon = sourcePos.getOrdinate(0); double lat = sourcePos.getOrdinate(1); Sample s = ss.getSample(lon, lat); if (s != null)
assertCoverageResolution(coverage, 1007, 1007); Envelope coverageEnvelope = coverage.getEnvelope(); assertEquals(399960, coverageEnvelope.getMinimum(0), 1); assertEquals(5190240, coverageEnvelope.getMinimum(1), 1); assertEquals(509760, coverageEnvelope.getMaximum(0), 1); assertEquals(5300040, coverageEnvelope.getMaximum(1), 1);
public MockDirectPosition(DirectPosition position) { assert position.getCoordinateReferenceSystem() == crs; coordinates = position.getCoordinate(); }
double[] minCP = envelope.getLowerCorner().getCoordinate(); double[] maxCP = new double[] {
double lon = sourcePos.getOrdinate(0); double lat = sourcePos.getOrdinate(1);
double lon = targetPos.getOrdinate(0); double lat = targetPos.getOrdinate(1);
public double getMedian(int dimension) { double lower = lowerCorner.getOrdinate(dimension); double upper = upperCorner.getOrdinate(dimension); return (upper + lower) / 2.0; }
public double getMinimum(int dimension) { return lowerCorner.getOrdinate(dimension); }
public double getMaximum(int dimension) { return upperCorner.getOrdinate(dimension); }