I generated a postgis table for the UK national grid, which I can make
available as shape files etc. It has 100km, 10km, 5km, 2 km (tetrad) and 1
km squares. The actual SQL is rather easy, one just needs to use a
cartesian product of two queries using generate_series().

So for instance for 100 km grid squares which range from 0->700 in eastings
and 0->1400 in northings (or thereabouts)

SELECT km_east*1000 as origin_eastings, km_north*1000 as origin northings,
(km_east+50)*1000 as centroid_eastings, (km_north+50)*1000 as
centroid_northings,
st_setrid(st_makepoint(km_east+50)*1000,(km_north+50)*100),27700) as
osgb_centroid
st_setsrid(st_transform(st_setrid(st_makepoint(km_east+50)*1000,(km_north+50)*100),27700),4326),4326)
as wgs_centroid
...
FROM (SELECT generate_series(0,700,100) km_east) as e
, (SELECT generate_series(0,1400,100) km_north) as n

I found I also needed a simple table to get the letters for 100 km grid
squares. Unfortunately I dont have the code to hand, or the rules I wrote
to place an OS grid on a Garmin etrex.

Regards,

Jerry





On 21 March 2015 at 13:08, Dudley Ibbett <[email protected]> wrote:

> Hi
>
> I was wondering if anyone knows of a program to generate British National
> Grid files (ideally with labelling options) that can then be combined with
> an "osm" data file.  What I'd like to produce is a "osm" datafile with a
> british national grid that I can then be rendered within Maperative.
>
> Many thanks
>
> Dudley
>
> _______________________________________________
> Talk-GB mailing list
> [email protected]
> https://lists.openstreetmap.org/listinfo/talk-gb
>
>
_______________________________________________
Talk-GB mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/talk-gb

Reply via email to