++ed by:
MJEMMESON CARWASH

2 PAUSE users

Toby Thurston

NAME

bngl.pl -- convert coordinates, and compare (possibly random) spots in the UK on Streetmap and Googlemaps

This programme shows off some features of Geo::Coordinates::OSGB.

SYNOPSIS

  perl bngl.pl [--streetmap] [--googlemap] [--osgb] [ lat lon | grid reference ] 

ARGUMENTS and OPTIONS

The argument should be

- either something that represents a grid reference, like 'TQ 123 456' or '314159 271828'

- or a pair of decimal numbers in the range -20 to 70 representing a latitude and longitude pair in the UK like: '51.3 -0.01'. Latitude and longitude can be given in either order. You can leave an optional comma between them if you like. This allows you to cut and paste from a web page for example.

The argument will be converted appropriately. So if you supply a grid reference you will get back a lat/lon pair, and vice versa.

If you supply no argument, then a random grid reference is supplied.

You can also pipe the argument from another program, and pipe the output to something else. If you connect the output to a pipe you will get just the coordinates, without the fancy message.

--streetmap

Open a webpage on Streetmap.co.uk showing the grid point on an online OS map.

--googlemap

Open a webpage showing the grid point on Google maps.

--osgb

Use the OSGB36 latitude and longitude model instead of the normal WGS84 model

--usage, --help, --man

Show increasing amounts of help text, and exit.

--version

Print version and exit.

DESCRIPTION

This script shows off the conversions in this module.

The argument can be either a grid ref or a lat/lon pair. A simple heurisistic is used to guess which is which. If the argument is missing, then a random grid point is supplied.

Optionally you can show the chosen point on a map using the Streetmap and/or Googlemap options. You can combine both so that you can compare the OS and the Google maps side by side for the same area.

The Google maps parameters are the result of experimentation rather than any API documentation so I've no idea what the data parameter does, but it seems to be necessary. The "14z" controls the level of zoom, and makes it roughly 1:50,000 corresponding to the Streetmap display with "&z=3".

DEPENDENCIES

You may need to install Browser::Open and IO::Interactive.

AUTHOR

Toby Thurston -- 30 Oct 2017

toby@cpan.org