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

add legend information to coverages #231

Conversation

ricardogsilva
Copy link

This PR adds additional information to the coverage configuration detail endpoint (/api/v2/coverages7coverage-configurations/{cov-conf-if}) to expose information useful for generating a WMS legend graphic on the client side.

As seen below, the new legend property is a list of objects with colors and the respective value it represents on the underlying dataset.

{
  "url": "http://localhost:8877/api/v2/coverages/coverage-configurations/911e753a-1dc4-42e1-988b-3e514b885c9b",
  "id": "911e753a-1dc4-42e1-988b-3e514b885c9b",
  "name": "cdd_30yr_anomaly_seasonal_agree_model_ensemble",
  "legend": {
    "color_entries": [
      {
        "value": -40,
        "color": "#FF003c30"
      },
      {
        "value": -32,
        "color": "#FF01665e"
      },
      {
        "value": -24,
        "color": "#FF35978f"
      },
      {
        "value": -16,
        "color": "#FF80cdc1"
      },
      {
        "value": -8,
        "color": "#FFc7eae5"
      },
      {
        "value": 0,
        "color": "#FFf5f5f5"
      },
      {
        "value": 8,
        "color": "#FFf6e8c3"
      },
      {
        "value": 16,
        "color": "#FFdfc27d"
      },
      {
        "value": 24,
        "color": "#FFbf812d"
      },
      {
        "value": 32,
        "color": "#FF8c510a"
      },
      {
        "value": 40,
        "color": "#FF543005"
      }
    ]
  }
}

@ricardogsilva ricardogsilva changed the title 229 add legend information to coverages add legend information to coverages Sep 16, 2024
@ricardogsilva ricardogsilva marked this pull request as ready for review September 16, 2024 15:53
@ricardogsilva ricardogsilva force-pushed the 229-add-legend-information-to-coverages branch from c960295 to 8e497e1 Compare September 17, 2024 12:33
@ricardogsilva
Copy link
Author

@francbartoli conflicts are now resolved

@francbartoli francbartoli merged commit 2b02a47 into geobeyond:main Sep 17, 2024
1 check passed
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.

Add legend information to coverages
2 participants