final PositionsModel positionsModel,
final int[] rows,
final OverwritePredicate predicate) {
executeOperation(positionsTable, positionsModel, rows, true, predicate,
new Operation() {
private GeoNamesService geonamesService = new GeoNamesService();
public String getName() {
return "PopulatedPlacePositionAugmenter";
}
public int getColumnIndex() {
return DESCRIPTION_COLUMN_INDEX;
}
public void performOnStart() {
}
public boolean run(int index, NavigationPosition position) throws Exception {
String description = geonamesService.getNearByFor(position.getLongitude(), position.getLatitude());
if (description != null)
positionsModel.edit(index, new PositionColumnValues(DESCRIPTION_COLUMN_INDEX, description), false, true);
return description != null;
}