Skip to content

Commit

Permalink
Removing IsoCountry dependency from country code assignment when merg…
Browse files Browse the repository at this point in the history
…ing relations (#211)
  • Loading branch information
MikeGost authored and matthieun committed Aug 31, 2018
1 parent 8ef8677 commit bee15d4
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,23 @@ private void mergeOverlappingClosedMembers(final Relation relation,
markRemovedMemberLineForDeletion(inner, relationIdentifier);
}

// Set the proper country code
// Get the proper country code
final String countryCode;
final Optional<String> possibleCountryCode = outer.getTag(ISOCountryTag.KEY);
if (possibleCountryCode.isPresent())
{
countryCode = possibleCountryCode.get();
}
else
{
// At this point, all members are sliced and must have a country code
throw new CoreException(
"Relation {} contains member {} that is missing a country code",
relationIdentifier, outer);
}

CountryBoundaryMap.setGeometryProperty(exteriorRing, ISOCountryTag.KEY,
ISOCountryTag.first(outer).get().getIso3CountryCode());
countryCode);

// Create points, lines and update members
createNewLineMemberForRelation(exteriorRing, relationIdentifier,
Expand Down

0 comments on commit bee15d4

Please sign in to comment.