Improving our contour algorithm

Thumbnail for 51777

Last week we featured a tool for drawing contours which uses the Mapzen altitude API. We used a very simple algorithm called ‘Marching Squares’ that we found on Wikipedia. However, as GEB reader Боби Димитров pointed out in the comments, if you try to use too low a resolution altitude grid relative to the number of contours you want, you end up with something looking like abstract art:

The Marching Squares algorithm is remarkably simple. We just check every altitude from the grid obtained from the Mapzen API and colour it red or green based on whether it is above or below the altitude of the contour we wish to draw. Then we draw lines separating the two colours from the mid points of the rectangles in the grid as shown below:

However, we realised that if between a red and green dot rather than using the mid point, we check the altitudes of the points relative to our contour altitude and then use a point proportionally closer to the point closest to our contour altitude, we end up with a much better result:

All the settings were the same as the ‘abstract art’ sample above, except we use proportional …read more

Continue reading

Graphene under pressure

(University of Manchester) Small balloons made from one-atom-thick material graphene can withstand enormous pressures, much higher than those at the bottom of the deepest ocean, scientists at the University of Manchester report. …read more

Continue reading

Study: Unconventional natural gas wells associated with migraine, fatigue

(Johns Hopkins University Bloomberg School of Public Health) New research suggests that Pennsylvania residents with the highest exposure to active natural gas wells operated by the hydraulic fracturing (‘fracking’) industry are nearly twice as likely to suffer from a combination of migraine headaches, chronic nasal and sinus symptoms and severe fatigue. …read more

Continue reading

Collaborative launch of immunotherapy clinical trial for children with brain tumors

(Solving Kids’ Cancer) A Kids’ Brain Tumor Cure Foundation, Solving Kids’ Cancer and the Ty Louis Campbell (TLC) Foundation announce their joint financial support of a Phase 1 clinical trial to test the safety and efficacy of combination checkpoint inhibitors in the treatment of children with brain tumors. The collaboration of these three like-minded nonprofits will result in a total contribution of $185,000 to bring this clinical trial to fruition for children battling brain tumors, today. …read more

Continue reading

Cape Hatteras National Seashore

Thumbnail for 51748
Cape Hatteras National Seashore

On most summer days, a trip to North Carolina’s Outer Banks means a peaceful day at the beach, but there is evidence all around that this beach is not always so serene.

…read more

Continue reading

Fossilized Rivers Suggest Mars Was Once Warm and Wet

Extensive systems of fossilised riverbeds have been discovered on an ancient region of the Martian surface, supporting the idea that the now cold and dry Red Planet had a warm and wet climate about 4 billion years ago, according to UCL-led research.

…read more

Continue reading

Turning Sunlight into Fuel

Thumbnail for 51755

The world uses little more than one percent of the sun’s energy for our electricity needs. A major obstacle to tapping into its full potential is that it is intermittent. Solar fuels could one day store, transport and use solar energy to produce electricity and replace fossil fuels in vehicles. …read more

Continue reading