mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
python: pmtiles-convert from mbtiles writes v3 spec
This commit is contained in:
@@ -15,9 +15,6 @@ parser.add_argument("output", help="Output .mbtiles, .pmtiles, or directory")
|
||||
parser.add_argument(
|
||||
"--maxzoom", help="the maximum zoom level to include in the output."
|
||||
)
|
||||
parser.add_argument(
|
||||
"--gzip", help="The output should be gzip-compressed.", action="store_true"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--overwrite", help="Overwrite the existing output.", action="store_true"
|
||||
)
|
||||
@@ -32,16 +29,14 @@ if args.overwrite:
|
||||
elif os.path.isdir(args.output):
|
||||
shutil.rmtree(args.output)
|
||||
|
||||
print("compression:", "gzip" if args.gzip else "disabled")
|
||||
|
||||
if args.input.endswith(".mbtiles") and args.output.endswith(".pmtiles"):
|
||||
mbtiles_to_pmtiles(args.input, args.output, args.maxzoom, args.gzip)
|
||||
mbtiles_to_pmtiles(args.input, args.output, args.maxzoom)
|
||||
|
||||
elif args.input.endswith(".pmtiles") and args.output.endswith(".mbtiles"):
|
||||
pmtiles_to_mbtiles(args.input, args.output, args.gzip)
|
||||
pmtiles_to_mbtiles(args.input, args.output)
|
||||
|
||||
elif args.input.endswith(".pmtiles"):
|
||||
pmtiles_to_dir(args.input, args.output, args.gzip)
|
||||
pmtiles_to_dir(args.input, args.output)
|
||||
|
||||
else:
|
||||
print("Conversion not implemented")
|
||||
|
||||
Reference in New Issue
Block a user