Issue #1052 Fixed GridLocaton.gridCell to return Point instead of Coordinate.
Change-Id: I1bbf11738ec0595d42d88423bb9b6ef9d42468e2 Former-commit-id:17f636c2a2
[formerly 373ac200fcd1c9a39244a2775d95c7b891334632] Former-commit-id:81abb2c60b
This commit is contained in:
parent
1687889756
commit
7cde30681b
1 changed files with 4 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue