Skip to content

Commit

Permalink
Fix #23676: Mapillary still has some non-numeric ids in their tiles
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jun 17, 2024
1 parent 1044cea commit 7a3a633
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,17 @@ public static long getKey(@Nullable IPrimitive image, boolean ignoreId) {
}
// This should always be a parseable integer according to API docs. By not checking that all characters are
// digits, we save 55.6 MB of allocations in the test area during download.
if (image.hasKey(ImageProperties.ID.toString())) {
final var id = Long.parseLong(image.get(ImageProperties.ID.toString()));
if (id > 0) {
image.setOsmId(id, 1);
try {
if (image.hasKey(ImageProperties.ID.toString())) {
final var id = Long.parseLong(image.get(ImageProperties.ID.toString()));
if (id > 0) {
image.setOsmId(id, 1);
}
return id;
}
return id;
} catch (NumberFormatException numberFormatException) {
// This does actually happen; see #23734
Logging.error(numberFormatException);
}
}
return 0;
Expand Down

0 comments on commit 7a3a633

Please sign in to comment.