Generate Latitude/Longitude file for Open Street Map

The form below will generate a grid of lines of latitude and longitude between the limits specified. The increments are the distances between the lines generated (default 1 min). Interval specifies the gap between internal nodes in the file (default 4). If interval > 1, some internal nodes are omitted, and the file size is considerably reduced. The effect on the final grid is very small for values of interval up to about 5, since the lines are very close to straight lines.

The file generated is compatible with Open Street map XML files version 0.5 (smaller) or 0.6 (larger). Both versions are acceptable to mkgmap to make Garmin .img files. Osmosis insists on version 0.6. Other utilities have not been tested - please inform me of any problems. The node and way IDs are well clear of those in OSM - around 9E11, while OSM IDs range up to about 2E9. The IDs are unique to location, so files for different areas will have non-conflicting IDs.

The lines are tagged along the lines of  'name= 2°35'W ' or 'name=55°0'N' and 'lat_long=1deg' (or '10deg' or '10min' or '1min'), according to the latitude or longitude of the line concerned. Note that the name tag includes the degree and minute symbols, while the lat-long tag does not. For reference, the 1min interval corresponds to about 1.8 km north/south, and rather less (depending on location) east/west.

In compiling with mkgmap, the folllowing or similar rules may be used in the lines style file:

lat_long=1deg [0x10302 level 3]
lat_long=10min [0x10301 level 2]
lat_long=1min [0x10300 level 1]
lat_long=* [0x10302 level 3]

These codes are not apparently used for other purposes. They are the same as I have used for the GB National Grid (see http://www.rogercalvert.me.uk/OSM/GBgrid. – I assume that users are unlikely to require both grid lines and lat/long lines.

Corresponding entries are also required in the style.typ file. A sample to include in the style.txt file (which mkgmap will use to generate the style.typ file) is available here (the labels in this sample refer to grid lines, and may be changed if desired, but do not affect the outcome).


Form to generate and download file

Latitude (-89° to +89°) and Longitude (-180° to +180°) ranges are in degrees (use decimals if desired – values will be rounded to the nearest minute). Positive values are North and East. Increment is in minutes (1 to 60) and must be integer. Interval is in terms of numbers of increments and must be integer. For performance reasons, the file size is limited to 12MB, but several files may be used together to cover a larger area.

The default values cover the mainland of Great Britain.

 Minimum Latitude (°)
 Maximum Latitude (°)
 Increment of Latitude (min)

 Minimum Longitude (°) 
 Maximum Longitude (°)
 Increment of Longitude (min)
 Interval between Internal Nodes (increments)
Version 0.5  Version 0.6  
 
 

License

These files may be freely used for any non-commercial purpose, and redistributed freely. In any redistribution, this license and the disclaimer below must be included unchanged.

Disclaimer

These data are believed to be correct and to be compatible with Open Street Map and Garmin formats. However, the author can take no responsibility for any errors or incompatibilities which may be present, or for the consequences of such errors or incompatibilities. It is up to the user to determine whether the data are suitable for his/her purposes.

Acknowledgements

I am grateful to various people on the Open Street Map email lists for advice and guidance.

Contact

I can be contacted as user Rogerc on the Open Street Map site, or directly as jrogercalvert@gmail.com

Last updated  29/09/2015


Downloaded 192 times
 

Valid XHTML 1.0 Transitional

steamboat icon http://www.rogercalvert.me.uk CTP icon http://www.ctpress.co.uk