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

Change-Id: I1bbf11738ec0595d42d88423bb9b6ef9d42468e2

Former-commit-id: 9b35518fe5 [formerly bac68cc1de] [formerly 17f636c2a2] [formerly 81abb2c60b [formerly 17f636c2a2 [formerly 373ac200fcd1c9a39244a2775d95c7b891334632]]]
Former-commit-id: 81abb2c60b
Former-commit-id: f95802be5b445fb5325a67b2aad6ff7c3512608e [formerly 7cde30681b]
Former-commit-id: c8b0719d48
This commit is contained in:
Ron Anderson 2012-08-14 16:19:52 -05:00 committed by Steve Harris
parent 7c49cb3c64
commit daab9b6cfc

View file

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