cambecc/earth is one of the open-source repositories TopGit tracks, currently at 6.6k stars, written primarily in JavaScript. a project to visualize global weather conditions
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
NOTE: the location of dev-server.js has changed from {repository}/server/ to {repository}/
"earth" is a project to visualize global weather conditions.
A customized instance of "earth" is available at http://earth.nullschool.net.
"earth" is a personal project I've used to learn javascript and browser programming, and is based on the earlier
Tokyo Wind Map project. Feedback and contributions are welcome! ...especially
those that clarify accepted best practices.
building and launching
After installing node.js and npm, clone "earth" and install dependencies:
git clone https://github.com/cambecc/earth
cd earth
npm install
Next, launch the development web server:
node dev-server.js 8080
Finally, point your browser to:
http://localhost:8080
The server acts as a stand-in for static S3 bucket hosting and so contains almost no server-side logic. It
serves all files located in the earth/public directory. See public/index.html and public/libs/earth/*.js
for the main entry points. Data files are located in the public/data directory, and there is one sample
weather layer located at data/weather/current.
*For Ubuntu, Mint, and elementary OS, use nodejs instead of node instead due to a naming conflict.
getting map data
Map data is provided by Natural Earth but must be converted to
TopoJSON format. We make use of a couple different map scales: a
simplified, larger scale for animation and a more detailed, smaller scale for static display. After installing
GDAL and TopoJSON (see here), the
following commands build these files:
Weather data is produced by the Global Forecast System (GFS),
operated by the US National Weather Service. Forecasts are produced four times daily and made available for
download from NOMADS. The files are in GRIB2
format and contain over 300 records.
We need only a few of these records to visualize wind data at a particular isobar. The following commands download
the 1000 hPa wind vectors and convert them to JSON format using the grib2json
utility:
This project uses M+ FONTS. To reduce download size, a subset font is
constructed out of the unique characters utilized by the site. See the earth/server/font/findChars.js script
for details. Font subsetting is performed by the M+Web FONTS Subsetter, and
the resulting font is placed in earth/public/styles.
Mono Social Icons Font is used for scalable, social networking
icons. This can be subsetted using Font Squirrel's WebFont Generator.
implementation notes
Building this project required solutions to some interesting problems. Here are a few:
The GFS grid has a resolution of 1°. Intermediate points are interpolated in the browser using bilinear
interpolation. This operation is quite costly.
Each type of projection warps and distorts the earth in a particular way, and the degree of distortion must
be calculated for each point (x, y) to ensure wind particle paths are rendered correctly. For example,
imagine looking at a globe where a wind particle is moving north from the equator. If the particle starts
from the center, it will trace a path straight up. However, if the particle starts from the globe's edge,
it will trace a path that curves toward the pole. Finite difference approximations
are used to estimate this distortion during the interpolation process.
The SVG map of the earth is overlaid with an HTML5 Canvas, where the animation is drawn. Another HTML5
Canvas sits on top and displays the colored overlay. Both canvases must know where the boundaries of the
globe are rendered by the SVG engine, but this pixel-for-pixel information is difficult to obtain directly
from the SVG elements. To workaround this problem, the globe's bounding sphere is re-rendered to a
detached Canvas element, and the Canvas' pixels operate as a mask to distinguish points that lie outside
and inside the globe's bounds.
Most configuration options are persisted in the hash fragment to allow deep linking and back-button
navigation. I use a backbone.js Model to represent the configuration.
Changes to the model persist to the hash fragment (and vice versa) and trigger "change" events which flow to
other components.
Components use backbone.js Events to trigger changes in other downstream
components. For example, downloading a new layer produces a new grid, which triggers reinterpolation, which
in turn triggers a new particle animator. Events flow through the page without much coordination,
sometimes causing visual artifacts that (usually) quickly disappear.
There's gotta be a better way to do this. Any ideas?
inspiration
The awesome hint.fm wind map and D3.js visualization library provided
the main inspiration for this project.
TopGit's last sync did not record any GitHub topics for cambecc/earth. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on cambecc/earth?
The most recent commit recorded on cambecc/earth was 4.1 years ago, based on the GitHub push timestamp. The repository has 1.3k forks — one of the better signals of community interest.
How many stars does cambecc/earth have?
cambecc/earth has 6.6k GitHub stars — refresh the page for the live number, or check github.com/cambecc/earth. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is cambecc/earth open source?
Yes — cambecc/earth ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/cambecc/earth.
Where can I see cambecc/earth in action?
The project maintains a homepage at http://earth.nullschool.net. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about cambecc/earth?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/cambecc/earth is the definitive source.
Read full README in the tab above.
Still deciding about earth?
One click hands the question to an AI along with this page — see what it says about earth.