for (GetLocationResult[] altArr : alternatives) {
for (GetLocationResult alt : altArr) {
if (maxAlternatives > 0 && maxAlternatives <= altList.size()) {
break;
}
GetLocationForStringAlternative one = new GetLocationForStringAlternative();
String matchedLocation = location;
List<String> matchedStrings = alt.getCanonicalStrings();
if (null != matchedStrings) {
matchedLocation = splitGeocoderStringService.combine(matchedStrings);
}
one.setCanonicalLocation(matchedLocation);
// set additional info data
one.setGeocoderName(alt.getGeocoderName());
one.setUserData(alt.getUserData());
// combine location envelopes
Bbox bbox = dtoConverterService.toDto(alt.getEnvelope());
one.setBbox(bbox);
one.setCenter(
new Coordinate(bbox.getX() + bbox.getWidth() / 2, bbox.getY() + bbox.getHeight() / 2));
altList.add(one);
}
}