Skip to content

WIP: Directional tiles#1

Open
honzaflash wants to merge 7 commits into
mainfrom
directional-tiles
Open

WIP: Directional tiles#1
honzaflash wants to merge 7 commits into
mainfrom
directional-tiles

Conversation

@honzaflash

Copy link
Copy Markdown
Collaborator

What

  • bit of refactoring to make room for new GetMap query rendering style
    • GetMap query model redefined a bit to match ncwms more (but should be completely backwards compatible)
  • implementing an "arrows" style that draws arrows for a vector direction scalar variable

We want to support server-side rendering of directional arrow overlay tiles. These could be overlayed with magnitude tiles by the client.

xpublish-community#146

- move the mesh generation and shading from `render` body to their own methods and refactor small things
  - also use autoscale when `colorscalerrange` is `None` for type checker's sake even though
    validation ensures this happens only when `autoscale` is `True`
- fix an overly narrow type hint (caused type error elsewhere)
- move styles related query parameter processing to its own function too and refactor a little
- update the GetMap query model in a backwards compatible way to support more ncWMS-like parameters
  - `styles` will be used to set colormap/arrows/...
  - `palette` will be used to specify colormap name
  - but colormap name in `styles` is still supported
- get_map.py was getting long so move it into a dir module
- add an "arrows" style for visualizing vector direction
- implement the directional arrows rendering option
- use cos/sin instead of the inverse to get the coordinate from the angle
- fix:
  - typo in string literal
  - wrong mesh type hint
  - mesh indexing and rendering scale
  - inverted Y axis
- also rename/refactor a little more
- make color and density configurable by user
- store output style options nested in an object instead of flat as attributes of GetMap
  - this way the class isn't polluted by attributes not relevant to the used rendering style
  - type checker can infer stuff based on the discriminator field (`styles.type`)
- test query parameter parsing for the arrows and colormap style options
- drop scale parameter as it is redundant after the mesh is projected (bbox and pixel dimensions are given by user, glyph density can still be configured by user)
- generalize tile size handling for rectangles
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.

1 participant