Changes between Version 1 and Version 2 of Processing/LLToBNG
- Timestamp:
- Jun 5, 2008, 4:37:07 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Processing/LLToBNG
v1 v2 1 I'll flesh this out when I've written a script to convert TM coordinates to BNG, but for now use the following proj command to convert from lat/long to TM 1 == Converting lat/long to BNG == 2 2 3 The point of writing this code was to have a fast way to scan all the eagle/hawk header files for a project and use the co-ordinates from them to determine the UK OS grid squares they covered. To do this, run gettiles.sh in the base project directory and it'll go do it for you. The steps it goes through are below and can be used for other conversions. 4 5 1. Use Proj to convert lat/long to BNG co-ordinates: 3 6 {{{ 4 7 proj +proj=tmerc +ellps=airy +lat_0=49 +lon_0=-2 +x_0=400000 +y_0=-100000 +k=0.9996012717 … … 6 9 7 10 Then once that's running you enter the lat/long to be converted at the prompt in x y format (ie long then lat) and it will return transverse mercator co-ordinates in the BNG co-ordinate system (still have to convert to the right OS grid square though). 11 12 2. Run bnglookup.py to convert this to grid squares: 13 {{{ 14 python bnglookup.py eastings northings 15 }}} 16 (Note this requires alphaconv.py) 17 18 ll2bng.sh runs steps 1 and 2 on a specific set of coordinates: 19 {{{ 20 ll2bng.sh latitude longitude 21 }}} 22 This accepts any Proj.4 format lat/lon