The mapinfo tool allows you to analyse the structure and content of CartoType maps (CTM1 files), search them for specified map objects, and get the total area or length of a group of map objects. For example, you can get the total length of all roads, list the layers in the map, or find out what type of routing data is stored.

Download mapinfo:

mapinfo for Windows
mapinfo for 64-bit Linux
mapinfo for mac OS 

To uninstall mapinfo just delete the executable.

By using the CartoType mapinfo tool (mapinfo.exe, mapinfo_mac, mapinfo_linux, ctm1_info.exe, etc., or any other variant, not necessarily having one of the names listed here), however acquired, you accept the terms of the CartoType Evaluation License and you also accept that neither CartoType Ltd, nor any owners, shareholders or officers of CartoType Ltd, or any other contributors to, authors of or maintainers of the CartoType system, are liable for any damage, direct or consequential, caused by downloading, installing or using the mapinfo tool, and that the mapinfo tool is not warranted fit for any particular use and may not be used for any commercial purpose without the purchase of a CartoType license.

Find out how to create CartoType maps here.

Basic use

mapinfo

without any command-line options prints the usage message:

usage :mapinfo { -option1 ... -optionN } <CartoType map file (CTM1 file) name>
    options:
        -d<layer>{,<condition>}: dumps all map objects in a layer,
            optionally using a condition to select objects
        -D<layer>{,<condition>}: like -d but also dumps coordinates
        -a<layer>{,<condition>}: like -d but gives combined area and length of objects only
        -e<W,S,E,N> or <zoom,X,Y>: applies an extent to following -d or -D options
        -f<building>,<street>,<city>{,<postcode>}: finds addresses
        -i: uses imperial units (miles, yards, acres) instead of metric units (kilometres, metres, hectares)
        -n: no info (for use with -d, etc.) does not list global information, tables or layers
        -v: verbose: lists layers
        -V: more verbose: lists layers and low-res layers
mapinfo <filename>

reports the global information and the tables in a CTM1 file. For example:

mapinfo denmark.ctm1
CTM1 version: 8.1
file size = 744,495,884 bytes
data set name: Denmark
created by makemap built using CartoType 8.3.177
copyright: Copyright (C) OpenStreetMap contributors. Data licensed under the Open Data Commons Open Database License.
projection: proj.4
proj.4 parameters: +proj=laea +lon_0=10.66 +lat_0=56.52 +ellps=WGS84
point format: 32nds of metres
extent (map coords) (-38718680,-19519366) : (38714836,23300364)
extent (degrees) (-6.77072,51.0377) : (28.0889,62.0079)
Tables:
table 0: global information (160 bytes starting at 69, 0.00Mb)
table 1: layer data (533,964,239 bytes starting at 229, 509.23Mb)
table 4: projection table (86 bytes starting at 533,964,468, 0.00Mb)
table 5: table of compressed strings (1,659,154 bytes starting at 533,964,554, 1.58Mb)
table 6: low-resolution layer data (33,395,791 bytes starting at 535,623,708, 31.85Mb)
table 8: index used for text searching (92,155,868 bytes starting at 652,340,016, 87.89Mb)
table 10: routing network (A*) (68,014,258 bytes starting at 569,019,499, 64.86Mb)
table 12: extra information for the routing network (A*) (4,570,324 bytes starting at 637,033,757, 4.36Mb)
table 19: street index (10,735,935 bytes starting at 641,604,081, 10.24Mb)

Listing layers

Use -v (verbose) to add a list of layers:

mapinfo denmark.ctm1 -v

...

Number of layers: 25
layer 0: boundary/major, 7 map objects (88,153 bytes starting at 1060, 0.08Mb)
layer 1: boundary/minor, 359 map objects (11,382,359 bytes starting at 89,213, 10.86Mb)
layer 2: place/major, 113 map objects (25,647 bytes starting at 11,471,572, 0.02Mb)
layer 3: place/minor, 9631 map objects (646,134 bytes starting at 11,497,219, 0.62Mb)
layer 4: waterway/major, 92,660 map objects (11,672,029 bytes starting at 12,143,353, 11.13Mb)
layer 5: waterway/minor, 88,283 map objects (7,167,323 bytes starting at 23,815,382, 6.84Mb)
layer 6: land/major, 120,934 map objects (13,570,623 bytes starting at 30,982,705, 12.94Mb)
layer 7: land/minor, 517,214 map objects (36,993,519 bytes starting at 44,553,328, 35.28Mb)
layer 8: outline, 151,347 map objects (45,072,360 bytes starting at 81,546,847, 42.98Mb)
layer 9: tourism, 12,910 map objects (618,089 bytes starting at 126,619,207, 0.59Mb)
layer 10: road/major, 14,180 map objects (1,182,988 bytes starting at 127,237,296, 1.13Mb)
layer 11: road/mid, 65,313 map objects (5,905,518 bytes starting at 128,420,284, 5.63Mb)
layer 12: road/minor, 699,874 map objects (43,721,906 bytes starting at 134,325,802, 41.70Mb)
layer 13: railway, 12,658 map objects (1,028,075 bytes starting at 178,047,708, 0.98Mb)
layer 14: ferry, 175 map objects (42,416 bytes starting at 179,075,783, 0.04Mb)
layer 15: path, 288,575 map objects (17,285,420 bytes starting at 179,118,199, 16.48Mb)
layer 16: amenity/major, 1046 map objects (85,942 bytes starting at 196,403,619, 0.08Mb)
layer 17: amenity/minor, 170,209 map objects (6,828,579 bytes starting at 196,489,561, 6.51Mb)
layer 18: building, 3,636,904 map objects (241,617,868 bytes starting at 203,318,140, 230.42Mb)
layer 19: address, 2,558,060 map objects (82,507,392 bytes starting at 444,936,008, 78.69Mb)
layer 20: aerialway, 31 map objects (2053 bytes starting at 527,443,400, 0.00Mb)
layer 21: map-border, 1 map object (93,969 bytes starting at 527,445,453, 0.09Mb)
layer 22: map-extent, 1 map object (46,985 bytes starting at 527,539,422, 0.04Mb)
layer 23: routerelation/path, 1967 map objects (6,343,685 bytes starting at 527,586,407, 6.05Mb)
layer 24: urban-area, 22 map objects (34,376 bytes starting at 533,930,092, 0.03Mb)

