The ctm1_info 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 ctm1_info:

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

This version of ctm1_info was built using CartoType 8.0.2 and uploaded on 4th July 2022.
To uninstall ctm1_info just delete the executable.

By using the CartoType ctm_info tool (ctm1_info.exe, ctm1_info_mac, ctm1_info_linux 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 ctm1_info tool, and that the ctm1_info 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

ctm1_info

without any command-line options prints the usage message:

usage : ctm1_info { -option1 ... -optionN } <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
-i: use imperial units (miles, yards, acres) instead of metric units (kilometres, metres, hectares)
-n: no tables; suppresses table information

ctm1_info <filename>

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

>ctm1_info fiji.ctm1

ctm1_info built using CartoType 7.9.10779
CTM1 version: 8.0
data set name: FIJI
created by makemap built using CartoType 7.9.10779
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=180 +lat_0=-18.5 +ellps=WGS84
point format: 32nds of metres
extent (map coords) (-13768833,-12549345) : (13768833,12393014)
extent (degrees) (176,-22) : (184,-15)

Tables:
table 0: global information (157 bytes starting at 63, 0.00Mb)
table 1: layer data (20,920,739 bytes starting at 220, 19.95Mb)
table 4: projection table (84 bytes starting at 20,920,959, 0.00Mb)
table 5: table of compressed strings (391,152 bytes starting at 20,921,043, 0.37Mb)
table 6: low-resolution layer data (2,186,840 bytes starting at 21,312,195, 2.09Mb)
table 8: index used for text searching (1,055,400 bytes starting at 25,240,138, 1.01Mb)
table 10: routing network (A*) (1,673,731 bytes starting at 23,499,035, 1.60Mb)
table 12: extra information for the routing network (A*) (67,372 bytes starting at 25,172,766, 0.06Mb)

Number of layers: 22
layer 0: boundary/major, 2 map objects (1828 bytes starting at 945, 0.00Mb)
layer 1: boundary/minor, 87 map objects (626,343 bytes starting at 2773, 0.60Mb)
layer 2: place/major, 33 map objects (4956 bytes starting at 629,116, 0.00Mb)
layer 3: place/minor, 768 map objects (33,549 bytes starting at 634,072, 0.03Mb)
layer 4: waterway/major, 1065 map objects (457,430 bytes starting at 667,621, 0.44Mb)
...
layer 20: map-border, 1 map object (30,785 bytes starting at 20,874,781, 0.03Mb)
layer 21: map-extent, 1 map object (15,393 bytes starting at 20,905,566, 0.01Mb)

Number of lower resolutions: 7

Layers at a resolution of 64 meters per pixel:
64-res layer 0: boundary/major, 2 map objects (1820 bytes starting at 21,313,632, 0.00Mb)
64-res layer 1: boundary/minor, 85 map objects (180,412 bytes starting at 21,315,452, 0.17Mb)
...
4096-res layer 16: amenity/major, 3 map objects (132 bytes starting at 23,498,525, 0.00Mb)
4096-res layer 20: map-border, 1 map object (206 bytes starting at 23,498,657, 0.00Mb)
4096-res layer 21: map-extent, 1 map object (172 bytes starting at 23,498,863, 0.00Mb)

Dumping a layer

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

>ctm1_info fiji.ctm1 -n -damenity/major
7732453: Vatulele Airport, aerodrome; layer=amenity/major [polygon] bounds=177.635,-18.5089,177.643,-18.5159; area = 10.77 ha
7732516: runway; layer=amenity/major [line] start=177.636,-18.5098 end=177.642,-18.5148; length = 848.79 m
7732560: Nanuku Private Airstrip, aerodrome; layer=amenity/major [polygon] bounds=178.047,-18.2513,178.051,-18.259; area = 6.84 ha
7732646: runway; layer=amenity/major [line] start=178.048,-18.2521 end=178.048,-18.2521; length = 1.51 km
7732702: Malolo Lailai Island Airport, aerodrome; _ele=3; layer=amenity/major [polygon] bounds=177.194,-17.7755,177.199,-17.7805; area = 4.86 ha
7732788: Nadi International Airport, aerodrome; _ele=18; layer=amenity/major [polygon] bounds=177.425,-17.7464,177.458,-17.7769; area = 3.02 sq km
7733341: runway; layer=amenity/major [line] start=177.194,-17.7759 end=177.199,-17.7802; length = 666.17 m
...
7740956: runway; layer=amenity/major [line] 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

The format of each line is:

  • object position in the file: this is also the object ID when loading an object by its ID
  • name, feature type other feature information;
  • string attributes as key=value pairs;
  • layer [map object type] bounding box in degrees
  • length or area = <length or area> (not applicable to point objects)
  • For example, the fifth object is

7732702: Malolo Lailai Island Airport, aerodrome; _ele=3; layer=amenity/major [polygon] bounds=177.194,-17.7755,177.199,-17.7805; area = 4.86 ha

and the line can be interpreted as:

  • ID (byte offset in the CTM1 file) = 7732702
  • name = Malolo Lailai Island Airport
  • feature type = aerodrome
  • attribute '_ele' has the value 4, meaning the elevation is 4 metres
  • layer = amenity/major
  • map object type = polygon
  • bounds = 177.194E, 17.7755S to 177.199E, 17.7805S
  • area = 4.86 hectares

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/'.

ctm1_info fiji.ctm1 -n -aroad/
ctm1_info built using CartoType 7.9.10779

Layer 'road/' has 27,097 objects:
line objects: 27,095; 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:

ctm1_info london.ctm1 -n "-d*,@feature_type=='pub' and $ eqw '*Black Bull*'"
ctm1_info built using CartoType 7.9.10779

Layer '*' has 3 objects
satisfying the condition '@feature_type=='pub' and $ eqw '*Black Bull*'':
48451903: The Black Bull, pub; addr:postcode=SW10 9UU, addr:street=Fulham Road, addr:housenumber=358; layer=amenity/minor [point] lon=-0.18761 lat=51.4817
48587503: Black Bull, pub; layer=amenity/minor [point] lon=-0.402793 lat=51.5627
51321714: Ye Olde Black Bull, pub; layer=amenity/minor [point] 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:

ctm1_info london.ctm1 -n "-a*,@feature_type='par'"
ctm1_info built using CartoType 7.9.10779

Layer '*' has 2931 objects
satisfying the condition '@feature_type='par'':
point objects: 28
polygon objects: 2903; area = 147.76 sq km

 

ctm1_info built using CartoType 7.9.10779
CTM1 version: 8.0
data set name: FIJI
created by makemap built using CartoType 7.9.10779
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=180 +lat_0=-18.5 +ellps=WGS84
point format: 32nds of metres
extent (map coords) (-13768833,-12549345) : (13768833,12393014)
extent (degrees) (176,-22) : (184,-15)

Tables:
table 0: global information (157 bytes starting at 63, 0.00Mb)
table 1: layer data (20,920,739 bytes starting at 220, 19.95Mb)
table 4: projection table (84 bytes starting at 20,920,959, 0.00Mb)
table 5: table of compressed strings (391,152 bytes starting at 20,921,043, 0.37Mb)
table 6: low-resolution layer data (2,186,840 bytes starting at 21,312,195, 2.09Mb)
table 8: index used for text searching (1,055,400 bytes starting at 25,240,138, 1.01Mb)
table 10: routing network (A*) (1,673,731 bytes starting at 23,499,035, 1.60Mb)
table 12: extra information for the routing network (A*) (67,372 bytes starting at 25,172,766, 0.06Mb)

Number of layers: 22
layer 0: boundary/major, 2 map objects (1828 bytes starting at 945, 0.00Mb)
layer 1: boundary/minor, 87 map objects (626,343 bytes starting at 2773, 0.60Mb)
layer 2: place/major, 33 map objects (4956 bytes starting at 629,116, 0.00Mb)
layer 3: place/minor, 768 map objects (33,549 bytes starting at 634,072, 0.03Mb)
layer 4: waterway/major, 1065 map objects (457,430 bytes starting at 667,621, 0.44Mb)
layer 5: waterway/minor, 1746 map objects (444,383 bytes starting at 1,125,051, 0.42Mb)
layer 6: land/major, 2304 map objects (486,324 bytes starting at 1,569,434, 0.46Mb)
layer 7: land/minor, 4487 map objects (944,315 bytes starting at 2,055,758, 0.90Mb)
layer 8: outline, 1704 map objects (971,353 bytes starting at 3,000,073, 0.93Mb)
layer 9: tourism, 367 map objects (20,327 bytes starting at 3,971,426, 0.02Mb)
layer 10: road/major, 588 map objects (78,391 bytes starting at 3,991,753, 0.07Mb)
layer 11: road/mid, 1123 map objects (237,438 bytes starting at 4,070,144, 0.23Mb)
layer 12: road/minor, 25,386 map objects (3,246,882 bytes starting at 4,307,582, 3.10Mb)
layer 13: railway, 300 map objects (35,173 bytes starting at 7,554,464, 0.03Mb)
layer 14: ferry, 10 map objects (2871 bytes starting at 7,589,637, 0.00Mb)
layer 15: path, 1594 map objects (139,851 bytes starting at 7,592,508, 0.13Mb)
layer 16: amenity/major, 103 map objects (8635 bytes starting at 7,732,359, 0.01Mb)
layer 17: amenity/minor, 3493 map objects (130,902 bytes starting at 7,740,994, 0.12Mb)
layer 18: building, 224,895 map objects (12,998,971 bytes starting at 7,871,896, 12.40Mb)
layer 19: address, 73 map objects (3914 bytes starting at 20,870,867, 0.00Mb)
layer 20: map-border, 1 map object (30,785 bytes starting at 20,874,781, 0.03Mb)
layer 21: map-extent, 1 map object (15,393 bytes starting at 20,905,566, 0.01Mb)

Number of lower resolutions: 7

Layers at a resolution of 64 meters per pixel:
64-res layer 0: boundary/major, 2 map objects (1820 bytes starting at 21,313,632, 0.00Mb)
64-res layer 1: boundary/minor, 85 map objects (180,412 bytes starting at 21,315,452, 0.17Mb)
64-res layer 4: waterway/major, 778 map objects (118,957 bytes starting at 21,495,864, 0.11Mb)
64-res layer 6: land/major, 1872 map objects (194,200 bytes starting at 21,614,821, 0.19Mb)
64-res layer 8: outline, 792 map objects (242,106 bytes starting at 21,809,021, 0.23Mb)
64-res layer 10: road/major, 458 map objects (30,509 bytes starting at 22,051,127, 0.03Mb)
64-res layer 11: road/mid, 815 map objects (65,954 bytes starting at 22,081,636, 0.06Mb)
64-res layer 13: railway, 229 map objects (13,081 bytes starting at 22,147,590, 0.01Mb)
64-res layer 14: ferry, 10 map objects (2331 bytes starting at 22,160,671, 0.00Mb)
64-res layer 16: amenity/major, 96 map objects (5125 bytes starting at 22,163,002, 0.00Mb)
64-res layer 20: map-border, 1 map object (2217 bytes starting at 22,168,127, 0.00Mb)
64-res layer 21: map-extent, 1 map object (2181 bytes starting at 22,170,344, 0.00Mb)

Layers at a resolution of 128 meters per pixel:
128-res layer 0: boundary/major, 2 map objects (1820 bytes starting at 22,172,525, 0.00Mb)
128-res layer 1: boundary/minor, 85 map objects (106,725 bytes starting at 22,174,345, 0.10Mb)
128-res layer 4: waterway/major, 724 map objects (76,025 bytes starting at 22,281,070, 0.07Mb)
128-res layer 6: land/major, 1444 map objects (117,877 bytes starting at 22,357,095, 0.11Mb)
128-res layer 8: outline, 509 map objects (132,700 bytes starting at 22,474,972, 0.13Mb)
128-res layer 10: road/major, 370 map objects (24,170 bytes starting at 22,607,672, 0.02Mb)
128-res layer 11: road/mid, 693 map objects (49,845 bytes starting at 22,631,842, 0.05Mb)
128-res layer 13: railway, 206 map objects (11,104 bytes starting at 22,681,687, 0.01Mb)
128-res layer 14: ferry, 10 map objects (1971 bytes starting at 22,692,791, 0.00Mb)
128-res layer 16: amenity/major, 77 map objects (3915 bytes starting at 22,694,762, 0.00Mb)
128-res layer 20: map-border, 1 map object (2193 bytes starting at 22,698,677, 0.00Mb)
128-res layer 21: map-extent, 1 map object (2157 bytes starting at 22,700,870, 0.00Mb)

Layers at a resolution of 256 meters per pixel:
256-res layer 0: boundary/major, 2 map objects (1804 bytes starting at 22,703,027, 0.00Mb)
256-res layer 1: boundary/minor, 84 map objects (61,147 bytes starting at 22,704,831, 0.06Mb)
256-res layer 4: waterway/major, 655 map objects (56,626 bytes starting at 22,765,978, 0.05Mb)
256-res layer 6: land/major, 973 map objects (69,717 bytes starting at 22,822,604, 0.07Mb)
256-res layer 8: outline, 324 map objects (78,520 bytes starting at 22,892,321, 0.07Mb)
256-res layer 10: road/major, 330 map objects (20,903 bytes starting at 22,970,841, 0.02Mb)
256-res layer 11: road/mid, 606 map objects (41,577 bytes starting at 22,991,744, 0.04Mb)
256-res layer 13: railway, 186 map objects (9516 bytes starting at 23,033,321, 0.01Mb)
256-res layer 14: ferry, 10 map objects (1571 bytes starting at 23,042,837, 0.00Mb)
256-res layer 16: amenity/major, 42 map objects (1887 bytes starting at 23,044,408, 0.00Mb)
256-res layer 20: map-border, 1 map object (1126 bytes starting at 23,046,295, 0.00Mb)
256-res layer 21: map-extent, 1 map object (1092 bytes starting at 23,047,421, 0.00Mb)

Layers at a resolution of 512 meters per pixel:
512-res layer 0: boundary/major, 2 map objects (1796 bytes starting at 23,048,513, 0.00Mb)
512-res layer 1: boundary/minor, 81 map objects (33,991 bytes starting at 23,050,309, 0.03Mb)
512-res layer 4: waterway/major, 569 map objects (39,049 bytes starting at 23,084,300, 0.04Mb)
512-res layer 6: land/major, 530 map objects (36,308 bytes starting at 23,123,349, 0.03Mb)
512-res layer 8: outline, 189 map objects (39,010 bytes starting at 23,159,657, 0.04Mb)
512-res layer 10: road/major, 274 map objects (16,812 bytes starting at 23,198,667, 0.02Mb)
512-res layer 11: road/mid, 542 map objects (32,868 bytes starting at 23,215,479, 0.03Mb)
512-res layer 13: railway, 155 map objects (7662 bytes starting at 23,248,347, 0.01Mb)
512-res layer 14: ferry, 10 map objects (1243 bytes starting at 23,256,009, 0.00Mb)
512-res layer 16: amenity/major, 30 map objects (1298 bytes starting at 23,257,252, 0.00Mb)
512-res layer 20: map-border, 1 map object (606 bytes starting at 23,258,550, 0.00Mb)
512-res layer 21: map-extent, 1 map object (572 bytes starting at 23,259,156, 0.00Mb)

Layers at a resolution of 1024 meters per pixel:
1024-res layer 0: boundary/major, 2 map objects (1724 bytes starting at 23,259,728, 0.00Mb)
1024-res layer 1: boundary/minor, 78 map objects (20,025 bytes starting at 23,261,452, 0.02Mb)
1024-res layer 4: waterway/major, 469 map objects (25,242 bytes starting at 23,281,477, 0.02Mb)
1024-res layer 6: land/major, 192 map objects (12,822 bytes starting at 23,306,719, 0.01Mb)
1024-res layer 8: outline, 117 map objects (18,404 bytes starting at 23,319,541, 0.02Mb)
1024-res layer 10: road/major, 204 map objects (12,086 bytes starting at 23,337,945, 0.01Mb)
1024-res layer 11: road/mid, 475 map objects (25,753 bytes starting at 23,350,031, 0.02Mb)
1024-res layer 13: railway, 112 map objects (5288 bytes starting at 23,375,784, 0.01Mb)
1024-res layer 14: ferry, 10 map objects (1059 bytes starting at 23,381,072, 0.00Mb)
1024-res layer 16: amenity/major, 21 map objects (820 bytes starting at 23,382,131, 0.00Mb)
1024-res layer 20: map-border, 1 map object (582 bytes starting at 23,382,951, 0.00Mb)
1024-res layer 21: map-extent, 1 map object (548 bytes starting at 23,383,533, 0.00Mb)

Layers at a resolution of 2048 meters per pixel:
2048-res layer 0: boundary/major, 2 map objects (1540 bytes starting at 23,384,081, 0.00Mb)
2048-res layer 1: boundary/minor, 76 map objects (12,435 bytes starting at 23,385,621, 0.01Mb)
2048-res layer 4: waterway/major, 367 map objects (17,390 bytes starting at 23,398,056, 0.02Mb)
2048-res layer 6: land/major, 21 map objects (1688 bytes starting at 23,415,446, 0.00Mb)
2048-res layer 8: outline, 49 map objects (7225 bytes starting at 23,417,134, 0.01Mb)
2048-res layer 10: road/major, 123 map objects (7306 bytes starting at 23,424,359, 0.01Mb)
2048-res layer 11: road/mid, 379 map objects (19,279 bytes starting at 23,431,665, 0.02Mb)
2048-res layer 13: railway, 78 map objects (3633 bytes starting at 23,450,944, 0.00Mb)
2048-res layer 14: ferry, 10 map objects (899 bytes starting at 23,454,577, 0.00Mb)
2048-res layer 16: amenity/major, 4 map objects (174 bytes starting at 23,455,476, 0.00Mb)
2048-res layer 20: map-border, 1 map object (326 bytes starting at 23,455,650, 0.00Mb)
2048-res layer 21: map-extent, 1 map object (292 bytes starting at 23,455,976, 0.00Mb)

Layers at a resolution of 4096 meters per pixel:
4096-res layer 0: boundary/major, 2 map objects (1452 bytes starting at 23,456,268, 0.00Mb)
4096-res layer 1: boundary/minor, 76 map objects (8707 bytes starting at 23,457,720, 0.01Mb)
4096-res layer 4: waterway/major, 241 map objects (10,807 bytes starting at 23,466,427, 0.01Mb)
4096-res layer 6: land/major, 4 map objects (270 bytes starting at 23,477,234, 0.00Mb)
4096-res layer 8: outline, 16 map objects (2360 bytes starting at 23,477,504, 0.00Mb)
4096-res layer 10: road/major, 63 map objects (3745 bytes starting at 23,479,864, 0.00Mb)
4096-res layer 11: road/mid, 252 map objects (12,495 bytes starting at 23,483,609, 0.01Mb)
4096-res layer 13: railway, 39 map objects (1814 bytes starting at 23,496,104, 0.00Mb)
4096-res layer 14: ferry, 7 map objects (607 bytes starting at 23,497,918, 0.00Mb)
4096-res layer 16: amenity/major, 3 map objects (132 bytes starting at 23,498,525, 0.00Mb)
4096-res layer 20: map-border, 1 map object (206 bytes starting at 23,498,657, 0.00Mb)
4096-res layer 21: map-extent, 1 map object (172 bytes starting at 23,498,863, 0.00Mb)