.dbf: containing tabular information describing the shapes. If a logical entity (like countries) consists of multiple shapes, the relation between the shapes and the logical entity is usually stored in this .dbf file.
Optionally a .prj file is als available, containing the projection information. This file is at the moment not (yet) used by the GeoDMS (projection information is configured explicitly in the GeoDMS).
how to configure reading point, polygon and arc data with gdal.vect: ``` unit location : StorageName = "%projDir%/vectordata/points.shp" , StorageType = "gdal.vect" { attribute geometry; attribute name; } unit region : StorageName = "%projDir%/vectordata/region.shp" , StorageType = "gdal.vect" { attribute geometry (polygon); attribute name; } unit road : StorageName = "%projDir%/vectordata/road.shp" , StorageType = "gdal.vect" { attribute geometry (arc); attribute name; } ``` The .shp file is configured as [storagename](storagename.html) for the [domain-unit](domain-unit.html). The .dbf and .shx files are not explicitly configured, but need to be available in the same folder as the .shp file. The difference between the configuration of points, arcs and polygons is the configured [composition type](composition.html). If your dbf file already contains an attribute named geometry, use another attribute name for the data from the .shp file, for instance geom. </details> #### options [gdal-options](gdal-options.html) can be configured for reading different ESRI Shapefiles. See: <https://gdal.org/drivers/vector/shapefile.html#open-options> for a full list of all open options. ### shapefile/dbf StorageManager Shapefiles can also still be read with the GeoDMS specific shapefile/dbf StorageManagers (mainly for backward compatibility). #### examples how to configure reading point, polygon and arc data with shapefile/dbf StorageManager: ``` unit location: StorageName = "%projDir%/data/location.dbf" { attribute geometry: StorageName = "%projDir%/data/location.shp"; attribute name; } unit region: StorageName = "%projDir%/data/region.dbf" { attribute region (polygon): StorageName = "%projDir%/data/region.shp"; attribute name; } unit road: StorageName = "%projDir%/data/road.dbf" { attribute geometry (arc): StorageName = "%projDir%/data/road.shp"; attribute name; } ``` The dbf file is configured as StorageName of the domain unit. The number of elements is read from this file. The feature attribute with the coordinates is configured as subitem of the domain unit. This attribute is read from the explicitly configured .shp file. The .shx file is not configured, the file needs to be available in the same folder as the .shp file. The difference between the configuration of points, arcs and polygons is the configured [composition type](composition.html). </details> ## Write The GeoDMS supports two ways of writing ESRI Shapefiles: - gdalwrite.vect: for most shape files, we advice to use [gdalwrite.vect](gdalwrite.vect.html) (see next subparagraph) to write csv files as it: - is faster - is more generic - is shorter to configure - supports open options - shapefile/dbf StorageManager ### gdalwrite.vect #### examples how to configure writing point, polygon and arc data with gdal.vect: ``` unit location := SourceData/location , StorageName = "%LocalalDataProjDir%/export/points.shp" , StorageType = "gdalwrite.vect" { attribute geometry := SourceData/location/geometry; attribute name := SourceData/location/name; } unit region := SourceData/region : StorageName = "%projDir%/vectordata/region.shp" , StorageType = "gdalwrite.vect" { attribute geometry (polygon) := SourceData/region/geometry; attribute name := SourceData/region/name; } unit road : StorageName = "%projDir%/vectordata/road.shp" , StorageType = "gdalwrite.vect" { attribute geometry (arc) := SourceData/road/geometry; attribute name := SourceData/road/name; } ``` The [feature-attribute](feature-attribute.html) is written to the .shp file (in the examples _geometry_). All other attributes (with supported .[dbf](dbf.html) [value types](value-type.html)) are written to a filename with the same name and a .dbf extension. This applies to both the direct as the indirect [subitems](subitem.html). If multiple subitems with a PoinGroup [value-type](value-type.html) occur, an error is generated. Set the [disablestorage](disablestorage.html) [property](property.html) to True for the attributes you do not want to be written to the.dbf file. A index file is also written together with the .shp file, with the same name but with the .shx extension. The difference between the configuration of points, arcs and polygons is the configured [composition type](composition.html). </details> #### options [gdal-options](gdal-options.html) can be configured for writing different ESRI Shapefiles. See: <https://gdal.org/drivers/vector/shapefile.html#layer-creation-options> for a full list of all creation options. example on how to configure a write option: ``` container with_index { unit optionSet := range(uint32, 0, 1); attribute GDAL_LayerCreationOptions (optionSet) : ["SPATIAL_INDEX=YES"]; unit location := SourceData/location , StorageName = "%LocalalDataProjDir%/export/points.shp" , StorageType = "gdalwrite.vect" { attribute geometry := SourceData/location/geometry; attribute name := SourceData/location/name; } } ``` This example shows how to export an ESRI Shapefile with a spatial index file (.qix) extensie. </details> ### shapefile/dbf StorageManager Shapefiles can also still be written with the GeoDMS specific shapefile/dbf StorageManagers (mainly for backward compatibility). #### examples how to configure writing point, polygon and arc data with shapefile/dbf StorageManager: The example shows how to export an ESRI Shapefile with a spatial index file (.qix) extensie. Furthermore the resulting .dbf file is resized to an optimal size, this we advice especially for all ESRI Shapefiles to keep the size of the .dbf file limited. ``` container export { unit<uint32> optionSet := range(uint32, 0, 2); attribute GDAL_LayerCreationOptions (optionSet) : ["SPATIAL_INDEX=YES","RESIZE=YES"]; unit location := SourceData/location, StorageName = "%projDir%/data/location.dbf" { attribute geometry := SourceData/Location/geometry, StorageName = "%projDir%/data/location.shp"; attribute name := SourceData/Location/name; } unit region := SourceData/region, StorageName = "%projDir%/data/region.dbf" { attribute region (polygon) := SourceData/region/geometry, StorageName = "%projDir%/data/region.shp"; attribute name := SourceData/region/name; } unit road := SourceData/road, StorageName = "%projDir%/data/road.dbf" { attribute geometry (arc) := SourceData/road/geometry, StorageName = "%projDir%/data/road.shp"; attribute name := SourceData/road/name; } } ``` The dbf file is configured as StorageName of the domain unit. The attributes (with supported .[dbf](dbf.html) [value types](value-type.html)) are written to the .dbf file with this filename. The feature attribute is written to the explicitly configured .shp file. An index file is also written together with the .shp file, with the same name but with the .shx extension. The difference between the configuration of points, arcs and polygons is the configured [composition type](composition.html). </details>