About Surfsquare

Motivation

Surfing changed my life. I am from the country without the Ocean, so I had to move somewhere. This "somewhere" is in my case Cantabria, Spain. That is why only Cantabria's spots are listed in the Surfsquare (at least for now)...

Once I moved there I wanted an Apple Watch application with the surf and tide forecast, but I wasn't able to find any application which works reliably in the area at the time. So I thought I can just download data from some service and display it on the Watch.

I had started to dig deeper in the fascinating world of the weather and wave forecasting and I have found out that data from Météo France have a great resolution for my area. I have also started to learn new programming language approximately at the same time and that's how Surfsquare was born. I still don't have the Apple Watch app though...

Data

Surfsquare provides various metrics for the surf forecast. Some of them are calculated directly by Surfsquare, but most of metrics like swell height, wind speed etc are downloaded from the data providers.

The calculated metrics (moon phase, sunrise, sunset) are not 100% accurate, but they are precise enough to give us some picture about the conditions in the near future: For example moon phase is important for predicting water level at low/high tide, but we probably don't need moon phase prediction per minute exactly...

Forecast provided by the data providers is not calculated for every place in the world (meaning that the value is not calculated for each millimetre of the Earth's surface). This would be computationally difficult. For that reason forecasts are calculated for some grid specified by its resolution. For example grid with resolution 1° means that Earth is divided into cells by 1° latitude and longitude. In this case, cell dimensions are approx. 110 x 110 km. This means that the same values are predicted for each point in the cell. In the case of surf forecast it means that all surf spots in the same cell are sharing the same prediction values (like swell height, period etc).

Normally global forecast model data has low resolution with big cells and local forecast model data has high resolution with smaller cells (but the coverage is typically limited for some smaller area).

Data obtained from external providers are downloaded, processed and stored multiple times per day. For more information see particular provider section below.

Météo France

Météo France offers various forecast models for weather (like air temperature) and for waves (like swell period).

MFWAM

MFWAM is wave prediction model providing metrics like significant height of primary swell, mean direction of primary swell, mean period of primary swell etc. Météo France is offering the result of the model in the following resolutions.

  • 0.025° – France coverage (and part of northern Spain) – forecast is calculated for the next 42 hours
  • 0.1° – Europe coverage – forecast is calculated for the next 114 hours
  • 0.5° – World coverage – forecast is calculated for the next 114 hours – not downloaded by Surfsquare

AROME

AROME is atmospheric forecast model providing metrics like temperature, cloud coverage, precipitation rate etc. Météo France is offering the result with the coverage of France (and part of northern Spain), the resolution is 0.025°. The forecast is for the next 42 hours.

ARPÈGE

ARPÈGE is a global atmospheric forecast model providing metrics like temperature, cloud coverage, precipitation rate etc. Météo France is offering the result of the model in the following resolutions.

  • 0.1° – Europe coverage – forecast is calculated for the next 114 hours
  • 0.5° – World coverage – forecast is calculated for the next 114 hours – not downloaded by Surfsquare

All models are computed by Météo France four times per day. Surfsquare is checking Météo France for new data every 30 minutes.

Marea Tides API

Marea Tides API offers prediction for the tides for any location in the world based on a worldwide data of tidal constituents. This tidal data is not 100% accurate and should give you just some picture about the water level. The data should not be used for navigational purposes.

Surf spots

Surfsquare provides surf forecast only for approximately 20 surf spots located in Cantabria, Spain at the moment. The plan is to add rest of the spots in northern Spain, France and Portugal and after that the rest of Europe (for now, Surfsquare is downloading data just for the Europe). If you want to add some surf spot you can for now just write an email. In the future there will be the web form for this.

Technology

The Surfsquare existence is possible thanks to awesome data providers, beautiful map tiles provider and great open-source libraries.

Map tiles

This beautiful map tiles are created by Stamen Design, served by Stadia Maps, licensed under CC BY 3.0. Map data are provided by OpenStreetMap, licensed under CC BY SA. Maps are created using great JavaScript library called Leaflet.

Open-source

Application is written using Elixir language and Phoenix web framework without any external database (all data are stored in memory).

Libraries
  • wgrib2 – open-source library by Climate Prediction Center is used for reading GRIB data format which is often used in meteorology to store historical and forecast data
  • Docker – software technology providing operating-system-level virtualization
  • Leaflet – JavaScript library for interactive maps
  • D3.js – used for data visualizations. For example "compass" located in the map in surf forecast is created by D3.js
  • Bulma – open-source CSS framework
  • Moon – JavaScript user interface library used for example for surf spot search
  • Fuse.js – lightweight fuzzy-search JavaScript library used for example for surf spot search
  • Tocbot – JavaScript library for generating table of contents based on page content (like the one on this page)

Services

There are couple of services which are making Surfsquare development easier.

Contact

Hi, my name is Vojtech Hyza and Surfsquare is my pet project. If you want to ask some question, suggest an idea, add surf spot or just say hi, you can contact me at shaka@surfsquare.org.