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

Rename dst-type to mbtiles-type #1014

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/501-martin-cp.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This copies tiles from a PostGIS table `my_table` into an MBTiles file `tileset.

```shell
martin-cp --output-file tileset.mbtiles \
--dst-type normalized \
--mbtiles-type normalized \
"--bbox=-180,-90,180,90" \
--min-zoom 0 \
--max-zoom 10 \
Expand Down
7 changes: 6 additions & 1 deletion martin/src/bin/martin-cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ pub struct CopyArgs {
#[arg(short, long)]
pub output_file: PathBuf,
/// Output format of the destination file, ignored if the file exists. For new files, defaults to 'normalized'.
#[arg(long, value_enum)]
#[arg(
long = "mbtiles-type",
alias = "dst-type",
value_name = "SCHEMA",
value_enum
)]
pub dst_type: Option<MbtTypeCli>,
/// Specify the behaviour when generated tile already exists in the destination file.
#[arg(long, value_enum, default_value_t = CopyDuplicateMode::default())]
Expand Down
8 changes: 7 additions & 1 deletion mbtiles/src/copier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ pub struct MbtilesCopier {
/// Output format of the destination file, ignored if the file exists. If not specified, defaults to the type of source
#[cfg_attr(
feature = "cli",
arg(long = "dst-type", alias = "dst_type", value_enum)
arg(
long = "mbtiles-type",
alias = "dst-type",
alias = "dst_type",
value_name = "SCHEMA",
value_enum
)
)]
pub dst_type_cli: Option<MbtTypeCli>,
/// Destination type with options
Expand Down
6 changes: 3 additions & 3 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,13 @@ if [[ "$MARTIN_CP_BIN" != "-" ]]; then
CFG=(--default-srid 900913 --auto-bounds calc tests/fixtures/mbtiles tests/fixtures/pmtiles tests/fixtures/pmtiles2)

test_martin_cp "flat" "${CFG[@]}" \
--source table_source --dst-type flat --concurrency 3 \
--source table_source --mbtiles-type flat --concurrency 3 \
--min-zoom 0 --max-zoom 8 "--bbox=-2,-1,142.84,45"
test_martin_cp "flat-with-hash" "${CFG[@]}" \
--source table_source --dst-type flat-with-hash --concurrency 3 \
--source table_source --mbtiles-type flat-with-hash --concurrency 3 \
--min-zoom 0 --max-zoom 8 "--bbox=-2,-1,142.84,45"
test_martin_cp "normalized" "${CFG[@]}" \
--source table_source --dst-type normalized --concurrency 3 \
--source table_source --mbtiles-type normalized --concurrency 3 \
--min-zoom 0 --max-zoom 8 "--bbox=-2,-1,142.84,45"

unset DATABASE_URL
Expand Down
Loading