You can also use -V (Very verbose) to list the low-resolution layers.

Dumping a layer

Use -n to suppress the layer reports, and -d with the name of a layer

mapinfo fiji.ctm1 -n -damenity/major

Layer 'amenity/major' has 103 objects: id=6566022, Vatulele Airport, layer=amenity/major, object type=polygon, feature type=aerodrome; bounds=177.635,-18.5089,177.643,-18.5159; area = 10.77 ha id=6566085, layer=amenity/major, object type=line, feature type=runway; start=177.636,-18.5098; end=177.642,-18.5148; length = 848.79 m id=6566129, Nanuku Private Airstrip, layer=amenity/major, object type=polygon, feature type=aerodrome; bounds=178.047,-18.2513,178.051,-18.259; area = 6.84 ha id=6566215, layer=amenity/major, object type=line, feature type=runway; start=178.048,-18.2521; end=178.048,-18.2521; length = 1.51 km id=6566271, Malolo Lailai Island Airport, layer=amenity/major, object type=polygon, feature type=aerodrome; _ele=3; bounds=177.194,-17.7755,177.199,-17.7805; area = 4.86 ha id=6566357, Nadi International Airport, layer=amenity/major, object type=polygon, feature type=aerodrome; _ele=18; bounds=177.425,-17.7464,177.458,-17.7769; area = 3.02 sq km id=6566910, layer=amenity/major, object type=line, feature type=runway; start=177.194,-17.7759; end=177.199,-17.7802; length = 666.17 m ... id=6574455, layer=amenity/major, object type=polygon, feature type=aerodrome; bounds=-178.716,-17.5224,-178.714,-17.529; area = 2.69 ha id=6574525, layer=amenity/major, object type=line, feature type=runway; start=-178.716,-17.5286; end=-178.715,-17.5237; length = 556.73 m line objects: 78; length = 35.47 km polygon objects: 25; area = 5.96 sq km

Getting the total length or area without dumping objects

The -d option dumps all objects and prints their total length and / or area afterwards. If you just need the total length or area of a group of objects, but you don't need information on each object, use -a instead of -d. Here's how to get the total length of all roads. Note that using 'road/' as the layer selects all layers starting with 'road/'.

mapinfo fiji -n -aroad/
Layer 'road/' has 27,077 objects:
line objects: 27,075; length = 16228.00 km
polygon objects: 2; area = 0.21 ha

Searching using conditions

The -d, -D and -a options can all take an optional conditional expression after the layer name, separated by a comma. Conditions use CartoType's expression language. For example, find all pubs in London with "Black Bull" in the name:

mapinfo london.ctm1 -n "-d*,@feature_type=='pub' and $ eqw '*Black Bull*'"

Layer '*' has 3 objects satisfying the condition '@feature_type=='pub' and $ eqw '*Black Bull*'': id=48451903, The Black Bull, layer=amenity/minor, object type=point, feature type=pub; addr:postcode=SW10 9UU, addr:street=Fulham Road, addr:housenumber=358; lon=-0.18761 lat=51.4817 id=48587503, Black Bull, layer=amenity/minor, object type=point, feature type=pub; lon=-0.402793 lat=51.5627 id=51321714, Ye Olde Black Bull, layer=amenity/minor, object type=point, feature type=pub; lon=0.000793102 lat=51.5402 point objects: 3

Notes:

  • The -d option is enclosed in quotes because it contains spaces. On Linux or Mac OS it's a good idea always to enclose options with conditions in quotes, because those platforms strip single quotes.
  • The layer is given as '*'; layers can include wild cards, so '*' means all layers.
  • The operator eqw in the condition means 'equal with wild cards'; * means 'any sequence of zero or more characters'.

Another example: find the combined area of all parks:

mapinfo london.ctm1 -n "-a*,@feature_type='par'"
Layer '*' has 2931 objects
satisfying the condition '@feature_type='par'':
point objects: 28
polygon objects: 2903; area = 147.76 sq km

Finding addresses

You can find addresses using the -f command-line option, which takes a building name or number, street, city, and an optional postcode, all comma-separated. Here is an example:

mapinfo denmark "-f23A,Annasvej,Hellerup" -n
id=527143068, layer=address, object type=point, feature type=address; addr:city=Hellerup, addr:country=DK, addr:housenumber=23A, addr:municipality=Gentofte, addr:postcode=2900, addr:street=Annasvej; lon=12.5831 lat=55.7401
point objects: 1