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

Separating the render method into an implementable class #99

Open
3 tasks
kamicut opened this issue Jun 26, 2018 · 1 comment
Open
3 tasks

Separating the render method into an implementable class #99

kamicut opened this issue Jun 26, 2018 · 1 comment

Comments

@kamicut
Copy link

kamicut commented Jun 26, 2018

I am proposing that we separate the rendering function from sources to tiles into its own implementable class. Currently, there are no hooks to control how to render single band or multi-banded sources. This leads to ad-hoc recipes specific to certain catalogs.

This will enable us to have more controls over pre-processing, band selection and post-processing. render right now takes 3-band arrays and turns them into tiles. After talking with @mojodna, we think it could be the other way around, where single bands are the inputs to render. With some refactoring, we could think of inputs to rendering as a function of n bands that outputs an rgb tile. This would allow any catalog to provide single band or multi-band Sources and give us the flexibility to composite bands from different catalogs.

A preliminary plan (out of order):

  • Move preprocessing to Sources, so a Source knows how to preprocess itself
  • Make PixelCollection single-banded only
  • Write render function examples that takes n x PixelCollection and turns that into a tile for 3-banded and 1-banded sources.

Potential drawbacks to this approach would be that marblecutter implementations moving forward would need to implement both a Catalog and a render method instead of just a catalog. This extra layer of indirection would make a user guide necessary. Another drawback is that this breaks compatibility with previous marblecutter implementations.

Anything I missed @mojodna?

@kamicut
Copy link
Author

kamicut commented Jun 26, 2018

@mojodna Since read_window also takes a "recipes" argument, I wonder if each Source should declare its own read_window function (that could tie in a pre-process function). Unless there might be another way to remove the custom code path in read_window?

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

No branches or pull requests

1 participant