Improve the documentation of the export command
I'm not sure to fully understand the what the export command need as arguments to properly work:
# baremaps export \
--database 'jdbc:postgresql://'${HOST}':'${PORT}'/'${POSTGRES_DB}'?user='${POSTGRES_USER}'&password='${POSTGRES_PASSWORD} \
--config "${config_file}" \
--log-level=DEBUG \
--repository=./data/tiles
[INFO ] 2021-03-09 08:22:58.654 [main] Export - 56 processors available
[INFO ] 2021-03-09 08:22:58.681 [main] Export - Reading configuration
[DEBUG] 2021-03-09 08:22:58.795 [main] FileBlobStore - Read
java.io.IOException: Is a directory
...
Here is the help:
Usage: baremaps export [--enable-s3] [--mbtiles] [--batch-array-index=READER]
[--batch-array-size=BATCH_ARRAY_SIZE] --config=YAML
--database=DATABASE [--log-level=LOG_LEVEL]
--repository=URL [--tiles=TILES]
Export vector tiles from the database.
--batch-array-index=READER The index of the batch in the array.
--batch-array-size=BATCH_ARRAY_SIZE
The size of the batch array.
--config=YAML The YAML source configuration file.
--database=DATABASE The JDBC url of the Postgres database.
--enable-s3 Enable Amazon S3 integration.
--log-level=LOG_LEVEL The log level.
--mbtiles The repository is in the MBTiles format.
--repository=URL The tile repository URL.
--tiles=TILES The tiles to export.
Why is the --repository expecting a URL? Can't we just simply save the tiles to the file system? How do we achieve that then?
And what exactly are the --tiles and --mbtiles flags doing? Maybe I must use one of those instead, but the --repository flag seems mandatory and if I set a path to the -mbtiles one I got:
Invalid value for option '--mbtiles': './data/tiles' is not a boolean
which seems to suffer a tiny offset in what I understand from the documentation.
Maybe it could be nice to also print out the expected values for each args, as many bash command help pages are actually doing.
Thanks for having a look!
The command enables you to save tiles in different locally and remotely, hence the URL (s3://..., https://...).
The --mbtiles is a just a flag without parameters (boolean) that tells baremaps to create a mbtiles file instead of a directory structure.
The clarity of these parameters could be improved. If you have some ideas on how to structure these commands and parameters, let me know. I would like them to be intuitive but struggle at naming things.