Convert between WGS84 coordinates and British National Grid references

BritishNationalGrid provides the type BNGPoint to convert between
longitude-latitude and grid references in the British National Grid system.
It assumes your points are geodetic longitude and latitude in decimal
degrees using the WGS84 ellipsoid.

This package is reliable to within a metre or so. Advanced users needing
greater accuracy will probably already know how to convert between different
systems, but any additions to the package that remain easy to use will
be welcome.

julia>using BritishNationalGrid
julia> p1 =BNGPoint(42513, 100231) # Full grid referenceBNGPoint{Int64}(42513, 100231)
julia>lonlat(p1) # Convert to longitude-latitude (°)
(-7.063648859478239, 50.69155306935914)
julia> p2 =BNGPoint(lon=0.32, lat=51.0) # Construct point from lon-latBNGPoint{Float64}(562885.4557430055, 124851.2191743746)
julia> p3 =BNGPoint(00123, 51422, "TA") # Construct from 100 km square nameBNGPoint{Int64}(500123, 451422)

Get a formatted grid reference:

julia>gridref(p1, 10) # 10-figure grid reference"04251 10023"
julia>gridref(p2, 6, true) # 6-figure reference within the 100 km square TQ"TQ 628 248"

Find the 100 km square in which a point lies:

julia>square(p3)
"TA"

Direct (unchecked) lon-lat ↔ easting-northing conversion

The lonlat2bng and bng2lonlat functions convert directly between the
two coordinate systems, but do not check that points are actually in the
National Grid; therefore use these functions with caution.

This website serves as a package browsing tool for the Julia programming language. It works by aggregating various sources on Github to help you find your next package.