Knowledge (XXG)

Shapefile

Source 📝

40: 1297:
must be limited to interspersing null shapes with the single shape type declared in the file's header. A shapefile must not contain both polyline and polygon data, for example, the descriptions for a well (point), a river (polyline), and a lake (polygon) would be stored in three separate datasets.
1296:
Because the shape type precedes each geometry record, a shapefile is technically capable of storing a mixture of different shape types. However, the specification states, "All the non-Null shapes in a shapefile are required to be of the same shape type." Therefore, this ability to mix shape types
194:
The shapefile format stores the geometry as primitive geometric shapes like points, lines, and polygons. These shapes, together with data attributes that are linked to each shape, create the representation of the geographic data. The term "shapefile" is quite common, but the format consists of a
1127:
Using this index, it is possible to seek backwards in the shapefile by, first, seeking backwards in the shape index (which is possible because it uses fixed-length records), then reading the record offset, and using that offset to seek to the correct position in the
1184:
file, which is used only by Esri software. The format is not documented by Esri. However it has been reverse-engineered and documented by the open source community. The 100-byte header is similar to the one in
1268:
values, ESRI software represents these values as zeros — a very serious issue for analyzing quantitative data, as it may skew representation and statistics if null quantities are represented as zero
282: 1241:
component files cannot exceed 2 GB (or 2 bytes) — around 70 million point features at best. The maximum number of feature for other geometry types varies depending on the number of vertices used.
1284:
Supported field types are: floating point (13 character storage), integer (4 or 9 character storage), date (no time storage; 8 character storage), and text (maximum 254 character storage)
1327: 814:
The variable-length record contents depend on the shape type, which must be either the shape type given in the file header or Null. The following are the possible shape types:
183:
The shapefile format is a digital vector storage format for storing geographic location and associated attribute information. This format lacks the capacity to store
1322: 491:. Each of the variable-length records includes a record-header component and a record-contents component. A detailed description of the file format is given in the 545:
The main file header is fixed at 100 bytes in length and contains 17 fields; nine 4-byte (32-bit signed integer or int32) integer fields followed by eight 8-byte (
1469: 191:
version 2 in the early 1990s. It is now possible to read and write geographical datasets using the shapefile format with a wide variety of software.
258:— shape index format; a positional index of the feature geometry to allow seeking forwards and backwards quickly {content-type: x-gis/x-shapefile} 1517:
Libraries – Open Source (Apache License) Java libraries for reading/writing shapefiles and the associated dBase files (libraries are part of the
1486: 1316: 1539: 1415: 458:, so an implementer of the file formats must be very careful to respect the endianness of each field and treat it properly. 1306: 132: 95: 1168:
The names and values of attributes are not standardized, and will be different depending on the source of the shapefile.
707:
The file then contains any number of variable-length records. Each record is prefixed with a record header of 8 bytes:
511: 1139:
file. However, since a shapefile is supposed to always contain an index, doing so counts as repairing a corrupt file.
507: 1311: 665: 668:(MBR) of all shapes contained within the dataset; four doubles in the following order: min X, min Y, max X, max Y 488: 232:, legacy GIS software may expect that the filename prefix be limited to eight characters to conform to the DOS 1165:. The open-source shapefile C library, for example, calls its format "xBase" even though it's plain dBase IV. 523: 228:
file, but alone is incomplete for distribution as the other supporting files are required. In line with the
1514: 1510: 539: 102: 1534: 479:) contains the geometry data. Geometry of a given feature is stored as a set of vector coordinates. The 196: 164: 1076:
file, followed by any number of 8-byte fixed-length records which consist of the following two fields:
527: 434:
files, the shapes in each file correspond to each other in sequence (i.e., the first record in the
363: 184: 1264:(the main open source software library for reading and writing shapefile format datasets) support 1161:
IV format. The format is public knowledge, and has been implemented in many dBase clones known as
1132:
file. It is also possible to seek forwards an arbitrary number of records using the same method.
558: 531: 484: 389: 204: 50: 1072:
The index contains positional index of the feature geometry and the same 100-byte header as the
1358: 107: 546: 140: 120: 331:— a geocoding index for read-write datasets (ODB format) {content-type: x-gis/x-shapefile} 136: 514:, where the order is similarly (longitude latitude). Geometries may also support 3- or 4- 1197:
file contains all of the information necessary to successfully parse the spatial data.
530:. The user-defined M dimension can be used for one of many functions, such as storing 319:— an attribute index of the active fields in a table {content-type: x-gis/x-shapefile} 309:— a spatial index of the features that are read-only {content-type: x-gis/x-shapefile} 1528: 1218: 1181: 1050:: MBR, Number of parts, Number of points, Parts, Part types, Points, Z range, Z array 296: 128: 1422: 522:
and measure, respectively. A Z-dimension stores the elevation of each coordinate in
233: 1492: 510:, using the order (X Y) or (Easting Northing). This axis order is consistent for 1287:
Floating point numbers may contain rounding errors since they are stored as text
1222: 480: 236:
convention, though modern software applications accept files with longer names.
188: 39: 1265: 1088: 775: 719: 572: 455: 371: 249: 152: 70: 17: 1470:"ArcGIS Desktop 9.3 Help – Geoprocessing considerations for shapefile output" 325:— a geocoding index for read-write datasets {content-type: x-gis/x-shapefile} 1503: 519: 515: 411: 381: 367: 526:, which can be used for analysis or for visualisation of geometries using 1506:– Open Source (MIT License) Python library for reading/writing shapefiles 1383: 1214: 934:: MBR, Number of parts, Number of points, Parts, Points, Z range, Z array 913:: MBR, Number of parts, Number of points, Parts, Points, Z range, Z array 407: 148: 144: 1518: 1272: 1252:
standard. This database format inherently has a number of limitations:
496: 195:
collection of files with a common filename prefix, stored in the same
1448: 1257: 1249: 1162: 1158: 265: 156: 1497: 1401: 1354: 1261: 1152: 1135:
It is possible to generate the complete index file given a lone
535: 415: 268:
IV format {content-type: application/octet-stream OR text/plain}
216: 160: 124: 85: 283:
well-known text representation of coordinate reference systems
696:
Range of M; two doubles in the following order: min M, max M
682:
Range of Z; two doubles in the following order: min Z, max Z
1157:
This file stores the attributes for each shape; it uses the
121:
data format for geographic information system (GIS) software
264:— attribute format; columnar attributes for each shape, in 1213:
The shapefile format does not have the ability to store
1189:. It is not currently implemented by other vendors. The 1008:: MBR, Number of parts, Number of points, Parts, Points 987:: MBR, Number of parts, Number of points, Parts, Points 870:
MBR, Number of parts, Number of points, Parts, Points
859:
MBR, Number of parts, Number of points, Parts, Points
187:
information. The shapefile format was introduced with
1328:
Comparison of geographic information systems software
623:
File length (in 16-bit words, including the header)
1245: 1238: 1234: 1194: 1190: 1136: 1129: 1073: 500: 451: 447: 443: 439: 435: 431: 427: 423: 403: 397: 393: 385: 377: 359: 353: 338: 334: 328: 322: 316: 312: 306: 302: 292: 288: 278: 261: 255: 245: 225: 211: 207: 101: 91: 81: 69: 63: 59: 55: 49: 1205:The shapefile format has a number of limitations. 763:Following the record header is the actual record: 506:The 2D axis ordering of coordinate data assumes a 955:: MBR, Number of points, Points, Z range, Z array 299:of the features {content-type: x-gis/x-shapefile} 44:A vector map, with points, polylines and polygons 1500:– Free c library for reading/writing shapefiles 1323:List of geographic information systems software 1225:do have the ability to store feature topology. 1217:relationships between shapes. The ESRI ArcInfo 131:for data interoperability among Esri and other 1278:Maximum length of field names is 10 characters 495:. This format should not be confused with the 285:{content-type: text/plain OR application/text} 135:. The shapefile format can spatially describe 1464: 1462: 1388:Geographic Information Systems Stack Exchange 248:— shape format; the feature geometry itself { 8: 1493:Esri – Understanding Topology and Shapefiles 438:file corresponds to the first record in the 32: 499:shape font source format, which shares the 1489:– Esri Webhelp docs for ArcGIS 10.0 (2010) 1193:file is not strictly necessary, since the 418:software {content-type: x-gis/x-shapefile} 454:files have various fields with different 1349: 1347: 1345: 1343: 1078: 816: 765: 709: 556: 487:followed by one or more variable-length 1339: 1359:"ESRI Shapefile Technical Description" 1244:The attribute database format for the 31: 7: 1384:"qgis - Creating missing .shx file?" 1248:component file is based on an older 493:ESRI Shapefile Technical Description 374:{content-type: application/fgdc+xml} 352:(ArcGIS 8 and later) {content-type: 230:ESRI Shapefile Technical Description 123:. It is developed and regulated by 483:consists of a single fixed-length 281:— projection description, using a 25: 1317:Open Source Geospatial Foundation 1209:Topology and the shapefile format 794:Shape type (see reference below) 651:Shape type (see reference below) 1521:but could be used independently) 1421:. 4 October 2011. Archived from 1172:Shapefile spatial index format ( 1121:Record length (in 16-bit words) 1107:Record offset (in 16-bit words) 752:Record length (in 16-bit words) 549:) signed floating point fields: 38: 1281:Maximum number of fields is 255 1029:: MBR, Number of points, Points 108:Shapefile Technical Description 1064:Shapefile shape index format ( 881:MBR, Number of points, Points 119:format is a geospatial vector 1: 1307:Geographic information system 512:Geographic coordinate systems 337:— an attribute index for the 151:, representing, for example, 29:Geospatial vector data format 1275:field names or field storage 1143:Shapefile attribute format ( 591:File code (always hex value 224:relates specifically to the 508:Cartesian coordinate system 1556: 1402:"Shapefile C Library V1.2" 1312:Open Geospatial Consortium 1150: 666:Minimum bounding rectangle 392:to be used {content-type: 167:that describe it, such as 1487:Shapefile file extensions 518:Z and M coordinates, for 37: 1504:Python Shapefile Library 1447:Cepicky, Jachym (2017). 738:Record number (1-based) 703:Shapefile record headers 467:Shapefile shape format ( 163:. Each item usually has 71:Internet media type 1540:GIS vector file formats 1453:switchfromshapefile.org 1449:"Switch from Shapefile" 366:in XML format, such as 1472:. Esri. 24 April 2009. 561:of a .shp file format 410:spatial index used by 388:) for identifying the 380:— used to specify the 1498:shapelib.maptools.org 534:measures or relative 133:GIS software products 609:Unused; five uint32 528:3D computer graphics 341:file in the form of 252:: x-gis/x-shapefile} 1056:: M range, M array 1035:: M range, M array 1014:: M range, M array 993:: M range, M array 961:: M range, M array 940:: M range, M array 919:: M range, M array 562: 364:geospatial metadata 205:filename extensions 34: 1292:Mixing shape types 1256:While the current 557: 532:linear referencing 446:files, etc.). The 390:character encoding 129:open specification 51:Filename extension 1428:on 13 August 2016 1271:Poor support for 1233:The size of both 1180:This is a binary 1125: 1124: 1061: 1060: 812: 811: 759:Shapefile records 756: 755: 700: 699: 553:Shapefile headers 406:— an alternative 398:x-gis/x-shapefile 354:x-gis/x-shapefile 113: 112: 82:Developed by 76:x-gis/x-shapefile 16:(Redirected from 1547: 1474: 1473: 1466: 1457: 1456: 1444: 1438: 1437: 1435: 1433: 1427: 1420: 1412: 1406: 1405: 1398: 1392: 1391: 1379: 1373: 1372: 1370: 1368: 1363: 1351: 1247: 1240: 1236: 1196: 1192: 1188: 1175: 1146: 1138: 1131: 1079: 1075: 1067: 817: 766: 710: 594: 563: 538:of a feature in 502: 478: 470: 453: 449: 445: 441: 437: 433: 429: 425: 405: 399: 395: 387: 379: 361: 355: 351: 340: 336: 330: 324: 318: 314: 308: 304: 294: 290: 280: 263: 257: 247: 227: 219: 213: 209: 65: 61: 57: 42: 35: 21: 1555: 1554: 1550: 1549: 1548: 1546: 1545: 1544: 1525: 1524: 1483: 1478: 1477: 1468: 1467: 1460: 1446: 1445: 1441: 1431: 1429: 1425: 1418: 1414: 1413: 1409: 1400: 1399: 1395: 1381: 1380: 1376: 1366: 1364: 1361: 1353: 1352: 1341: 1336: 1303: 1294: 1231: 1211: 1203: 1186: 1178: 1173: 1155: 1149: 1144: 1070: 1065: 1051: 1033:Optional Fields 1030: 1009: 988: 956: 935: 914: 893: 761: 705: 592: 555: 476: 475:The main file ( 473: 468: 464: 422:In each of the 342: 275: 242: 240:Mandatory files 215: 181: 77: 45: 30: 23: 22: 15: 12: 11: 5: 1553: 1551: 1543: 1542: 1537: 1527: 1526: 1523: 1522: 1507: 1501: 1495: 1490: 1482: 1481:External links 1479: 1476: 1475: 1458: 1439: 1407: 1393: 1382:Rollason, Ed. 1374: 1338: 1337: 1335: 1332: 1331: 1330: 1325: 1320: 1314: 1309: 1302: 1299: 1293: 1290: 1289: 1288: 1285: 1282: 1279: 1276: 1269: 1260:standard, and 1230: 1227: 1210: 1207: 1202: 1199: 1177: 1170: 1151:Main article: 1148: 1141: 1123: 1122: 1119: 1116: 1113: 1109: 1108: 1105: 1102: 1099: 1095: 1094: 1091: 1086: 1083: 1069: 1062: 1059: 1058: 1045: 1042: 1038: 1037: 1024: 1021: 1017: 1016: 1003: 1000: 996: 995: 982: 979: 975: 974: 971: 968: 964: 963: 950: 947: 943: 942: 929: 926: 922: 921: 908: 905: 901: 900: 890: 887: 883: 882: 879: 876: 872: 871: 868: 865: 861: 860: 857: 854: 850: 849: 846: 843: 839: 838: 835: 832: 828: 827: 824: 821: 810: 809: 808:Shape content 806: 803: 800: 796: 795: 792: 789: 786: 782: 781: 778: 773: 770: 760: 757: 754: 753: 750: 747: 744: 740: 739: 736: 733: 730: 726: 725: 722: 717: 714: 704: 701: 698: 697: 694: 691: 688: 684: 683: 680: 677: 674: 670: 669: 663: 660: 657: 653: 652: 649: 646: 643: 639: 638: 635: 632: 629: 625: 624: 621: 618: 615: 611: 610: 607: 604: 601: 597: 596: 589: 586: 583: 579: 578: 575: 570: 567: 554: 551: 472: 465: 463: 460: 420: 419: 401: 375: 357: 332: 326: 320: 310: 300: 286: 274: 271: 270: 269: 259: 253: 241: 238: 180: 177: 111: 110: 105: 99: 98: 93: 92:Type of format 89: 88: 83: 79: 78: 75: 73: 67: 66: 53: 47: 46: 43: 28: 24: 18:ESRI Shapefile 14: 13: 10: 9: 6: 4: 3: 2: 1552: 1541: 1538: 1536: 1533: 1532: 1530: 1520: 1516: 1512: 1508: 1505: 1502: 1499: 1496: 1494: 1491: 1488: 1485: 1484: 1480: 1471: 1465: 1463: 1459: 1454: 1450: 1443: 1440: 1424: 1417: 1411: 1408: 1403: 1397: 1394: 1389: 1385: 1378: 1375: 1360: 1357:(July 1998). 1356: 1350: 1348: 1346: 1344: 1340: 1333: 1329: 1326: 1324: 1321: 1318: 1315: 1313: 1310: 1308: 1305: 1304: 1300: 1298: 1291: 1286: 1283: 1280: 1277: 1274: 1270: 1267: 1263: 1259: 1255: 1254: 1253: 1251: 1242: 1228: 1226: 1224: 1220: 1216: 1208: 1206: 1200: 1198: 1183: 1182:spatial index 1171: 1169: 1166: 1164: 1160: 1154: 1142: 1140: 1133: 1120: 1117: 1114: 1111: 1110: 1106: 1103: 1100: 1097: 1096: 1092: 1090: 1087: 1084: 1081: 1080: 1077: 1063: 1057: 1055: 1049: 1046: 1043: 1040: 1039: 1036: 1034: 1028: 1025: 1022: 1019: 1018: 1015: 1013: 1007: 1004: 1001: 998: 997: 994: 992: 986: 983: 980: 977: 976: 972: 969: 966: 965: 962: 960: 954: 951: 948: 945: 944: 941: 939: 933: 930: 927: 924: 923: 920: 918: 912: 909: 906: 903: 902: 899: 897: 891: 888: 885: 884: 880: 877: 874: 873: 869: 866: 863: 862: 858: 855: 852: 851: 847: 844: 841: 840: 836: 833: 830: 829: 825: 822: 819: 818: 815: 807: 804: 801: 798: 797: 793: 790: 787: 784: 783: 779: 777: 774: 771: 768: 767: 764: 758: 751: 748: 745: 742: 741: 737: 734: 731: 728: 727: 723: 721: 718: 715: 712: 711: 708: 702: 695: 692: 689: 686: 685: 681: 678: 675: 672: 671: 667: 664: 661: 658: 655: 654: 650: 647: 644: 641: 640: 636: 633: 630: 627: 626: 622: 619: 616: 613: 612: 608: 605: 602: 599: 598: 590: 587: 584: 581: 580: 576: 574: 571: 568: 565: 564: 560: 552: 550: 548: 543: 541: 537: 533: 529: 525: 521: 517: 513: 509: 504: 498: 494: 490: 486: 482: 466: 461: 459: 457: 417: 413: 409: 402: 391: 383: 376: 373: 369: 365: 358: 349: 345: 333: 327: 321: 311: 301: 298: 297:spatial index 287: 284: 277: 276: 272: 267: 260: 254: 251: 244: 243: 239: 237: 235: 231: 223: 220:. The actual 218: 206: 202: 198: 192: 190: 186: 178: 176: 174: 170: 166: 162: 158: 154: 150: 146: 142: 138: 134: 130: 126: 122: 118: 109: 106: 104: 100: 97: 94: 90: 87: 84: 80: 74: 72: 68: 54: 52: 48: 41: 36: 27: 19: 1535:Open formats 1452: 1442: 1430:. Retrieved 1423:the original 1416:"SBN Format" 1410: 1396: 1387: 1377: 1365:. Retrieved 1295: 1243: 1232: 1229:Data storage 1223:geodatabases 1212: 1204: 1179: 1167: 1156: 1134: 1126: 1071: 1053: 1052: 1047: 1032: 1031: 1026: 1023:MultiPointM 1011: 1010: 1005: 990: 989: 984: 958: 957: 952: 949:MultiPointZ 937: 936: 931: 916: 915: 910: 895: 894: 813: 762: 706: 544: 505: 492: 474: 462:File formats 421: 347: 343: 250:content-type 234:8.3 filename 229: 221: 200: 199:. The three 193: 182: 172: 168: 127:as a mostly 116: 114: 26: 1519:AFC Library 1215:topological 1201:Limitations 1044:MultiPatch 878:MultiPoint 516:dimensional 503:extension. 481:binary file 273:Other files 203:files have 189:ArcView GIS 185:topological 173:temperature 153:water wells 1529:Categories 1334:References 1089:Endianness 981:PolylineM 907:PolylineZ 834:Null shape 823:Shape type 776:Endianness 720:Endianness 593:0x0000270a 573:Endianness 456:endianness 394:text/plain 384:(only for 372:XML schema 348:columnname 165:attributes 139:features: 1511:Shapefile 1221:and many 1219:coverages 1048:Mandatory 1027:Mandatory 1006:Mandatory 1002:PolygonM 985:Mandatory 953:Mandatory 932:Mandatory 928:PolygonZ 911:Mandatory 856:Polyline 520:elevation 412:MapServer 382:code page 370:or other 368:ISO 19115 344:shapefile 222:shapefile 201:mandatory 197:directory 117:shapefile 33:Shapefile 1301:See also 1262:GDAL/OGR 1054:Optional 1012:Optional 991:Optional 973:X, Y, M 959:Optional 938:Optional 917:Optional 896:Optional 867:Polygon 637:Version 540:4D space 524:3D space 416:GDAL/OGR 408:quadtree 360:.shp.xml 179:Overview 149:polygons 103:Standard 1432:21 June 1319:(OSGeo) 1273:Unicode 970:PointM 892:X, Y, Z 889:PointZ 826:Fields 497:AutoCAD 489:records 1367:4 July 1093:Usage 845:Point 791:little 780:Usage 724:Usage 693:little 690:double 679:little 676:double 662:little 659:double 648:little 634:little 577:Usage 559:Header 547:double 485:header 430:, and 214:, and 159:, and 157:rivers 147:, and 141:points 137:vector 1515:Dbase 1509:Java 1426:(PDF) 1419:(PDF) 1362:(PDF) 1258:dBase 1250:dBase 1163:xBase 1159:dBase 1115:int32 1101:int32 1082:Bytes 848:X, Y 837:None 820:Value 788:int32 769:Bytes 746:int32 732:int32 713:Bytes 687:84–99 673:68–83 656:36–67 645:int32 642:32–35 631:int32 628:28–31 617:int32 614:24–27 603:int32 585:int32 566:Bytes 266:dBase 161:lakes 145:lines 1513:and 1434:2023 1369:2007 1355:ESRI 1266:null 1246:.dbf 1239:.dbf 1237:and 1235:.shp 1195:.shp 1191:.sbn 1187:.shp 1174:.sbn 1153:.dbf 1145:.dbf 1137:.shp 1130:.shp 1085:Type 1074:.shp 1066:.shx 898:: M 772:Type 716:Type 600:4–23 569:Type 536:time 501:.shp 477:.shp 469:.shp 452:.shx 450:and 448:.shp 444:.dbf 442:and 440:.shx 436:.shp 432:.dbf 428:.shx 424:.shp 414:and 404:.qix 386:.dbf 378:.cpg 350:.atx 339:.dbf 335:.atx 329:.mxs 323:.ixs 317:.aih 315:and 313:.ain 307:.fbx 305:and 303:.fbn 295:— a 293:.sbx 291:and 289:.sbn 279:.prj 262:.dbf 256:.shx 246:.shp 226:.shp 217:.dbf 212:.shx 208:.shp 169:name 125:Esri 115:The 86:Esri 64:.dbf 60:.shx 56:.shp 1118:big 1112:4–7 1104:big 1098:0–3 785:0–3 749:big 743:4–7 735:big 729:0–3 620:big 606:big 588:big 582:0–3 396:OR 171:or 96:GIS 1531:: 1461:^ 1451:. 1386:. 1342:^ 1041:31 1020:28 999:25 978:23 967:21 946:18 925:15 904:13 886:11 799:4– 595:) 542:. 426:, 362:— 210:, 175:. 155:, 143:, 62:, 58:, 1455:. 1436:. 1404:. 1390:. 1371:. 1176:) 1147:) 1068:) 875:8 864:5 853:3 842:1 831:0 805:– 802:– 471:) 400:} 356:} 346:. 20:)

Index

ESRI Shapefile

Filename extension
Internet media type
Esri
GIS
Standard
Shapefile Technical Description
data format for geographic information system (GIS) software
Esri
open specification
GIS software products
vector
points
lines
polygons
water wells
rivers
lakes
attributes
topological
ArcView GIS
directory
filename extensions
.dbf
8.3 filename
content-type
dBase
well-known text representation of coordinate reference systems
spatial index

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.