Issue #1052 Fixed GridLocaton.gridCell to return Point instead of Coordinate.

Change-Id: I1bbf11738ec0595d42d88423bb9b6ef9d42468e2

Former-commit-id: 373ac200fcd1c9a39244a2775d95c7b891334632
This commit is contained in:
Ron Anderson 2012-08-14 16:19:52 -05:00 committed by Steve Harris
parent e530637aa3
commit 81abb2c60b

View file

@ -524,17 +524,13 @@ public class GridLocation extends PersistableDataObject implements
return ref.getGrid();
}
public Coordinate gridCell(float lat, float lon) {
return gridCell(new Coordinate(lon, lat));
}
public Coordinate gridCell(Coordinate coord) {
return MapUtil.latLonToGridCoordinate(coord, PixelOrientation.CENTER,
this);
public Point gridCell(float lat, float lon) {
return gridCoordinate(new Coordinate(lon, lat));
}
public Point gridCoordinate(Coordinate lonLat) {
Coordinate gcf = gridCell(lonLat);
Coordinate gcf = MapUtil.latLonToGridCoordinate(lonLat,
PixelOrientation.CENTER, this);
int x = (int) (gcf.x > -0.5 ? gcf.x + 0.5 : gcf.x - 0.5);
int y = (int) (gcf.y > -0.5 ? gcf.y + 0.5 : gcf.y - 0.5);
return new Point(x, y);