Changeset 32973 in osm for applications
- Timestamp:
- 2016-09-11T13:47:28+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/data/signs/eu.cson
r32971 r32973 92 92 'prohibitory_vehicle_height_limit': 'prohibitory--maximum-height--de' 93 93 'prohibitory_vehicle_width_limit': 'prohibitory--maximum-width--de' 94 'warning--junction-with-a-side-road-perpendicular-right--de': 'danger--junction-with-a-side-road-perpendicular-right--de' -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySign.java
r32972 r32973 30 30 HashMap<String, MapillarySign> countryMap = new HashMap<>(); 31 31 try ( 32 33 34 32 BufferedReader br = new BufferedReader(new InputStreamReader( 33 MapillarySign.class.getResourceAsStream("/data/signs/" + country + ".cson") 34 )); 35 35 ) { 36 36 String line = ""; … … 58 58 return countryMap.get(name); 59 59 } else { 60 if (name.split("--").length >= 3 && countryMap.containsValue(new MapillarySign(name))) { 61 Optional<MapillarySign> p = countryMap.values().stream().filter(sign -> sign.toString().equals(name)).findFirst(); 62 assert p.isPresent(); 63 return p.get(); 60 if (name.split("--").length >= 3) { 61 if (countryMap.containsValue(new MapillarySign(name))) { 62 Optional<MapillarySign> p = countryMap.values().stream().filter(sign -> sign.toString().equals(name)).findFirst(); 63 assert p.isPresent(); 64 return p.get(); 65 } else { 66 return new MapillarySign(name); 67 } 64 68 } else { 65 Main.warn("Sign '" + name + "' does not exist in the plugin database. Please conta nct the developer to add it.");69 Main.warn("Sign '" + name + "' does not exist in the plugin database. Please contact the developer to add it."); 66 70 return null; 67 71 } … … 70 74 71 75 public MapillarySign(String fullName) { 72 Main.info(fullName);73 76 this.fullName = fullName; 74 77 String[] parts = fullName.split("--"); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java
r32972 r32973 47 47 try ( 48 48 BufferedReader br = new BufferedReader(new InputStreamReader( 49 49 MapillaryURL.searchImageInfoURL(bounds, page, null).openStream(), "UTF-8" 50 50 )); 51 51 ) { … … 64 64 && ((MapillaryImage) image).getKey().equals(key) 65 65 && ((MapillaryImage) image).getUser() == null 66 ) { 66 ) { 67 67 ((MapillaryImage) image).setUser(data.getString("user")); 68 68 ((MapillaryImage) image).setCapturedAt(data.getJsonNumber("captured_at").longValue()); 69 ((MapillaryImage) image).setLocation(data.getString("location")); 69 if (!data.isNull("location")) { 70 ((MapillaryImage) image).setLocation(data.getString("location")); 71 } 70 72 } 71 73 }
Note:
See TracChangeset
for help on using the changeset viewer.