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

Provide a default configuration if none given #1512

Closed
ricardogsilva opened this issue Jan 23, 2024 · 2 comments
Closed

Provide a default configuration if none given #1512

ricardogsilva opened this issue Jan 23, 2024 · 2 comments
Labels
enhancement New feature or request stale Issue marked stale by stale-bot

Comments

@ricardogsilva
Copy link
Member

It would be nice if pygeoapi would be able to start up without the user having to explicitly provide a configuration file. Pygeoapi would use a default configuration and start as normally. This configuration would likely have no resources at all, but at least the server would be able to start and run without error. Moreover, it would be good if this default configuration was merged with whatever is provided by the user (if anything) - something like this:

# file my-pygeoapi-config.yml

# all other config parameters not defined here use their respective
# defaults, as specified in the default pygeoapi config

logging:
  level: DEBUG

resources:
  obs:
    type: collection
            title: Observations
        description: My cool observations
        keywords:
            - observations
            - monitoring
        linked-data:
            context:
                - datetime: https://schema.org/DateTime
                - vocab: https://example.com/vocab#
                  stn_id: "vocab:stn_id"
                  value: "vocab:value"
        links:
            - type: text/csv
              rel: canonical
              title: data
              href: https://github.com/mapserver/mapserver/blob/branch-7-0/msautotest/wxs/data/obs.csv
              hreflang: en-US
            - type: text/csv
              rel: alternate
              title: data
              href: https://raw.githubusercontent.com/mapserver/mapserver/branch-7-0/msautotest/wxs/data/obs.csv
              hreflang: en-US
        extents:
            spatial:
                bbox: [-180,-90,180,90]
                crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
            temporal:
                begin: 2000-10-30T18:24:39Z
                end: 2007-10-30T08:57:29Z
        providers:
            - type: feature
              name: CSV
              data: tests/data/obs.csv
              id_field: id
              geometry:
                  x_field: long
                  y_field: lat

In the sample above, even if I only specified values for the logging and resources config keys, pygeoapi would merge this with its own default configuration and would still be able to run.

Describe alternatives you've considered
The alternative of leaving things as they are also works - I think this would be a way to simplify user's configuration files on some use cases.

@ricardogsilva ricardogsilva added the enhancement New feature or request label Jan 23, 2024
Copy link

This Issue has been inactive for 90 days. As per RFC4, in order to manage maintenance burden, it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale Issue marked stale by stale-bot label Apr 28, 2024
Copy link

As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Issue marked stale by stale-bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant