Place label parsing is broken
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia in VectorTileFeatures.cs, in GetProperties(), e riproduci il caso di chiavi duplicate con il tileset mapbox-streets-v7 o mapbox-streets-v8. Assicurati che le proprietà duplicate non causino più il lancio di un'eccezione durante il parsing, mentre un numero non uniforme di tag continui a segnalare un errore; adatta opportunamente il comportamento degli avvisi a questo progetto invece di affidarti al logging di Unity.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Right now using the mapbox-streets-v7 and mapbox-streets-v8 tile-sets querying place labels throws excpetions when parsing properties. The exception happens when the API returns duplicated keys. For example for the class property it returns both country and disputed_country.
The problematic code is in VectorTileFeatures.cs GetProperties() method
public Dictionary<string, object> GetProperties()
{
if (0 != Tags.Count % 2)
{
throw new Exception(string.Format("Layer [{0}]: uneven number of feature tag ids", _layer.Name));
}
Dictionary<string, object> properties = new Dictionary<string, object>();
int tagCount = Tags.Count;
for (int i = 0; i < tagCount; i += 2)
{
properties.Add(_layer.Keys[Tags[i]], _layer.Values[Tags[i + 1]]);
}
return properties;
}
Suggested fix:
public Dictionary<string, object> GetProperties()
{
if (Tags.Count % 2 != 0) throw new InvalidOperationException($"Layer [{_layer.Name}]: uneven number of feature tag ids");
var properties = new Dictionary<string, object>();
var tagCount = Tags.Count;
for (var i = 0; i < tagCount; i += 2)
{
var key = _layer.Keys[Tags[i]];
var value = _layer.Values[Tags[i + 1]];
if (properties.TryGetValue(key, out var oldValue))
{
if (Equals(value, oldValue))
{
continue;
}
else
{
// To work around the issue we started using this projects source directly in Unity. This logging should be different in the actual fix
UnityEngine.Debug.LogWarning($"Overriding tile property. Key: {key}, Old value: {properties[key]}, New value: {value}");
}
}
properties[key] = value;
}
return properties;
}
- Lingua principale
- C#
- Stelle
- 64
- Fork
- 38
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mapbox/vector-tile-cs
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
mapbox/vector-tile-cs#45 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
mapbox/vector-tile-cs#43 ·
-
Update mvt-fixtures to 3.xAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
mapbox/vector-tile-cs#39 · 1 commento ·
-
Remove bench fixtures (have been deprecated)Forse di nuovo libera @wilhelmberg l’ha presa 3204 giorni fa e non c’è nessuna pull request aperta. Aperta
mapbox/vector-tile-cs#38 · 1 assegnatario ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
mapbox/vector-tile-cs#29 · 4 commenti ·
Tutte le issue di mapbox/vector-tile-cs
Issue simili
-
area-signalr
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dotnet/aspnetcore#69842 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 2 giorni
-
bug needs-triage
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 78/100
microsoft/microsoft-ui-reactor#1373 ·
I maintainer di solito rispondono entro 1 giorno
-
Client customer-reported KeyVault needs-team-attention question Service Attention
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Azure/azure-sdk-for-net#63861 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno