Map File (.map and .bmap)
The map outline database file contains the latitudes and longitudes of political and geographical boundaries that can be used to draw maps. These files are available in ASCII and binary formats. The ASCII format is available for easy modification. The binary format is for quick drawing. There is a program called map2bin. which will convert from one format to the other.
ASCII FORMAT (.map)
The political and geographical boundaries are split up into blocks of continuous line segments. Each block contains a header listing the number of points and the latitude-longitude extent of the block along withthe latitude-longitude pairs which form the line segment. The header of each block is formatted as follows:
num maxlat minlat maxlon minlon off
lat1 lon1 lat2 lon2 lat3 lon3 ...
num maxlat minlat maxlon minlon off
...
where:
- num -- The number of latitude-longitude pairs in the block,
- maxlat -- The maximum latitude in the block.
- minlat -- The minimum latitude in the block.
- maxlon -- The maximum longitude in the block.
- minlon -- The minimum longitude in the block.
- off -- The byte offset from the beginning of the file of the first character of the next block of data.
- lat1 lon1 -- The first latitude longitude pair
- lat2 lon2-- The second latitude longitude pair
The latitude-longitude pairs follow header block. There is a total of num pairs which is followed by the next header block.
BINARY FORMAT (.bmap)
The binary map file has the same structure as the ASCII file. These files were created with C fwrite (big endian) calls. The header is formatted as follows:
- XX -- 2 byte short integer -- The number of latitude-longitude pairs in the block.
- XXXX -- 4 byte IEEE floating point -- The maximum latitude in the block.
- XXXX -- 4 byte IEEE floating point -- The minimum latitude in the block.
- XXXX -- 4 byte IEEE floating point -- The maximum longitude in the block.
- XXXX -- 4 byte IEEE floating point -- The minimum longitude in the block.
- XXXX -- 4 byte long integer -- The byte offset (from the beginning of the file of the first character of the next block of data (unused in the binary file).
The latitude longitude pairs are written as a continuous stream of binary 4 byte IEEE floating point values.
XXXXYYYYXXXXYYYY...
- XXXX -- 4 byte IEEE floating point -- The latitude of a point
- YYYY -- 4 byte IEEE floating point -- The longitude of a point
MAP2BIN PROGRAM
This program converts the ASCII map files to binary or from binary to ASCII. The syntax of the program is:
map2bin in_map out_map
The program will automatically sense which type of file is being used as input and convert to the other format. If out_map is omitted, the output is to standard output.
EXAMPLES
An example of a block from the wxp.map file:
24 49.00 45.55 -116.92 -124.75 371 48.15 -123.70 48.35 -124.75 47.90 -124.62 47.00 -124.18 46.28 -124.00 46.17 -123.15 46.08 -122.90 45.65 -122.77 45.55 -122.25 45.70 -121.80 45.65 -121.17 46.00 -119.00 46.00 -116.92 46.40 -117.00 49.00 -117.00 49.00 -120.00 49.00 -122.75 48.60 -122.42 48.00 -122.20 47.30 -122.30 47.35 -122.55 47.80 -122.50 48.12 -122.77 48.15 -123.70 14 46.28 42.00 -116.50 -124.55 602 46.00 -116.92 45.60 -116.50 44.48 -117.20 44.30 -117.20 44.15 -116.90 43.80 -117.00 42.00 -117.00 42.00 -120.00 42.00 -122.00 42.00 -124.20 42.83 -124.55 44.00 -124.15 45.00 -124.00 46.28 -124.00 19 49.00 42.00 -111.05 -117.00 903 49.00 -117.00 49.00 -116.05 48.00 -116.05 47.70 -115.75 47.45 -115.75
Database | Coverage | Resolution | Outlines |
---|---|---|---|
wxp.map | North America | low | Continental, Country, State |
wxpstate.map | North America | low | Country, State |
cont.map | Global | low | Continental |
country.map | Global | low | Country |
state.map | United States | high | Continental, State |
usa_cnty.map | United States | high | County, State |
river.map | Global | high | Rivers |
zones.map | United States | high | Forecast zones |
DLG | United States | high | Digital Line Graph: Continental, State, County, Rivers, Roads, Misc Political Boundaries |
SEE ALSO
Last updated May 10, 2020