Open Geospatial Consortium
Submission Date: 2018-03-20
Approval Date: 2018-08-27
Publication Date: 2018-12-19
External identifier of this OGC® document: http://www.opengis.net/doc/BP/shapefile-

guidance/1.1

Internal reference number of this OGC® document: 16-070r3
Version: 1.1
Category: OGC® Best Practice
Editor: Carl Reed

Volume 4: OGC CDB Best Practice use of Shapefiles for
Vector Data Storage
Copyright notice
Copyright © 2018 Open Geospatial Consortium
To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.

Warning
This document defines an OGC Best Practices on a particular technology or approach
related to an OGC standard. This document is not an OGC Standard and may not bereferred to as an OGC Standard. It is subject to change without notice. However, thisdocument is an official position of the OGC membership on this particular technology
topic.

Document type:
Document subtype:
Document stage:
Document language:

OGC® Best PracticeApproved
EnglishCopyright © 2018 Open Geospatial Consortium

1

License Agreement
Permission is hereby granted by the Open Geospatial Consortium, ("Licensor"), free of charge and subject to the terms set forth below,
to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property
without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish,
distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to
do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual
Property is furnished agrees to the terms of this Agreement.
If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above
copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR.
THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTSTHAT MAY BE IN FORCE ANYWHERE IN THE WORLD.
THE INTELLECTUAL PROPERTY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULARPURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDEDIN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILLMEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE
UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT
THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OFINTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY
DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTINGFROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH
THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY.
This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all
copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except asprovided in the following sentence, no such termination of this license shall require the termination of any third party end-user
sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual
Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent,
copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license
without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy orcause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party.
Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual
Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without
prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may
authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any
LICENSOR standards or specifications. This Agreement is governed by the laws of the Commonwealth of Massachusetts. The
application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly
excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be
modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No
decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it.

Copyright © 2018 Open Geospatial Consortium2

Contents
1.

Scope ........................................................................................................................... 52.

Conformance ............................................................................................................... 5

3.

References ................................................................................................................... 6

4.

Terms and Definitions................................................................................................. 6

5.

Conventions ................................................................................................................ 6
5.1

6.

Identifiers ............................................................................................................. 6

General Guidance on the use of Shapefiles ................................................................ 7
A.1 General Shapefile Implementation Feature Rule ............................................. 11
A.2 Shapefile Point Vertices ....................................................................................... 11

Annex C Shapefile dBASE III guidance .......................................................................... 14
The data file header structure for dBASE III PLUS table file. ..................................... 14
The table file header: ................................................................................................ 14
Table Field Descriptor Bytes .................................................................................... 15
Table Records ............................................................................................................... 15
File Structure: ......................................................................................................... 16
The field descriptor array: ..................................................................................... 17
Database records:........................................................................................................ 17
Memo Fields And .DBT Files ..................................................................................... 18
The table file header: .............................................................................................. 18
Table Records .......................................................................................................... 19

Copyright © 2018 Open Geospatial Consortium3i.
Abstract
This CDB volume provides the information and guidance required to store vector data
and attributes using the Esri Shapefile specification in a CDB data store. All shape types
are supported to represent point, line, and polygon features.
ii.
Keywords
The following are keywords to be used by search engines and document catalogues.
ogcdoc, OGC document, shapefile, cdb, vector, point, line, polygoniii.
Preface
Attention is drawn to the possibility that some of the elements of this document may be
the subject of patent rights. The Open Geospatial Consortium shall not be held
responsible for identifying any or all such patent rights.
Recipients of this document are requested to submit, with their comments, notification of
any relevant patent claims or other intellectual property rights of which they may beaware that might be infringed by any implementation of the standard set forth in thisdocument, and to provide supporting documentation.

iv.

Submitting organizations
The following organizations submitted this Document to the Open Geospatial
Consortium (OGC):CAE Inc.
Carl Reed, OGC Individual Member
Envitia, Ltd
Glen Johnson, OGC Individual Member
KaDSci, LLC
Laval University
Open Site Plan
University of Calgary
UK Met Office
The OGC CDB standard is based on and derived from an industry developed andmaintained specification, which has been approved and published as OGC Document 15003r1: OGC Common DataBase Volume 1 Core. An extensive listing of contributors to
the legacy industry-led CDB specification is at Chapter 11, pp 475-476 in that OGC Best
Practices Document (https://portal.opengeospatial.org/files/?artifact_id=61935).

Copyright © 2018 Open Geospatial Consortium4

v.

Submitters
All questions regarding this submission should be directed to the editor or the submitters:

Name

1.

Affiliation

Carl Reed

Carl Reed & Associates

David Graham

CAE Inc.

Scope

This CDB Best Practice volume defines the requirements and provides guidance on how
to use Esri ShapeFiles in a CDB data store.
For ease of editing and review, the standard has been separated into 12 Volumes and aschema repository.
● Volume 0: OGC CDB Companion Primer for the CDB standard. (Best Practice)● Volume 1: OGC CDB Core Standard: Model and Physical Data Store Structure.
The main body (core) of the CBD standard (Normative).
• Volume 2: OGC CDB Core Model and Physical Structure Annexes (BestPractice).
● Volume 3: OGC CDB Terms and Definitions (Normative).
● Volume 4: OGC CDB Use of Shapefiles for Vector Data Storage (Best Practice).
● Volume 5: OGC CDB Radar Cross Section (RCS) Models (Best Practice).
● Volume 6: OGC CDB Rules for Encoding Data using OpenFlight (Best Practice).
● Volume 7: OGC CDB Data Model Guidance (Best Practice).
● Volume 8: OGC CDB Spatial Reference System Guidance (Best Practice).
● Volume 9: OGC CDB Schema Package: provides the normative schemas for key
features types required in the synthetic modelling environment. Essentially, theseschemas are designed to enable semantic interoperability within the simulation
context. (Normative)● Volume 10: OGC CDB Implementation Guidance (Best Practice).
● Volume 11: OGC CDB Core Standard Conceptual Model (Normative)● Volume 12: OGC CDB Navaids Attribution and Navaids Attribution
Enumeration Values (Best Practice)2.

ConformanceThis standard defines conformance class for testing the use of Esri Shapefiles for storing
vector data in a CDB data store.
Copyright © 2018 Open Geospatial Consortium

5

Conformance with this standard shall be checked using all the relevant tests specified in
Annex A (normative) of this document. The framework, concepts, and methodology fortesting, and the criteria to be achieved to claim conformance are specified in the OGC
Compliance Testing Policies and Procedures and the OGC Compliance Testing web site1.
All requirements-classes and conformance-classes described in this document are ownedby the standard(s) identified.

3.

References

The following normative documents contain provisions that, through reference in thistext, constitute provisions of this document. For dated references, subsequent
amendments to, or revisions of, any of these publications do not apply. For undated
references, the latest edition of the normative document referred to applies.
Esri ShapeFile Technical Description(https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf)

4.

Terms and Definitions

This document uses the terms defined in Sub-clause 5.3 of [OGC 06-121r8], which isbased on the ISO/IEC Directives, Part 2, Rules for the structure and drafting ofInternational Standards. In particular, the word “shall” (not “must”) is the verb form used
to indicate a requirement to be strictly followed to conform to this standard.
Please see the CDB Volume 3: Terms and Definitions document.
http://www.opengeospatial.org/standards/cdb

5.

Conventions

This section provides details and examples for any conventions used in the document.
Examples of conventions are symbols, abbreviations, use of XML schema, or special
notes regarding how to read the document.
5.1
Identifiers
The normative provisions in this standard are denoted by the URI
http://www.opengis.net/spec/cdb/1.1/shapefile1

www.opengeospatial.org/cite

Copyright © 2018 Open Geospatial Consortium

6All requirements and conformance tests that appear in this document are denoted bypartial URIs which are relative to this base.
For the sake of brevity, the use of “req” in a requirement URI denotes:
http://www.opengis.net/spec/cdb/1.1/shapefile
An example might be:req/shapefile/storage

6.

General Guidance on the use of Shapefiles

A Shapefile is a specification for encoding and storing vector data storage format forstoring the location, shape, and attributes of geographic features. A Shapefile is stored asa set of related files and contains one feature class. The Shapefile specification wasdeveloped by Esri.
In a CDB Shapefile, the position of all points is expressed using WGS-84 geographic
coordinates (latitude, longitude, altitude), as explained in Volume 8: CDB Spatial
Reference Systems Guidance.
As per Esri Shapefile Technical Description, the set of attributes of Vector features are
stored in dBase III+ files. Refer to Annex E in Volume 22 of the CDB standard: CDB
Annexes for the dBase III file format description and recommended encodings. The
CDB standard provides three attribution schemas to represent attribution data:•••

Instance-level attribution schemaClass-level attribution schema
Extended-level attribution schema

Requirements Class - Shapefiles (1-2)/req/shapefile/general
Target typeOperations

Dependency

Shapefile specification

Requirement 1/req/shapefile/vector-shp-rule

Requirement 2/req/shapefile/shapefile-reader

2 Volume 2:

OGC CDB Core Model and Physical Structure Annexes (Best Practice)

Copyright © 2018 Open Geospatial Consortium

7

To completely represent the vector data and attributes in a given tile as a Shapefile, the
CDB standard requires that a Vector dataset consists of some or all of the following files:•*.shp – feature shape files that provides the geometric aspects of each instance of avector feature (point, lineal, and polygon features).

Requirement 1 Vector Shapefile Shape Typehttp://www.opengis.net/spec/cdb/1.1/shapefile/vector-shp-rule
All instances of the feature SHALL be of the same Shape type. While the Shapefile
format supports up to 13 different types (each one stored in a different shape file), the
CDB standard requires a maximum of one Shapefile type for point features, a maximumof one Shapefile type for lineal features and a maximum of one Shapefile type forpolygon features for each tile (for a maximum of 3 feature Shapefiles per tile).
•*.shx – feature index files that stores the file offsets and content lengths for each of
the records of the feature files. The only purpose of these files is to provide a
simple means for clients to step through the individual records of the feature files(i.e., it contains no CDB modeled data).

•*.dbf – feature instance-level files that provide the instance-level attribution data
for each of the records of the feature.

•*.dbf – feature class-level files that provide the class-level attribution data for eachclass of features present in the feature shape files.

•*.dbf – feature extended-level files that provide optional extended-level attribution
data for entries in either the feature instance- or class-level files.

•*.shp – figure point shape files allow modelers the ability to assign specificattribution for each point in lineal or polygon features. Without this additional
Shapefile, the Shapefile format only allows specifying a single attribution for theentire lineal or polygon feature. The CDB standard extends the concept to allow
specific attribution to each point of these features while enforcing position
correlation. For instance, in case of a PowerLine feature, it is possible to associate,
within the same dataset, a different geometric representation of a PowerLine pylon
for each point of the lineal and still maintain the relationship between the point andthe lineal.

•*.shx – figure point index files that stores the file offsets and content lengths foreach of the records of the figure point shape files.

•*.dbf – figure point instance-level files that provide the instance-level attribution
data for each of the records of the figure point shape files.

Copyright © 2018 Open Geospatial Consortium8•*.dbf – figure point class-level files that provide the class-level attribution data foreach class of features present in the figure point shape files•*.dbf – figure point extended-level files that provide optional extended-level
attribution data for entries in either the figure point instance- or class-level files.

*.dbf – 2D relationship files. These files establish the relationship of point, lineal,and polygon features of a single or different datasets in a tile and between tiles.
In addition to *.shp, *.dbf and *.shx files, the Shapefile specification also refers to amemo file with a *.dbt file that is used to store comment fields associated with theattribution *.dbf file.

•

All of the information that is needed to instance features is organized in accordance to the
CDB tile structure. All the tiled Shapefile dataset files are located in the same directory.
The dataset’s second component selector (CS2) is used to differentiate between files withthe same extension or with the same Vector features. Table 6-1: Component Selector 2
for Vector Dataset, presents the list of codes that are allocated. Note that Vector datasets
do not necessarily use all of the Dataset Component Selector 2 reserved codes. Users of
the CDB standard should refer to the appropriate section for an enumeration of the
supported File Component Selector 2 codes as well as the ones specific to the Dataset.
The Vector dataset concept and the feature code concepts overlap somewhat; some of the
Vector datasets are generalizations or specializations of feature codes. Section 1.5 of the
OGC CDB Core Standard: Model and Physical Data Store Structure (Volume 1) provides
a recommended mapping of the feature attributes across the CDB compliant datasets.
Note that the same feature should not have two representations.
Table 6-1: Component Selector 2 for Vector Datasets
CS2
001
002
003
004
005
006
007
008
009

File
Extension
*.shp
*.shx
*.dbf
*.dbf
*.shp
*.shx
*.dbf
*.dbf
*.shp
*.shx
*.dbf
*.dbf
*.shp
*.shx
*.dbf
*.dbf
*.shp
*.shx
*.dbf

Dataset Component Name
Point features
Point feature class-level attributes
Lineal features

Supported Shape Type
Point, PointZ, PointM,
MultiPoint, MultiPointZ,
MultiPointM
N/A
PolyLine, PolyLineZ,
PolyLineM

Lineal feature class-level attributes
Polygon features

N/A
Polygon, PolygonZ,
PolygonM, Multipatch

Polygon feature class-level attributes
Lineal figure point features

N/A
Point, PointZ, PointM,
MultiPoint, MultiPointZ,
MultiPointM
N/A
Point, PointZ, PointM,
MultiPoint, MultiPointZ,
MultiPointM

Lineal figure point feature class-level attributes
Polygon figure point features

Copyright © 2018 Open Geospatial Consortium

9

010

*.dbf

Polygon figure point feature class-level
attributes
2D relationship tile connections
Deprecated

N/A

011
012

*.dbf

013

Deprecated

N/A

014

Deprecated

N/A

2D relationship dataset connections
Point feature extended-level attributes
Lineal feature extended-level attributes
Polygon feature extended-level attributes
Lineal Figure Point extended-level attributes
Polygon Figure Point extended-level attributes

N/A
N/A
N/A
N/A
N/A
N/A

015
016
017
018
019
020

*.dbf
*.dbf
*.dbf
*.dbf
*.dbf
*.dbf

N/A
N/A

Notes about Shapefile Polygon Shapes
Even though the Shapefile standard is very versatile, it also enforces some guidelines
with respect to the Polygon Shapes. Those guidelines are referred to in Volume 4: OGC
CDB Use of Shapefiles for Vector Data Storage (Best Practice).
Requirement 2 Shapefile polygon readers
http://www.opengis.net/spec/cdb/1.1/shapefile/polygon-rules-reader

Although the above are guidelines, Shapefile readers SHALL handle the following caseswith proper error handling and reporting for Polygon shapes:••••

Has no self-intersections or co-linear segments
Has no identical consecutive points (no zero-length segments)
Does not degenerate into zero-area parts
Does not have clock-wise inner rings (“Dirty Polygon”)

Copyright © 2018 Open Geospatial Consortium

10Annex A: Conformance Class Abstract Test Suite (Normative)
Conformance Test Class: OGC CDB Shapefiles for vector data storage
This section describes conformance test for the OGC CDB Standard Core. These abstract
test cases describe the conformance criteria for verifying the structure and content of any
data store claiming conformance to the CDB standard.
The conformance class id is “http://www.opengis.net/spec/cdb-shapefile/1.0/conf/” and allof the other conformance tests URLs are created in this path. Another issue that thereader should pay attention to is the test method. When the test method is assigned with
“Visual”, it means that the purpose of the test should be “visually” investigate the filecontents, image, or other content.
A.1 General Shapefile Implementation Feature Rule
The following conformance test is designed is to determine if a CDB vector Shapefile
adheres to the feature type instance rule.
Conformance 1/conf/shapefile/vector-shape-rule

Requirement 1/req/shapefile/vector-shp-rule

Dependency

Shapefile specification

Test

Test
purposeVerify that all instances of the feature are of the same
Shape type.

Test method Visual inspection. Pass if verified
Test type

Conformance

A.2 Shapefile Point Vertices
Ensure that Shapefile readers handle the following cases with proper error handling andreporting for Polygon shapes:••••
Conformance 2

Has no self-intersections or co-linear segments
Has no identical consecutive points (no zero-length segments)
Does not degenerate into zero-area parts
Does not have clock-wise inner rings (“Dirty Polygon”)/conf/shapefile/polygon-rules-reader

Copyright © 2018 Open Geospatial Consortium

11

Requirement 2

req/shapefile/polygon-rules-reader

Dependency

Shapefile specification

Test

Test
purposeVerify that a Shapefile reader handles polygon data
correctly and that any errors in the polygon data as per
requirement 2 are properly handled and reported.

Test method Visual inspection. Pass if verified
Test type

Copyright © 2018 Open Geospatial Consortium

Conformance12Annex B Revision history

Date

ReleaseAuthorParagraph modified Description

2/6/2016

Draft

C ReedMany

3/12/2016 Draft

C ReedMany

3/18/2015 Draft

C ReedVarious11/15/16

Final

C ReedVarious

Final edits for publication

12/28/17

Draft

C. Reed Various

Draft edits for version 1.1.

Copyright © 2018 Open Geospatial Consortium

Ready for OAB review
Add Shapefile normative text
from core into this document andredo requirements and ATS
Remove RCS and put in separate
volume.

13

Annex C Shapefile dBASE III guidance
Was B.1.3

Annex B Volume 2 of the OGC CDB Best PracticedBASE .DBF File Structure
by Borland Developer Support Staff
Technical Information Database
This document has been annotated to reflect the conventions established by the CDB
standard. Collectively, these conventions are referred to as dBASE/CDB. The
conventions define how dBASE files are interpreted by a CDB-compliant dBASE reader;the stated conventions supersede or replace related aspects of this annotatedspecification. Unless stated otherwise, CDB-compliant dBASE readers will ignore any
data that fails to conform to the stated conventions.
Note on directory and file names: Shape/CDB Readers: The CDB standard globallyprovides a set of directory and filename conventions. The conventions do not limit
filenames to the 8.3 naming convention
TI838D.txt dBASE .DBF File Structure
Category :Database Programming
Platform :All
Product :Delphi All
Description:
Sometimes it is necessary to delve into a dBASE table outside the control of the Borland
Database Engine (BDE). For instance, if the .DBT file (that contains memo data) for agiven table is irretrievably lost, the file will not be usable because the byte in the fileheader indicates that there should be a corresponding memo file. This necessitates
toggling this byte to indicate no such accompanying memo file. Or, you may just want towrite your own data access routine.
Below are the file structures for dBASE table files. Represented are the file structures as
used for various versions of dBASE: dBASE III PLUS 1.1, dBASE IV 2.0, dBASE 5.0
for DOS, and dBASE 5.0 for Windows.

************************************************************************The data file header structure for dBASE III PLUS table file.
************************************************************************The table file header:======================
Copyright © 2018 Open Geospatial Consortium

14

Byte

Contents

0

1 Byte1-3
4-7

3 Bytes
32 bitnumber
16 bitnumber
16 bitnumber3 Bytes
13 Bytes
4 Bytes
32 Byteseach
1 Byte

8-9
10-11
12-14
15-27
28-31
32-n
N+1

Description
Valid dBASE III PLUS table file (03h without a memo (.DBT file; 83h with amemo).
Date of last update; in YYMMDD format
Number of records in the table
Number of bytes in the header
Number of bytes in the record
Reserved Bytes
Reserved for dBASE III PLUS on a LAN
Reserved bytes
Field descriptor array (the structure of this array is shown below).
0Dh stored as the field terminator. n above is the last byte in the field descriptor
array. The size of the array depends on the number of fields in the table file.

Table Field Descriptor Bytes
Byte Contents
0-10
11
12-15
16
17
18-19
20
21-22
23
24

11 Bytes
1 Byte4 Bytes
1 Byte1 byte2 Bytes
1 Byte2 Bytes
1 Byte1 ByteDescription

Field name in ASCII (zero-filled).
Field type in ASCII (C, D, L, M, or N).
Field data address (address is set in memory; not useful on disk).
Field length in binary
Field decimal count in binary
Reserved for dBASE III PLUS on a LAN
Work area ID
Reserved for dBASE III PLUS on a LAN
SET FIELDS flag
Reserved bytes

Table Records=============The records follow the header in the table file. Data records are preceded by one byte,that is, a space (20h) if the record is not deleted, an asterisk (2Ah) if the record is deleted.
Fields are packed into records without field separators or record terminators. The end of
the file is mark by a single byte, with the end-of-file marker, an OEM code page
character value of 26 (1Ah). You can input OEM code page data as indicated below.
Allowable Input for dBASE Data Types====================================
Data Type

Data Input

Copyright © 2018 Open Geospatial Consortium

15

C(Character)
D (Date)N(Numeric)
L (Logical)
M(Memo)All OEM code page characters
Numbers and a character to separate month, day, and year (stored internally as 8 digits in
YYYYMMDD format)
0123456789? Y y N n T t F f (? when not initialized).
All OEM code page characters (stored internally as 10 digits representing a .DBT blocknumber).

Binary, Memo, and OLE Fields And .DBT Files===========================================
Memo fields store data in .DBT files consisting of blocks numbered sequentially (0, 1, 2,
and so on). The size of these blocks are internally set to 512 bytes. The first block in the.DBT file, block 0, is the .DBTfile header.
Memo field of each record in the .DBF file contains the number of the block (in OEM
code page values) where the field's data actually begins. If a field contains no data, the.DBF file contains blanks (20h) rather than a number.
When data is changed in a field, the block numbers may also change and the number inthe .DBF may be changed to reflect the new location.
This information is from the Using dBASE III PLUS manual, Appendix C.
************************************************************************The data file header structure for dBASE IV 2.0 table file.
************************************************************************
File Structure:===============
Byte

Contents

0

1 Byte

1-2
4-7
8-9
10-11
12-13
14
15
16-27

3 Bytes
32 bit number
16 bit number
16 bit number
2 Bytes
1 Byte1 Byte12 Bytes

Meaning
Valid dBASE IV file; bits 0-2 indicate version number, bit 3 thepresence of a dBASE IV memo file, bits 4-6 the presence of an SQL
table, bit 7 the presence of any memo file (either dBASE III PLUS ordBASE IV).
Date of last update; formatted as YYMMDD
Number of records in the fileNumber of bytes in the header
Number of bytes in the record
Reserved; fill with 0
Flag indicating incomplete transaction.
Encryption flag.
Reserved for dBASE IV in a multi-user environment.

Copyright © 2018 Open Geospatial Consortium

16

28
29
30-31
32-n*
N+1

1 Byte1 Byte2 Bytes
32 Bytes each
1 ByteProduction MDX file flag; 01H if there is an MDX, 00H if not.
Language driver ID
Reserved; fill with 0.
Field descriptor array (see below).
0DH as the field terminator* n is the last byte in the field descriptor array. The size of the array depends on thenumber of fields in the database file.
The field descriptor array:===========================
Byte

Contents

Meaning

0-10

11 Bytes

Field name in ASCII (zero-filled).

11

1 ByteField type in ASCII (C, D, F, L, M, or N).

12-15

4 Bytes

Reserved

16

1 ByteField length in binary

17

1Field decimal count in binary

18-19

2

Reserved

20

1Work area ID

21-30

10

Reserved

31

1

Production MDX field flag; 01H if field has an index tag in the production MDX
file, 00H if not.

Database records:=================The records follow the header in the database file. Data records are preceded by one byte;that is, a space (20H) if the record is not deleted, an asterisk (2AH) if the record isdeleted. Fields are packed into records without field separators or record terminators. The
end of the file is marked by a single byte, with the end-of-file marker an ASCII 26 (1AH)
character.
Allowable Input for dBASE Data Types:====================================

Copyright © 2018 Open Geospatial Consortium

17

Data

Type

Data Input

C

Character

All OEM code page characters

D

Date

Numbers and a character to separate month, day, and year (stored internally as 8 digits
in YYYYMMDD format).

F

Floating. 0 1 2 3 4 5 6 7 8 9 point binary numericN

Binary.0 1 2 3 4 5 6 7 8 9 coded decimal numeric

L

Logical? Y y N n T t F f (? when not initialized).

M

Memo

All OEM code page characters (stored internally as 10 digits representing a .DBT
block number).

Memo Fields And .DBT Files===========================================
Memo fields store data in .DBT files consisting of blocks numbered sequentially (0, 1, 2,
and so on). SET BLOCKSIZE determines the size of each block. The first block in the.DBT file, block 0, is the .DBT file header.
Each memo field of each record in the .DBF file contains the number of the block (inOEM code page values) where the field's data actually begins. If a field contains no data,
the .DBF file contains blanks (20h) rather than a number.
When data is changed in a field, the block numbers may also change and the number inthe .DBF may be changed to reflect the new location.
This information is from the dBASE IV Language Reference manual, Appendix D.
************************************************************************The data file header structure for dBASE 5.0 for DOS table file.
************************************************************************The table file header:======================
Byte Contents----- -------Byte

Description-------------------------------------------------------Contents

Copyright © 2018 Open Geospatial Consortium

Description

18

0

1 Byte

1-3
4-7
8-9
10-11
12-13
14
15
16-27
28

3 bytes
32 bit number
16 bit number
16 bit number
2 bytes
1 byte1 byte12 bytes
1 byte

29
30-31
32-n

1 byte2 bytes
32 bytes

N+1

1 byteValid dBASE for Windows table file; bits 0-2 indicate version
number; bit 3 indicates presence of a dBASE IV or dBASE for
Windows memo file; bits 4-6 indicate the presence of a dBASE IV
SQL table; bit 7 indicates the presence of any .DBT memo file(either a dBASE III PLUS type or a dBASE IV or dBASE for
Windows memo file).
Date of last update; in YYMMDD format
Number of records in the table
Number of bytes in the header
Number of bytes in the record
Reserved; filled with zeros
Flag indicating incomplete dBASE transaction
Encryption flag.
Reserved for multi-user processing
Production MDX flag; 01h stored in this byte if a production .MDX
file exists for this table; 00h if no .MDX file exists.
Language driver ID.
Reserved; filled with zeros.
Field descriptor array (the structure of this array is each shown
below)
0Dh stored as the field terminator

n above is the last byte in the field descriptor array. The size of the array depends on thenumber of fields in the table file.
Table Field Descriptor Bytes============================
Byte
0-10
11
12-15
16
17
18-19
20
21-30
31

Contents
11 bytes
1 byte4 bytes
1 byte1 byte2 bytes
1 byte10 bytes
1 bytes

Description
Field name in ASCII (zero-filled).
Field type in ASCII (B, C, D, F, G, L, M, or N).
Reserved
Field length in binary
Field decimal count in binary
Reserved
Work area ID
Reserved
Production .MDX field flag; 01h if field has an index tag in the
production .MDX file; 00h if the field is not indexed

Table Records=============The records follow the header in the table file. Data records are preceded by one byte,that is, a space (20h) if the record is not deleted, an asterisk (2Ah) if the record is deleted.
Fields are packed into records without field separators or record terminators. The end of
the file is marked by a single byte, with the end-of-file marker, an OEM code page
character value of 26 (1Ah). You can input OEM code page data as indicated below.

Copyright © 2018 Open Geospatial Consortium

19

Allowable Input for dBASE Data Types====================================
Data TypeC (Character)
D (Date)F (Floating
N (Numeric)
L (Logical)
M (Memo)

Data Input

All OEM code page characters.
Numbers and a character to separate month, day, and year (stored internally as 8
digits in YYYYMMDD format)- . 0 1 2 3 4 5 6 7 8 9 point binary numeric)-.0123456789? Y y N n T t F f (? when not initialized).
All OEM code page characters (stored internally as 10 digits representing a .DBT
block number).

Memo Fields And .DBT Files==========================================
Memo fields store data in .DBT files consisting of blocks numbered sequentially (0, 1, 2,
and so on). SET BLOCKSIZE determines the size of each block. The first block in the.DBT file, block 0, is the .DBT file header.
Each memo field of each record in the .DBF file contains the number of the block (inOEM code page values) where the field's data actually begins. If a field contains no data,
the .DBF file contains blanks (20h) rather than a number.
When data is changed in a field, the block numbers may also change and the number inthe .DBF may be changed to reflect the new location.
Unlike dBASE III PLUS, if you delete text in a memo field, dBASE 5.0 for DOS may
reuse the space from the deleted text when you input new text. dBASE III PLUS always
appends new text to the end of the .DBT file. In dBASE III PLUS, the .DBT file size
grows whenever new text is added, even if other text in the file is deleted.
This information is from the dBASE for DOS Language Reference manual, Appendix C.
************************************************************************The data file header structure for dBASE 5.0 for Windows table file.
************************************************************************The table file header:======================

Copyright © 2018 Open Geospatial Consortium

20

Byte i.Contents

Description

0

1 Byte

1-3
4-7

12-13
14
15
16-27
28

3 Bytes
32 bitnumber
16 bitnumber
16 bitnumber
2 Bytes
1 Byte1 Byte12 Bytes
1 ByteValid dBASE for Windows table file; bits 0-2 indicate version number; bit 3
indicates presence of a dBASE IV or dBASE for Windows memo file; bits 4-6
indicate the presence of a dBASE IV SQL table; bit 7 indicates the presence of any.DBT memo file (either a dBASE III PLUS type or a dBASE IV or dBASE for
Windows memo file).
Date of last update; in YYMMDD format.
Number of records in the table.

29
30-31
32-n
N+1

1 Byte2 Bytes
32 Bytes
1 Byte8-9
10-11

Number of bytes in the header.
Number of bytes in the record.
Reserved; filled with zeros.
Flag indicating incomplete dBASE IV transaction.
dBASE IV encryption flag.
Reserved for multi-user processing
Production MDX flag; 01h stored in this byte if a production .MDX file exists forthis table; 00h if no .MDX file exists
Language driver ID
Reserved; filled with zeros
Field descriptor array (the structure of this array is each shown below)
0Dh stored as the field terminator.

n above is the last byte in the field descriptor array. The size of the array depends on thenumber of fields in the table file.
Table Field Descriptor Bytes============================
Byte
0-10
1
12-15
16
17
18-19
20
21-30
31

Contents
11 Bytes
1 byte4 bytes
1 byte1 byte2 bytes
1 byte10 bytes
1 byte.

Description
Field name in ASCII (zero-filled).
Field type in ASCII (B, C, D, F, G, L, M, or N).
Reserved.
Field length in binary
Field decimal count in binary
Reserved
Work area ID
Reserved
Production .MDX field flag; 01h if field has an index tag in the
production .MDX file; 00h if the field is not indexed

Table Records (See above)=============The records follow the header in the table file. Data records are preceded by one byte,that is, a space (20h) if the record is not deleted, an asterisk (2Ah) if the record is deleted.
Copyright © 2018 Open Geospatial Consortium

21

Fields are packed into records without field separators or record terminators. The end of
the file is marked by a single byte, with the end-of-file marker, an OEM code page
character value of 26 (1Ah). You can input OEM code page data as indicated below.
Allowable Input for dBASE Data Types====================================
Data Type

Data Input-------------- ----------------------------------------------------------B (Binary)

All OEM code page characters (stored internally as 10

digits representing a .DBT block number).
C (Character) All OEM code page characters.
D (Date)Numbers and a character to separate month, day, and year

(stored internally as 8 digits in YYYYMMDD format).
G (General

All OEM code page characters (stored internally as 10

digits or OLE) representing a .DBT block number).
N (Numeric)-.0123456789

L (Logical)? Y y N n T t F f (? when not initialized).

M (Memo)All OEM code page characters (stored internally as 10

digits representing a .DBT block number).
Binary, Memo, and OLE Fields And .DBT Files===========================================
Binary, memo, and OLE fields store data in .DBT files consisting of blocks numberedsequentially (0, 1, 2, and so on). SET BLOCKSIZE determines the size of each block.
The first block in the .DBT file, block 0, is the .DBT file header.
Each binary, memo, or OLE field of each record in the .DBF file contains the number ofthe block (in OEM code page values) where the field's data actually begins. If a fieldcontains no data, the .DBF file contains blanks (20h) rather than a number.
When data is changed in a field, the block numbers may also change and the number inthe .DBF may be changed to reflect the new location.
Copyright © 2018 Open Geospatial Consortium

22

Unlike dBASE III PLUS, if you delete text in a memo field (or binary and OLE fields),
dBASE for Windows (unlike dBASE IV) may reuse the space from the deleted text when
you input new text. dBASE III PLUS always appends new text to the end of the .DBT
file. In dBASE III PLUS, the .DBT file size grows whenever new text is added, even if
other text in the file is deleted.
This information is from the dBASE for Windows Language Reference manual,
Appendix C

Copyright © 2018 Open Geospatial Consortium

23