Skip to content

Commit

Permalink
Fix GitHub #197: "Unsupported get request" when clicking on a detecte…
Browse files Browse the repository at this point in the history
…d point object

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jul 11, 2022
1 parent 3fe204f commit 30278ab
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package org.openstreetmap.josm.plugins.mapillary.utils;

import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -96,7 +97,10 @@ public static long getId(@Nullable final IPrimitive primitive) {
if (primitive == null) {
return 0;
}
if (primitive.getUniqueId() <= 0) {
// Mapillary doesn't give them an id of 0, and instead an id inside the tile. I have no clue why they don't make
// them match (the id inside the key list == the id of the object in the tile). Most ids are actually longs,
// but the id in the tile is usually not in the long range (AKA, < Integer.MAX_VALUE, more often < 100_000)
if (primitive.getUniqueId() <= Integer.MAX_VALUE) {
final String str = getKeyValue(primitive, MapFeatureProperties.ID);
if (str != null) {
primitive.setOsmId(Long.parseLong(str), 1);
Expand Down

0 comments on commit 30278ab

Please sign in to comment.