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

Overlapping points causes a turquoise noise/artefact #6

Closed
JamesLMilner opened this issue Jul 26, 2017 · 5 comments
Closed

Overlapping points causes a turquoise noise/artefact #6

JamesLMilner opened this issue Jul 26, 2017 · 5 comments

Comments

@JamesLMilner
Copy link

Firstly thanks for the great library! Top work.

I noticed that using GeoJSON files with overlapping points sometimes produces these strange turquoise noise effects. Any way to combat/fix that behaviour?

eb41b547-aa7e-4402-a47e-1baf9b10e6c5

@mmcloughlin
Copy link
Owner

Well, that's not good :( Do you mind sharing code to reproduce this? I have an idea of what it might be but the code would help.

Thanks for filing the issue.

@JamesLMilner
Copy link
Author

Yeah for sure, check out: https://github.com/JamesMilnerUK/globe-plotter

Sorry it's a bit of a mess.

@mmcloughlin
Copy link
Owner

Nice project!

Can you try using color.NRGBA instead? I certainly noticed that color.RGBA can produce this kind of problem. Here's an example:

https://gist.github.com/mmcloughlin/e824139574762169ce7f232fd76da9df

@JamesLMilner
Copy link
Author

JamesLMilner commented Jul 27, 2017

Huzzah! this was indeed the problem. Other slight issue was I hadn't been paying attention in that JavaScript / CSS takes the standard of (uint8, uint8, uint8, float64) but after some minor type conversion this was fine:

screenshot_20170727_213200

Relevant type conversion code:

	g := globe.New()
	alpha := uint8(rgbaColors.A * 255) // i.e. 0.5 * 255 
	color := color.NRGBA{rgbaColors.R, rgbaColors.G, rgbaColors.B, alpha} 

Edit: Is it worth potentially documenting this issue in the README?

@mmcloughlin
Copy link
Owner

Glad we could sort this out! I dropped a note in the README, because the very same issue confused me in the past. Thanks again for filing the issue.

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

2 participants