-
Notifications
You must be signed in to change notification settings - Fork 1
Dbf
Dbf files are dBase files, used as part of the ESRI shapefile or as separate data file.
In reading and writing dbf files, the value types of the values units of the attributes should match with the data types of the attributes in the dbf file.
The following value types can be used for dbf data:
- (u)int8/16/32/64 for byte, integer and long integer
- float32/64 for single/double
- bool for boolean
- string for string
Other data/value types can not be read from (e.g. date) or written to (e.g. all Point Group types) dbf storages.
The GeoDMS supports two ways of reading dbf files:
- gdal.vect: we advice to use the gdal.vect StorageManager to read dbf files as it supports segmented data, see the next subparagraph.
- dbf StorageManager
The following example shows how to read a .dbf file with gdal.vect.
unit<uint32> table: StorageName = "%projDir%/data/DBF.dbf" , StorageType = "gdal.vect" , StorageReadOnly = "True" { attribute<int32> IntegerAtt; attribute<float32> FloatAtt; attribute<bool> BoolAtt; attribute<string> StringAtt; }
The following example shows how to read a .dbf file with the dbf storagemanager.
unit<uint32> table: StorageName = "%projDir%/data/DBF.dbf" , StorageReadOnly = "True" { attribute<int32> IntegerAtt; attribute<float32> FloatAtt; attribute<bool> BoolAtt; attribute<string> StringAtt; }
The GeoDMS supports two ways of writing dbf files:
- gdalwrite.vect: we advice to use the gdalwrite.vect StorageManager to write dbf files see the next subparagraph.
- dbf StorageManager
Be aware: the names of attributes written to a .dbf file may not exceed 10 characters, as the .dbf file does not support longer fields.
We advise to write attributes to dbf file that do not have null values, as strange results might occur. Use the MakeDefined function to convert null values to a specific missing data value for your dbf file.
The following example shows how to write a .dbf file with the gdalwrite.vect.
unit <uint32> pc6_export := src/pc6 , StorageName = "%localDataProjDir%/export_table.dbf" , StorageType = "gdalwrite.vect" , StorageReadOnly = "false" { attribute<uint32> IntegerAtt := const(1, .); attribute<float32> FloatAtt := const(1f, .); attribute<string> StringAtt := const('A', .); attribute<bool> BoolAtt := const(true, .); }
The following example shows how to write a .dbf file with the dbf storagemanager.
unit <uint32> pc6_export := src/pc6 , StorageName = "%localDataProjDir%/export_table.dbf" , StorageReadOnly = "false" { attribute<uint32> IntegerAtt := const(1, .); attribute<float32> FloatAtt := const(1f, .); attribute<string> StringAtt := const('A', .); attribute<bool> BoolAtt := const(true, .); }
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.