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

Decide how to configure file-based sources like mbtiles and pmtiles #513

Closed
nyurik opened this issue Dec 12, 2022 · 1 comment
Closed

Decide how to configure file-based sources like mbtiles and pmtiles #513

nyurik opened this issue Dec 12, 2022 · 1 comment
Assignees
Labels
config Relates to Martin configuration enhancement

Comments

@nyurik
Copy link
Member

nyurik commented Dec 12, 2022

A tile source could be a file like foo.pmtiles or bar.mbtiles - both of which contain just one set of tiles. Moreover, at least mbtiles stores some metadata as well to make the creation of tilejson relatively easy.

We need a configuration schema that:

  • publish a single file as a source, with the file name being the source ID
  • same but publish a list of files
  • publish a whole directory(s) of files, possibly with a glob pattern
  • add some configuration params to a single file like maxzoom
  • add some configuration params to all the files discovered in a directory(s)
  • ideally it should looks relatively consistent with how postgres will be configured as part of Decide how to configure postgres table/function auto-discovery #512

ideas

# Single file
pmtiles: /path/to/file.pmtiles

# Directory of files - will only look at *.pmtiles
pmtiles: /path/to/dir

# A few paths and a few source IDs
pmtiles:
  paths:
    - /dir-path
    - /path/to/pmtiles2.pmtiles
  sources:
      pm-src1: /tmp/pmtiles.pmtiles
      pm-src2:
        path: /tmp/pmtiles.pmtiles
        maxzoom: 10

# A map of source-IDs to individual files -- this method wouldn't handle multiple files though,
# or else it would need to ignore the ID if the path is a directory, which is not very clear to the users.
pmtiles:
    id1: /dir/path
    id2: /file.mbtiles
    id3:
        path: /foo/bar
        maxzoom: 10

# A list of objects (similar to PG), where each could be either a file or a dir.  A bit verbose to specify the ID
# CONs: possibly a bit less ergonomic because the ID must be specified explicitly, but at the same time
# if the file name is good enough as the ID, this is the cleanest approach.
pmtiles:
    - path: file.mbtiles
      id: foo
      maxzoom: 10
    - path: /path
      maxzoom: 11
@nyurik nyurik added enhancement config Relates to Martin configuration labels Dec 13, 2022
@nyurik
Copy link
Member Author

nyurik commented Jan 9, 2023

implemented using the first approach for now... perhaps will rethink further before 0.7 release

@nyurik nyurik closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Relates to Martin configuration enhancement
Projects
None yet
Development

No branches or pull requests

2 participants