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

Change-Id: I1bbf11738ec0595d42d88423bb9b6ef9d42468e2

Former-commit-id: 985167892d [formerly 5c80f582b3 [formerly 71d74b1dcf] [formerly 985167892d [formerly 564b72997c59a665398c8687d6bafdb54c469881]]]
Former-commit-id: 5c80f582b3 [formerly 71d74b1dcf]
Former-commit-id: 5c80f582b3
Former-commit-id: 0328f2f50a
This commit is contained in:
Ron Anderson 2012-08-14 16:19:52 -05:00
parent 085f833727
commit 3765765d57

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);