mmcloughlin/globe

Overlapping points causes a turquoise noise/artefact

JamesLMilner opened this issue · 5 comments

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

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.

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

Sorry it's a bit of a mess.

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

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?

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.