ESRI Shapefile

From ObjectVision

Jump to: navigation, search

Contents

File Format

ESRI Shapefile contain vector data and related attribute data.

The ESRI Shapefile format always consists of (at least) three accompanying files, with the extensions:

  • shp: containing the geographical information (feature attribute).
  • shx. containing a spatial index.
  • 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.

Often also a file with the extension prj is als available, container the projection information. This file is at the moment not (yet) used by the GeoDMS (projection information is configured explicitly in the GeoDMS)

The GeoDMS supports at the moment (multi)point, arc and polygon types (Shape types: 1,3, 5 and 8).

StorageManagers

Shapefiles can be read with the gdal.vect StorageManager and read and writen to with the ShapeFile StorageManager.

Gdal.vect StorageManager

It is advised to use the gdal.vect StorageManager for reading Shapefiles as (in comparison to the ShapeFile StorageManager) as it is :

  • a litte faster
  • more generic
  • shorter to configure
  • supports segmented data.

Examples (for point, polygon and arc data)

unit<uint32> location
:   StorageName = "%projDir%/vectordata/points.shp"
,   StorageType  = "gdal.vect"
{
   attribute<point_rd> geometry;
   attribute<string>    name;
}
 
unit<uint32> region
:  StorageName = "%projDir%/vectordata/region.shp"
,  StorageType  = "gdal.vect"
{
   attribute<point_rd> geometry (polygon); 
   attribute<string>     name;
}

unit<uint32> road
:  StorageName = "%projDir%/vectordata/road.shp"
,  StorageType  = "gdal.vect"
{
   attribute<point_rd> geometry (arc);
   attribute<string>     name;
}

The shp file is configured as StorageName for the domain unit.

The dbf and shx files are not configured, but need to be available in the same folder as the shp file. For the domain unit, the DialogType property is configured to Map and The DialogData property to the feature attribute (geometry) to inform the GeoDMS GUI which features are used to visualise attributes of this domain unit in a map view.


The gdal.vect StorageManager supports segmented data. If the file has more than 50.000 records, the StorageManager results in a tiled domain with segments of maximum 50.000 entries.

If your dbf file already contains an attribute named geometry, use another attribute name for the data from the .shp file, for instance geom.

Shapefile StorageManager

Shapefiles can also be read from or write to with the GeoDMS specific Shapefile StorageManager. This StorageManager is only advised for writing data (reading is supported for backward compatibility).

Examples (for point and polygon)

unit<uint32> location:StorageName = "%projDir%/data/location.dbf"
{
   attribute<point_rd> location : StorageName = "%projDir%/data/location.shp";
   attribute<string>     name;
}

unit<uint32> region: StorageName = "%projDir%/data/region.dbf"
{
   attribute<point_rd> region (polygon):StorageName = "%projDir%/data/region.shp";
   attribute<string>     name;
}

With this StorageManager the dbf file is configured as StorageName of the domain unit. The number of elements is read from this file. As with the gdal.vect StorageManager, the DialogType property is configured to Map and The DialogData property to the feature attribute.

The feature attribute with the coordinates is configured as subitem of the domain unit. This attribute is read from or written to the explicitly configured .shp file. The shx file is not explicitly configured, but the file needs to be available in the same folder as the shp file.

Personal tools