Spherical Geometry Operators Using the S2 Geometry Library
Overview
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.
- Fix MacOS build; #306
- Fix Abseil usage; #305
From NEWS.md in the release
Install
Health
- 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
Documentation
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
Repository
- 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
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
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.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow
pkgdown site last built 2026-09-29
Show all practicesHide 2 practices
Dependencies
Installing s2 adds 2 packages (2 with compiled code, 2.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB, wk 1.0 MB.
Show all 24 packagesHide all 24 packages
Code & Tests
Datasets
People & History
Previously maintained by Ege Rubak (0.1-1 to 0.4-2).
Pick two releases to compare their code metrics.
- 1.1.13Latest
- 1.1.122026-09-03 · diff ↗
- 1.1.112026-06-01 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 1.1.92025-05-23 · diff ↗
- 1.1.82025-05-12 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 1.1.72024-07-17 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.1.62023-12-19 · diff ↗
- 1.1.52023-12-10 · diff ↗
- 1.1.42023-05-17 · diff ↗
- 1.1.32023-04-27 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 1.1.22023-01-12 · diff ↗
- 1.1.12022-11-17 · diff ↗
Show 20 earlier eventsHide 20 earlier events
- 1.1.02022-07-18 · diff ↗ ·
removed 2 exports
s2_projection_filter, s2_unprojection_filteradded 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 - RR 4.2.0 released · 2022-04-22
- 1.0.72021-09-28 · diff ↗
- 1.0.62021-06-17 · diff ↗
- 1.0.52021-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 - RR 4.1.0 released · 2021-05-18
- 1.0.42021-01-05 · diff ↗
- 1.0.32020-10-14 · diff ↗
- 1.0.22020-08-03 · diff ↗
- 1.0.12020-07-13 · diff ↗ ·
removed 2 exports
as_s2_latlng, s2_latlngadded 7 exports
as_s2_lnglat, s2_bounds_cap, s2_bounds_rect, s2_lnglat, s2_may_intersect_matrix, s2_rebuild, s2_simplify - 1.0.02020-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_distadded 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 - RR 4.0.0 released · 2020-04-24
- 0.4-22019-08-30 · diff ↗
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- 0.4-02018-04-21 · diff ↗
- 0.3-02017-12-10 · diff ↗ ·
removed 1 export
cell_centeradded 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 - RR 3.4.0 released · 2017-04-21
- 0.1-12016-11-04
- RR 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
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("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.
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.