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

AREAFILL issue #1

Open
ghansham opened this issue May 20, 2020 · 0 comments
Open

AREAFILL issue #1

ghansham opened this issue May 20, 2020 · 0 comments

Comments

@ghansham
Copy link

ghansham commented May 20, 2020

I feel the color picked in fillSquare method is not correct.

col = cmap.getColorByIndex(cindex+1);

The reasons is it seems it is assuming that number of contour levels and number of colors in color map are equal. which may not be the case.

Better solution will be to pick color by using following:

//col = cmap.getColorByIndex(cindex + 1);
if (zmin > zlevp1 || zmax < zlev) {
continue;
}
try {
col = attr_.getColorMap().getColor(clevels.getLevel(cindex + 1));
} catch (ContourLevelNotFoundException ex) {
col = cmap.getColorByIndex(cindex + 1);
}
Kindly correct me if I am incorrect. I have tested it never goes into catch. Just a fallback option.
I am attaching the current and proposed areafill snapshots by running JGridDemo.
The proposed matches closely to the raster in terms of color map.

current_areafill_grid_demo
proposed_area_fill_grid_demo
raster_grid_demo

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