osgrid

package module
v0.0.0-...-88a5242 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 4 Imported by: 0

README

Ordnance Survey - The National Grid

The Ordnance Survey National Grid is a coordinate system commonly used in the United Kingdom for mapping and survey data.

The base github.com/usedbytes/osgrid package provides functionality for parsing, formatting and manipulating coordinates in the OS National Grid system ("grid references").

For example, the OS grid reference of the summit of Snowdon is SH 60986 54375. We can find the OS grid reference for the point 300 metres East and 2 kilometres North like so:

	summit, _ := osgrid.ParseGridRef("SH 60986 54375")
	point, _ := summit.Add(300 * osgrid.Metre, 2 * osgrid.Kilometre)
	fmt.Println(point.String())

osdata

The Ordnance Survey make lots of their mapping data available for free under OS OpenData.

Under osdata there are two packages for working with a subset of that data:

  • terrain50: For accessing the OS Terrain50 dataset, which provides elevation data for the whole of the UK, with 50 m horizontal and 0.1 m vertical resolution.
  • raster: For accessing raster-format data. This has only been tested with the OS VectorMap District dataset at the time of writing.

Further details on how to use the packages can be found in their respective directories.

cmd/osmodel

osmodel is a command-line application which uses the other packages in this repository to generate different representations of the supported OS OpenData. datasets.

It has 3 subcommands:

  • surface: Generate a "surface" from a specified region of an elevation dataset, e.g. as a CSV file.
  • texture: Generate an image from a specified region of a raster dataset.
  • mesh: Generate a 3D model, optionally with a texture, from a specified region of elevation and raster datasets. e.g. as an STL or X3D file, suitable for 3D printing.

Snowdon Summit (5 km radius)

Snowdon Summit, textured (5 km radius)

Images above contains OS data © Crown Copyright (2021), used under the Open Government License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Distance

type Distance int
const (
	Metre     Distance = 1
	Kilometre          = 1000
)

type GridRef

type GridRef struct {
	// contains filtered or unexported fields
}

func Origin

func Origin() GridRef

func ParseGridRef

func ParseGridRef(str string) (GridRef, error)

func (GridRef) AbsEasting

func (g GridRef) AbsEasting() Distance

func (GridRef) AbsNorthing

func (g GridRef) AbsNorthing() Distance

func (GridRef) Add

func (g GridRef) Add(east Distance, north Distance) (GridRef, error)

func (GridRef) Align

func (g GridRef) Align(to Distance) GridRef

func (GridRef) Digits

func (g GridRef) Digits() string

func (GridRef) String

func (g GridRef) String() string

func (GridRef) Sub

func (g GridRef) Sub(b GridRef) (Distance, Distance)

func (GridRef) Tile

func (g GridRef) Tile() string

func (GridRef) TileEasting

func (g GridRef) TileEasting() Distance

func (GridRef) TileNorthing

func (g GridRef) TileNorthing() Distance

Directories

Path Synopsis
cmd
lib
x3d

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL