1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use debug;
use crateTilejsonArgs;
use crateUtilesResult;
use crate;
use cratetilejson_stringify;
pub async
// use tracing::debug;
//
// use crate::cli::args::TilejsonArgs;
// use crate::errors::UtilesResult;
// use crate::pmt::fspath2pmtilejson;
// use crate::utilejson::tilejson_stringify;
// use crate::mbt::{MbtilesAsync, MbtilesAsyncSqliteClient};
//
// pub async fn tilejson_main(args: &TilejsonArgs) -> UtilesResult<()> {
// debug!("tilejson: {}", args.common.filepath);
// // if it ends with .pmtiles, use pmtiles else use mbtiles...
// let mut tj = if args.common.filepath.ends_with(".pmtiles") {
// // pmtiles
// fspath2pmtilejson(&args.common.filepath).await?
// // let reader = AsyncPmTilesReader::new_with_path(&args.common.filepath).await?;
// // reader.parse_tilejson(vec![]).await?
// } else {
// // mbtiles
// let mbt = MbtilesAsyncSqliteClient::open_readonly(&args.common.filepath).await?;
// let tj = mbt.tilejson().await?;
// tj
// };
// // let mbt = MbtilesAsyncSqliteClient::open_readonly(&args.common.filepath).await?;
// // let mut tj = mbt.tilejson().await?;
// if !args.tilestats {
// tj.other.remove("tilestats");
// }
// let s = tilejson_stringify(&tj, Option::from(!args.common.min));
// println!("{s}");
// Ok(())
// }