Show HN: Globe visualizations in Golang
github.com
github.com
gg and pinhole made this easy to write. The globe package really just deals with mapping (lat, lng) space to cartestian coordinates (and also includes some land/country datasets).
This may or may not be useful, but here's a Go package containing a bunch of city data. It might be a good fit for people using your project.
https://github.com/mmcloughlin/globe/blob/master/examples/ci...
In fact I might switch it, since the cities json file I used has some oddities.
Layers, visualized:
https://godoc.org/github.com/mmcloughlin/globe?import-graph&...
Keep it up!
The only critique I have here is to see some benchmarks! :)
Also credit has to go to https://github.com/tidwall/pinhole where all the actual rendering happens!
I have no idea what kind of cities might be listed in 'cities.json'.
https://github.com/mmcloughlin/globe/blob/master/examples/Ma...
It came from this node package
https://www.npmjs.com/package/cities.json/
It looks like the dataset has more cities in some countries than others.
Interactive would be hard. It would be relatively simple to output an animated gif though, as the pinhole library does here
https://github.com/tidwall/pinhole/blob/master/examples/eart...
I'm planning to add this feature.
For example, you wouldn’t be able to get the shapes of continents along with the size of the whole globe in Google Earth visually match the projection under “line” example in README.
[0] https://earth.google.com/web/@54.45747286,-25.48168721,-8084...
1. https://en.wikipedia.org/wiki/Map_projection
2. https://en.wikipedia.org/wiki/Geographic_coordinate_system
The left and right side of the rectangle are correctly bent around the shape of the globe. However, the top and bottom sides of the rectangle are not. Is this intention (or am I being stupid?)
Was there a particular reason why you chose Go to implement this? (strong side of the language or sth like that)
I guess I wanted to use it to visualize data coming from other Go projects I was working on, so it made sense. A tiny example of this is https://github.com/mmcloughlin/spherand which correctly generates random points on a sphere. I also had seen pinhole (https://github.com/tidwall/pinhole) and thought it would be fun to play around with.
https://godoc.org/github.com/mmcloughlin/globe#Globe.Image
This can be passed to an image encoder like
https://golang.org/pkg/image/png/#Encode https://golang.org/pkg/image/gif/#Encode https://golang.org/pkg/image/jpeg/#Encode
These functions take io.Writer objects. SavePNG was provided for convenience.
Thanks!
Two people see cool sideproject in Go, his thoughts "damn this looks good, I need to learn Go", my thoughts "Whyyy you do this in Go and not D? Simplistic Go has no strong sides here! Why nobody promotes my favourite language with things like this, it deserves hype no less!"
Simplistic Go has a lot going for it - focussing on knocking out cool projects rather than the minutiae of build/package/dependency systems is one of them.
Anyway, care to elaborate whats wrong with excellent build/package/dependency system in D called Dub? Never had any problems with it.
I gave up after the Urban dictionary link. I assume you're trolling?
This is easily negated by the increased brain time required for using a 1960s type system.