results.add(result.getKey(), fieldsNames, new Object[] { result.getValue().getGeomNode().getId(),
"Snapped point to layer " + layerName + ": " + result.getValue().getGeometry().toString(),
(long) (1000000 * result.getDistance()) });
}
if (edgeResults.size() > 0) {
PointResult closest = edgeResults.get(0);
Point closestPoint = closest.getKey();
SpatialDatabaseRecord wayRecord = closest.getValue();
OSMDataset.Way way = ((OSMDataset) osmLayer.getDataset()).getWayFrom(wayRecord.getGeomNode());
OSMDataset.WayPoint wayPoint = way.getPointAt(closestPoint.getCoordinate());
}
}