This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Information about shapefile


info = shapeinfo(filename)


info = shapeinfo(filename) returns a structure, info, whose fields contain information about the contents of a shapefile. filename can be the base name or the full name of any one of the component files. shapeinfo reads all three files as long as they exist in the same folder and the unit of length or angle is not specified. If the main file (with extension .SHP) is missing, shapeinfo returns an error. If either of the other files is missing, shapeinfo returns a warning.

Output Arguments

The info structure contains the following fields:


Char array containing the names of the files that were read


Character vector containing the shape type


Numerical array of size 2-by-N that specifies the minimum (row 1) and maximum (row 2) values for each dimension of the spatial data in the shapefile


Structure array of size 1-by-numAttributes that describes the attributes of the data


The number of spatial features in the shapefile

The Attributes structure contains these fields:

NameCharacter vector containing the attribute name as given in the xBASE table
TypeCharacter vector specifying the MATLAB® class of the attribute data returned by shaperead. The following attribute (xBASE) types are supported: Numeric, Floating, Character, and Date.


shapeinfo cannot tell you which coordinate system the data in a shapefile uses. Coordinates can be either planar (x, y) or geographic (lat, lon) and have a variety of units. This information can be critical to the proper display of shapefile vector data. For more information on this topic, see Mapstructs and Geostructs.

Introduced before R2006a

Was this topic helpful?