Rendering/parsing fails for files with `Infinity` in metadata `tilestats`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- web-dev
Direzione di ricerca
Start by reproducing the failure with the provided PMTiles metadata snippet containing Infinity, using the TypeScript pmtiles library or pmtiles.io. Trace the metadata parsing path to identify where the non-strict JSON value causes loading to fail. Done means a PMTiles file with these tilestats values loads and renders successfully without manually editing the metadata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When a .pmtiles file contains Infinity as a value within the tilestats attribute of the metadata, the library fails to render the file.
The issue seems to probably stem from the fact that Infinity is not a valid value in strict JSON (while it's handled fine in Javascript), causing the parser to fail when reading the header/metadata. If the metadata is manually edited to replace Infinity with a standard numeric value (e.g. '99999'), the file renders perfectly.
The same file opens and displays correctly in QGIS, suggesting the underlying vector data is valid, but the JS-based metadata parsing is the bottleneck.
Environment
- Library:
pmtiles(NPM) - Platform: Web/Node.js
- Version: 4.4.0
Steps to Reproduce
- Generate a PMTiles file where an attribute has an infinite value.
- Attempt to load/render this file using the library (or say pmtiles.io).
- Observe failure to render the file.
Metadata Snippet (Cause of failure)
{
"tilestats": {
"layers": [
{
"layer": "Detour Factor",
"attributes": [
{
"attribute": "detour_factor",
"type": "number",
"values": [
2.0198,
...,
Infinity
],
"min": 2.0198,
"max": Infinity
}
]
}
]
}
}
- Lingua principale
- TypeScript
- Stelle
- 3.3k
- Fork
- 218
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 protomaps/PMTiles
-
Support for Leaflet 2xAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Viewer: archive URLs containing "=" are truncated when read from the hashForse già presa @nu11waredev l’ha presa 16 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Protocol: add `encoding: "mlt"` to the TileJSON for MLT archivesForse già presa @tordans l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 15/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
Tutte le issue di protomaps/PMTiles
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
review-followup
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
griffinwork40/agent-afk#5387 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CodeManufactoryLLC/Code60#358 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
android:plan ios:plan main:plan packages:learn
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno