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