Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized metadata value? #799

Closed
renedupont opened this issue Aug 10, 2023 · 5 comments
Closed

Unrecognized metadata value? #799

renedupont opened this issue Aug 10, 2023 · 5 comments

Comments

@renedupont
Copy link

renedupont commented Aug 10, 2023

Hey,

I receive a geojson file that I use to create 5 layers (each in its own mbtiles file) with tippecanoe.

Once I start martin with these mbtiles as source, I get the following warnings:

[2023-08-09T09:40:07Z INFO martin::file_config] Configured source level_1 from /mbtiles/level_1.mbtiles
[2023-08-09T09:40:07Z WARN martin_mbtiles::mbtiles] level_1 has an unrecognized metadata value antimeridian_adjusted_bounds=-10.621100,35.004200,40.495800,59.995800
[2023-08-09T09:40:07Z WARN martin_mbtiles::mbtiles] level_1 has an unrecognized metadata value generator_options=tippecanoe '--output=mbtiles/level_1.mbtiles' /geojsons/levels_20230703.geojson '--minimum-zoom=6' '--maximum-zoom=11' '--layer=level1' '--feature-filter={ "*": [ "==", "id", 1 ] }'
[2023-08-09T09:40:07Z WARN martin_mbtiles::mbtiles] level_1 has an unrecognized metadata value strategies=[{},{},{},{},{},{},{"tiny_polygons":5},{"tiny_polygons":14},{"tiny_polygons":39},{"tiny_polygons":134},{"tiny_polygons":321},{"tiny_polygons":722}]
[2023-08-09T09:40:07Z INFO martin::file_config] Configured source level_2 from /mbtiles/level_2 .mbtiles
[2023-08-09T09:40:07Z WARN martin_mbtiles::mbtiles] level_2 has an unrecognized metadata value antimeridian_adjusted_bounds=-10.621100,35.004200,40.495800,59.995800
[2023-08-09T09:40:07Z WARN martin_mbtiles::mbtiles] level_2 has an unrecognized metadata value generator_options=tippecanoe '--output=mbtiles/level_2 .mbtiles' /geojsons/levels_20230703.geojson '--minimum-zoom=6' '--maximum-zoom=11' '--layer=level2' '--feature-filter={ "*": [ "==", "id", 2 ] }'
[2023-08-09T09:40:07Z WARN martin_mbtiles::mbtiles] level_2 has an unrecognized metadata value strategies=[{},{},{},{},{},{},{"tiny_polygons":8},{"tiny_polygons":11},{"tiny_polygons":42},{"tiny_polygons":137},{"tiny_polygons":362},{"tiny_polygons":1024}]
...

My question would be: Is that just some custom metadata fields that tippecanoe adds to the mbtiles that martin doesn't care about because it doesn't know what it is and I can fully neglect the warnings, or does this have any consequences during runtime?

@renedupont renedupont changed the title Unrecognized metadata value Unrecognized metadata value? Aug 10, 2023
@sharkAndshark
Copy link
Collaborator

sharkAndshark commented Aug 11, 2023

Hi @renedupont Have a good day :D
I think you can ignore these warnings .
Based on the MBTiles spec, there are many meta data vallues like: name, format, bounds, center, minzoom, maxzoom etc.
Martin will show a warning if there are metadatas not in the spec.

        while let Some(row) = rows.try_next().await? {
            if let (Some(name), Some(value)) = (row.name, row.value) {
                match name.as_ref() {
                    "name" => tj.name = Some(value),
                    "version" => tj.version = Some(value),
                    "bounds" => tj.bounds = self.to_val(Bounds::from_str(value.as_str()), &name),
                    "center" => tj.center = self.to_val(Center::from_str(value.as_str()), &name),
                    "minzoom" => tj.minzoom = self.to_val(value.parse(), &name),
                    "maxzoom" => tj.maxzoom = self.to_val(value.parse(), &name),
                    "description" => tj.description = Some(value),
                    "attribution" => tj.attribution = Some(value),
                    "type" => layer_type = Some(value),
                    "legend" => tj.legend = Some(value),
                    "template" => tj.template = Some(value),
                    "json" => json = self.to_val(serde_json::from_str(&value), &name),
                    "format" | "generator" => {
                        tj.other.insert(name, Value::String(value));
                    }
                    _ => {
                        let file = &self.filename;
                        warn!("{file} has an unrecognized metadata value {name}={value}");
                        tj.other.insert(name, Value::String(value));
                    }
                }
            }
        }

@nyurik
Copy link
Member

nyurik commented Aug 11, 2023

I wonder if we should lower the priority for the unrecognized mbtiles messages to info ?

@sharkAndshark
Copy link
Collaborator

I agree with you. It's more like info @nyurik

@nyurik
Copy link
Member

nyurik commented Aug 11, 2023

PRs welcome :)

nyurik pushed a commit that referenced this issue Aug 11, 2023
#799 Downgrade log level from `warn` to `info` when there is
unrecognized metadata value in `MBTiles` file .
@renedupont
Copy link
Author

Got it, thanks a lot @sharkAndshark !
Closing due to merged PR #800 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants