Home Featured S2 cells and Pokémon GO

S2 cells and Pokémon GO

S2 cells and Pokémon GO
S2 Cells Pokémon GO

S2 cells are a fundamental part of Pokémon GO’s game design and interaction. Pokemon Go, like Ingress, uses S2 cells to divide the surface area of the Earth into regions of flexible size. In this beginners guide we’ll explain two things in a simplistic and easy to understand style:

  • What are S2 cells?
  • How S2 cells influence Pokémon GO?

After reading this guide, you should be fully capable of understanding and exploring the magical world of S2 cells in your local area.

What are S2 cells?

S2 cells are developer-friendly geographical markers used to map the Earth’ surface. S2 cells were invented at Google and are extensively used on Google Maps to perform quick geographical indexes and queries. The name “S2” is derived from the mathematical notation for the unit sphere, S². 

S2 cells come in different sizes (levels) and regions they cover. Here’s how they look like:

Various sizes of S2 cells on the world map
Various sizes of S2 cells on the world map

S2 cells are not a concept you will usually find in high school or university level geography, but they are well known among the software developer community, mostly due to an incredible open source library published by Google: S2 Geometry library.

The S2 library provides many useful features for developers (a full list is available here):

  • The ability to approximate regions as collections of discrete “S2 cells”. This feature makes it easy to build game features that depend on the concept of region, such as EX Raid events, Pokémon caught location, etc.
  • Algorithms for measuring distances and finding nearby objects.
  • Geometric shapes over the unit sphere, such as spherical caps (“discs”), latitude-longitude rectangles, polylines, and polygons.

The majority of Pokémon GO’s Pokémon behaviour (including spawns, nests, catch locations…) is based around different sizes of S2 cells. In the next section we’ll see which Pokémon GO features are connected to S2 cells.

How S2 cells influence Pokémon GO?

Different sizes of S2 cells are used for different features in Pokémon GO. The following table is an overview of known S2 cell usages. Remember, S2 level is “essentially” the same thing as “size”. Don’t worry, we go into more details (with pictures) about specific levels under the table.

Level Usage Avg. size
Level 6 Geoblocking areas (North Korea, China) 20754.64 km2
Legendary beast boundaries
Level 10 Pokémon caught location 81.07 km2
Raid boss caught location
EX Raid trigger for raids that took place on Feb 10/11 2018
Level 13 EX Raid trigger 5.07 km2
Biomes (still in research)
Level 14 Gym placement and creation 0.32 km2
Level 15 Restricted access areas (military bases) 0.079 km2
Level 16 In-game map object rendering 0.019 km2
Level 17 Stop placement 4948.29 m2
Level 20 Spawn placement 77.32 m2
Gym location
Egg pick-up and hatch location

Level 6 usage was discovered by two redditors (username337 and Dot1Four) on their observations and expeditions to the real world. Username337 found the exact line in China which is used to separate the Pokémon world from the rest of China. That line is now known as the DPZ (De-Pokemonized Zone) and looks like this:

Level 20 cells are used to generate Pokémon spawns. A Pokémon can only spawn in the center of a Level 20 S2 cell, as visualized on the picture below. The picture was made by overlaying the S20 mesh over the in-game map. Similarly, Egg hatch location is determined by a L20 cell.

Further reading and tools