Package: osbng 0.2.0

Chris Jochem

osbng: Geospatial Grid Indexing with the British National Grid

Offers a streamlined programmatic interface to Ordnance Survey's British National Grid (BNG) index system, enabling efficient spatial indexing and analysis based on grid references. It supports a range of geospatial applications, including statistical aggregation, data visualisation, and interoperability across datasets. Designed for developers and analysts working with geospatial data in Great Britain, 'osbng' simplifies integration with geospatial workflows and provides intuitive tools for exploring the structure and logic of the BNG system.

Authors:Chris Jochem [cre, aut], Ordnance Survey Ltd [cph, fnd], Steve Kingston [ctb], Kate New [ctb], Tom Peterken [ctb]

osbng_0.2.0.tar.gz
osbng_0.2.0.zip(r-4.7-any)osbng_0.2.0.zip(r-4.6-any)osbng_0.2.0.zip(r-4.5-any)
osbng_0.2.0.tgz(r-4.6-any)osbng_0.2.0.tgz(r-4.5-any)
osbng_0.2.0.tar.gz(r-4.7-any)osbng_0.2.0.tar.gz(r-4.6-any)
osbng_0.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
osbng/json (API)

# Install 'osbng' in R:
install.packages('osbng', repos = c('https://ordnancesurvey.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ordnancesurvey/osbng-r/issues

Pkgdown/docs site:https://ordnancesurvey.github.io

On CRAN:

Conda:

geospatialordnance-survey-gridordnancesurveyspatialspatial-indexing

4.70 score 5 stars 417 downloads 30 exports 3 dependencies

Last updated from:ab401861f0. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK132
source / vignettesOK170
linux-releaseOK110
macos-releaseOK170
macos-oldrelOK144
windows-develOK67
windows-releaseOK83
windows-oldrelOK74
wasm-releaseOK91

Exports:as_bng_referencebbox_to_bngbng_distancebng_dwithinbng_grid_100kmbng_grid_10kmbng_grid_1kmbng_grid_50kmbng_grid_5kmbng_is_neighbourbng_kdiscbng_kringbng_neighboursbng_to_bboxbng_to_childrenbng_to_grid_geombng_to_parentbng_to_xygeom_to_bnggeom_to_bng_intersectiongeom_to_bng_intersection_explodeget_bng_resolutionget_bng_resolution_stringis_bng_referenceis_valid_bngis_valid_bng_resolutionlist_bng_boundslist_bng_prefixeslist_bng_resolutionxy_to_bng

Dependencies:geoslibgeoswk

Indexing Polygon Example
British National Grid Indexing Polygon Examples | Indexing Functions Accepting Geometries | geom_to_bng | geom_to_bng_intersection | geom_to_bng_intersection_explode | Examples | Optional sf Dependency | Alternative: geom_to_bng_intersection

Last update: 2025-07-07
Started: 2025-05-19

osbng Overview
BNG Index System | Resolutions | BNGReference | Indexing | Indexing geos Geometries | Point | LineString | Visualise the results | Polygon | Hierarchy | Parent | Children | Traversal | K-disc | K-ring | Neighbours | Distance | Grids

Last update: 2025-07-07
Started: 2025-07-07

Readme and manuals

Help Manual

Help pageTopics
Create BNG reference objectsas_bng_reference as_bng_reference.BNGReference as_bng_reference.character as_bng_reference.default is_bng_reference
Convert bounding boxesbbox_to_bng bbox_to_bng.data.frame bbox_to_bng.matrix bbox_to_bng.numeric bng_to_bbox bng_to_grid_geom
Distance calculationsbng_distance bng_dwithin
Map BNG References to Spatial Objectsbng_grid bng_grid_100km bng_grid_10km bng_grid_1km bng_grid_50km bng_grid_5km
Spatial neighbourhoods in the British National Grid index systembng_kdisc bng_kring
Identify neighbouring grid squaresbng_is_neighbour bng_neighbours
Navigate the British National Grid hierarchybng_to_children bng_to_parent
Convert BNG Referencesbng_to_xy xy_to_bng xy_to_bng.data.frame xy_to_bng.matrix xy_to_bng.numeric
BNG Reference objectsas.data.frame.BNGReference BNGReference c.BNGReference unique.BNGReference [.BNGReference [<-.BNGReference [[.BNGReference [[<-.BNGReference
Spatial index for geometriesgeom_to_bng geom_to_bng.geos_geometry geom_to_bng.sf geom_to_bng.sfc geom_to_bng_intersection geom_to_bng_intersection.geos_geometry geom_to_bng_intersection.sf geom_to_bng_intersection.sfc
Spatial data frame for indexed geometriesgeom_to_bng_intersection_explode geom_to_bng_intersection_explode.geos_geometry geom_to_bng_intersection_explode.sf geom_to_bng_intersection_explode.sfc
BNG reference resolutionbng_resolutions get_bng_resolution get_bng_resolution_string list_bng_resolution
List the components of the British National Gridlist_bng list_bng_bounds list_bng_prefixes
Printing BNG Referencesformat.BNGReference print.BNGReference
Region Boundaries for LondonRegions
Check validity of a BNG Referenceis_valid_bng is_valid_bng.BNGReference is_valid_bng.character is_valid_bng_resolution valid