Skip to content

Spherical Geometry Operators Using the S2 Geometry Library

10packages dependsuggested by 14
3.9Mdownloads / year
54.4%test coverage
13/13flavors OK

Overview

About

Provides R bindings for Google's s2 library for geometric calculations on the sphere. High-performance constructors and exporters provide high compatibility with existing spatial packages, transformers construct new geometries from existing geometries, predicates provide a means to select geometries based on spatial relationships, and accessors extract information about geometries.

Changes in 1.1.13
  • Fix MacOS build; #306
  • Fix Abseil usage; #305

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 20.9 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-10-01
  • WARNING12 OK, 1 WARNING2026-09-29
  • ERROR4 OK, 5 WARNING, 4 ERROR2026-09-04
  • WARNING12 OK, 1 WARNING2026-07-24
  • OK13 OK2026-06-09
Show 5 earlier changesHide 5 earlier changes
  • WARNING12 OK, 1 WARNING2026-06-08
  • OK13 OK2026-06-07
  • WARNING9 OK, 3 NOTE, 2 WARNING2026-04-22
  • ERROR8 OK, 3 NOTE, 2 WARNING, 1 ERROR2026-04-18
  • WARNING9 OK, 3 NOTE, 2 WARNING2026-03-10
Advisories

none known

Documentation

In release 1.1.13
READMEYes · 286 wordsVignettesNoNEWSYes · 100% structured · mentions 1.1.13Citation fileNoWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
21 (1 internal)includes a package overview page
Examples that run
100%14 run in a plain check
Exported functions with examples
74%
Documented parameters
67%
Return-value docs
53%
Help pages citing references
5%

Downloads

3.9M
CRAN downloads in the past year
Rank #209 · ~10.6K/day · ~322.3K/mo
Daily download trend is not available in this view yet.
245.5K30 days
726.8K90 days
3.9M1 year
Compare downloads with other packages →
Also on45.1K r2u8 autocran101.5K conda_forge1.1K c2d4u

Repository

82Stars
20Forks
20Open issues
1Open PRs
11Releases
968Commits
19Commit identities
968 commits · Last activity 2026-09-29 · +1.2% stars, 30d · Default branch at 1.1.14, ahead of CRAN 1.1.13 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
95%
Median days to close, 50 most recently updated closed issues
13
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2025-08-13 · 762026-09-30 · 82
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/r-spatial/s2 on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow

pkgdown site last built 2026-09-29

Coverage (2)
Coverage reporting.covrignore
Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
Lint, format, editor (1)
RStudio project
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
7 external dependencies (excludes base and recommended)

