/*int[] indices = CSUtils.getDirectedAxisIndices(
crs.getCoordinateSystem(),
new AxisDirection[] { AxisDirection.EAST, AxisDirection.NORTH });*/
//edited to use javax.measure.unit.Convertor
UnitConverter xConverter = xUnit.getConverterTo(unit);
UnitConverter yConverter = yUnit.getConverterTo(unit);
double[] lowerOrdinates = new double[crs.getCoordinateSystem().getDimension()];
lowerOrdinates[xIndex] = xConverter.convert(minx);
lowerOrdinates[yIndex] = yConverter.convert(miny);
/*for (int i = 0; i < lowerOrdinates.length; i++) {
// the east or x ordinate
if (i == indices[0]) {
lowerOrdinates[i] = minx;
// the north or y ordinate
} else if (i == indices[1]) {
lowerOrdinates[i] = miny;
} else {
lowerOrdinates[i] = 0;
}
}*/
double[] upperOrdinates = new double[crs.getCoordinateSystem().getDimension()];
upperOrdinates[xIndex] = xConverter.convert(maxx);
upperOrdinates[yIndex] = yConverter.convert(maxy);
/*for (int i = 0; i < upperOrdinates.length; i++) {
// the east or x ordinate
if (i == indices[0]) {
upperOrdinates[i] = maxx;