Home | Not logged in
<<< Back to blog

Interative Universe Map

Written by Stephen
January 08, 2020

This is another project from the backlog that I hadn't had time to post about. Written sometime in summer 2019 is my interactive universe map. It is a Google-Maps-like interface for browsing a 600MB image which was created by astronomers by stitching together many pictures from the Hubble telescope.

For the frontend, I am using Leaflet. It is a Javascript library for viewing raster maps. Essentially, it looks for 256x256 tiles at /z/x/y, where z is the zoom level and (x, y) are the coordinates of the picture. Zoom level 0 is the original image(scaled down, of course). Zoom level 1 consists of four images - one for each quadrant of the original picture. This pattern repeats down until the max zoom level of z=7.

Originally, I wrote a Node.JS server to dynamically generate each tile as it was requested. However, I was unable to manipulate a 600MB image quickly enough for this to be viable. I ended up writing a Python script to generate every tile, which could be served statically. All of the tiles combined take up less than 5GB of space on my web server.

I may revisit this project. I would like to write something similar, but automate it completely, allowing anyone to upload their own huge image and be able to view it easily. Of course, I would use Ruby on Rails now instead of Node.JS.

Check it out: https://galaxy.scd31.com/

0 comments Categories: Uncategorized

Leave a comment

You have to sign in to leave a comment.