Installing s2 adds 2 packages (2 with compiled code, 2.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB, wk 1.0 MB.

Depends (1)
R >= 3.0.0
Imports (2)
LinkingTo (2)
Suggests (3)
Enhances (0)
none
Reverse dependencies
10direct
1,173indirect
Imports 10
Suggested by 14
Show all 24 packagesHide all 24 packages
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (5)
Author, Maintainer since 1.0.0 (2020) · added in 0.3-0
Author · added in 1.0.0
Author
Contributor
configure script
Copyright holder
Original s2geometry.io source code

Previously maintained by Ege Rubak (0.1-1 to 0.4-2).

Releases (25)

Pick two releases to compare their code metrics.

Show 20 earlier eventsHide 20 earlier events
  • 1.1.0
    record
    2022-07-18 · diff ↗ ·
    removed 2 exports
    s2_projection_filter, s2_unprojection_filter
    added 25 exports
    as_s2_cell_union, s2_cell_common_ancestor_level, s2_cell_common_ancestor_level_agg, s2_cell_union, s2_cell_union_contains, s2_cell_union_difference, s2_cell_union_intersection, s2_cell_union_intersects, s2_cell_union_normalize, s2_cell_union_union, s2_convex_hull, s2_convex_hull_agg, s2_covering_cell_ids, s2_covering_cell_ids_agg, s2_geography_writer, s2_hemisphere, s2_plot, s2_point_crs, s2_point_on_surface, s2_prepared_dwithin, s2_projection_orthographic, s2_tessellate_tol_default, s2_trans_lnglat, s2_trans_point, s2_world_plate_carree
  • R
    R 4.2.0 released · 2022-04-22
  • 1.0.7
    record
    2021-09-28 · diff ↗
  • 1.0.6
    record
    2021-06-17 · diff ↗
  • 1.0.5
    record
    2021-06-01 · diff ↗ ·
    added 38 exports
    as_s2_cell, new_s2_cell, s2_cell, s2_cell_area, s2_cell_area_approx, s2_cell_boundary, s2_cell_center, s2_cell_child, s2_cell_contains, s2_cell_debug_string, s2_cell_distance, s2_cell_edge_neighbour, s2_cell_invalid, s2_cell_is_face, s2_cell_is_leaf, s2_cell_is_valid, s2_cell_level, s2_cell_max_distance, s2_cell_may_intersect, s2_cell_parent, s2_cell_polygon, s2_cell_sentinel, s2_cell_to_lnglat, s2_cell_vertex, s2_closest_edges, s2_coverage_union_agg, s2_geography, s2_interpolate, s2_interpolate_normalized, s2_is_valid and 8 more
  • R
    R 4.1.0 released · 2021-05-18
  • 1.0.4
    record
    2021-01-05 · diff ↗
  • 1.0.3
    record
    2020-10-14 · diff ↗
  • 1.0.2
    record
    2020-08-03 · diff ↗
  • 1.0.1
    record
    2020-07-13 · diff ↗ ·
    removed 2 exports
    as_s2_latlng, s2_latlng
    added 7 exports
    as_s2_lnglat, s2_bounds_cap, s2_bounds_rect, s2_lnglat, s2_may_intersect_matrix, s2_rebuild, s2_simplify
  • 1.0.0
    record
    2020-06-28 · diff ↗ ·
    removed 21 exports
    S2CapFromAxisHeight, S2Cap_Contains, S2Cap_GetRectBound, S2Cap_area, S2Cell, S2CellIdFromPoint, S2CellId_ToPoint, S2CellId_ToString, S2Covering, S2LatLngRect, S2LatLngRect_area, S2Point_interpolate, S2Polygon, S2Polygon_Contains, S2Polygon_intersection, S2Polygon_union, S2Polygons_area, S2Polygons_centroid, S2Polygons_intersect, S2Polygons_intersection, S2Polyline_dist
    added 67 exports
    as_s2_geography, as_s2_latlng, as_s2_point, s2_area, s2_as_binary, s2_as_text, s2_boundary, s2_buffer_cells, s2_centroid, s2_centroid_agg, s2_closest_feature, s2_closest_point, s2_contains, s2_contains_matrix, s2_covered_by, s2_covered_by_matrix, s2_covers, s2_covers_matrix, s2_data_cities, s2_data_countries, s2_data_timezones, s2_difference, s2_dimension, s2_disjoint, s2_disjoint_matrix, s2_distance, s2_distance_matrix, s2_dwithin, s2_dwithin_matrix, s2_earth_radius_meters and 37 more
  • R
    R 4.0.0 released · 2020-04-24
  • 0.4-2
    record
    2019-08-30 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • 0.4-0
    record
    2018-04-21 · diff ↗
  • 0.3-0
    record
    2017-12-10 · diff ↗ ·
    removed 1 export
    cell_center
    added 21 exports
    S2CapFromAxisHeight, S2Cap_Contains, S2Cap_GetRectBound, S2Cap_area, S2Cell, S2CellIdFromPoint, S2CellId_ToPoint, S2CellId_ToString, S2Covering, S2LatLngRect, S2LatLngRect_area, S2Point_interpolate, S2Polygon, S2Polygon_Contains, S2Polygon_intersection, S2Polygon_union, S2Polygons_area, S2Polygons_centroid, S2Polygons_intersect, S2Polygons_intersection, S2Polyline_dist
  • R
    R 3.4.0 released · 2017-04-21
  • 0.1-1
    record
    2016-11-04
  • R
    R 3.3.0 released · 2016-05-03

Package metadata

First published
2016-11-04
Total releases
25 / 10 yrs
License
Apache License (== 2.0)
Minimum R
≥ 3.0.0
Bundled data
647 KB / 4 files
Download size
2.8 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("s2")
Pebesma, E., Dunnington, D., Google, Inc., , Ooms, J., & Rubak, E. (2026). s2: Spherical Geometry Operators Using the S2 Geometry Library (Version 1.1.13) [Computer software]. https://doi.org/10.32614/CRAN.package.s2

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for s2 version 1.1.13 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy