Skip to content

Clarification on supported formatter types #2253

@webb-ben

Description

@webb-ben

Is your feature request related to a problem? Please describe.
It is unclear how a formatter is supposed to discern the type of data it is formatting. As implemented,

def get_dataset_formatters(dataset: dict) -> dict:

is called for a Feature and EDR provider. As such any formatter can receive CoverageJSON or GeoJSON based data. Furthermore, any formatter that exists in

'formatter': {
'CSV': 'pygeoapi.formatter.csv_.CSVFormatter'
},
here is default enabled, everything else is opt-in. Configuring a CovJSON -> CSV formatter would subsume the default formatter, thereby breaking the GeoJSON -> CSV default formatter.

Describe the solution you'd like
#2235 begins to address this by adding a simple point CovJSON -> CSV functionality. This does not take an opinion on the enabling of formatters. For an EDR provider to ever use the formatter it would have to be configured. Not sure if this is the intended behavior.

Describe alternatives you've considered
Formatters could be specific for a provider but even then an EDR provider for /locations is liable to return both GeoJSON and CovJSON

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions