Skip to content

Commit

Permalink
Rename dst-type to mbtiles-type (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik authored Nov 20, 2023
1 parent 5f74ce7 commit c6a7ef6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
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

0 comments on commit c6a7ef6

Please sign in to comment.