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

Refactorings, content-type/enc, cli parsing, tests, minor fixes #548

Merged
merged 5 commits into from
Jan 8, 2023

Conversation

nyurik
Copy link
Member

@nyurik nyurik commented Jan 6, 2023

  • introduce a new Connections object to track all positional strings passed as the CLI arguments
    • each tile provider can now indicate if it can take a positional CLI arg, and if the value can be shared between multiple providers, i.e. if its a directory that could contain files for multiple providers
  • make xyz use better types - u8 for zoom, u32 for x&y. Postgres casts those to INT2 and INT8
  • minor bug in pre-push git hook to abort in case of a testingerror
  • added GIF detection/type
  • combine MVT and compression concepts into one enum more explicitly. It is not ideal (technically they are separate concerns), but it keeps it a bit simpler for now for multiple providers.
  • set content encoding and content type on HTTP responses if known, and also include them in the /catalog response (json)
  • raise an error if the user attempts to merge non-concatenatable tiles from multiple sources. We may want to implement it in the future, e.g. combine multiple semi-transparent PNGs. Or even combine GIF & PNG & JPEG
  • do not set content-type on empty responses (http 204)
  • add tilejson outputs to testing

Splitting from maplibre#517
* introduce a new Connections object to track all positional strings passed as the CLI arguments
* make xyz use better types - u8 for zoom, u32 for x&y.  Postgres casts those to INT2 and INT8
* minor bug in pre-push git hook
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2023

Codecov Report

Base: 60.42% // Head: 61.80% // Increases project coverage by +1.37% 🎉

Coverage data is based on head (ad22324) compared to base (c50169a).
Patch coverage: 75.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
+ Coverage   60.42%   61.80%   +1.37%     
==========================================
  Files          23       25       +2     
  Lines        1933     1987      +54     
==========================================
+ Hits         1168     1228      +60     
+ Misses        765      759       -6     
Impacted Files Coverage Δ
src/source.rs 82.60% <0.00%> (-0.25%) ⬇️
src/utils/error.rs 15.38% <15.38%> (ø)
martin-tile-utils/src/lib.rs 72.09% <52.17%> (+22.09%) ⬆️
src/args/connections.rs 70.00% <70.00%> (ø)
src/srv/server.rs 78.50% <73.91%> (-1.07%) ⬇️
src/args/pg.rs 84.05% <100.00%> (+0.03%) ⬆️
src/args/root.rs 93.54% <100.00%> (+0.84%) ⬆️
src/config.rs 60.93% <100.00%> (+3.12%) ⬆️
src/pg/pg_source.rs 74.66% <100.00%> (+2.60%) ⬆️
src/utils/one_or_many.rs 98.24% <100.00%> (+0.68%) ⬆️
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nyurik nyurik mentioned this pull request Jan 8, 2023
@nyurik nyurik changed the title Refactoring Refactorings, content-type/enc, cli parsing, tests, minor fixes Jan 8, 2023
@nyurik nyurik enabled auto-merge (squash) January 8, 2023 13:41
@nyurik nyurik merged commit e58773f into maplibre:main Jan 8, 2023
@nyurik nyurik deleted the refactoring branch January 8, 2023 14:31
nyurik added a commit that referenced this pull request Jan 8, 2023
Merge after #548 

Adds a new [.pmtiles](https://protomaps.com/docs/pmtiles/) backend.
Supports all formats like png, vector, etc.

From CLI, can be as easy as adding a path to a directory that contains a
.pmtiles file:

```bash
# All *.pmtiles files in this dir will be published.
# The filename will be used as the source ID
martin ./tests/fixtures
```

From configuration file, the path can be specified in a number of ways:

```yaml
pmtiles:
  paths:
    # scan this whole dir, matching all *.pmtiles files
    - /dir-path
    # specific pmtiles file will be published as pmtiles2 source
    - /path/to/pmtiles2.pmtiles
  sources:
      # named source matching source name to a single file
      pm-src1: /tmp/pmtiles.pmtiles
      # named source, where the filename is explicitly set. This way we will be able to add more options later
      pm-src2:
        path: /tmp/pmtiles.pmtiles
```

Fixes #508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants