why has one of the attribute names been changed by MATLAB when using the shaperead function to read a point shp file?

I have a point shp file 'ULS170527All.shp' with eleven attributes. The attributes are shown as follows in ArcGIS:
Then, I used the following expression to read it:
Tree = shaperead('ULS170527All.shp');
The following image shows the field names and data of the 'Tree' variable:
Is this a bug of MATLAB?
Did anyone have the similar problem?

6 Commenti

It is a only a name of variable right? Not the data.
Yes, just the attribute 'Height' has been read as 'Height1'. No problem for other attribute names and the data. I checked the shp file carefully and tried to read it several times, but this problem happened every time. If necessary, I can upload the shp file for you.
shaperead. I am sorry for the mistake in the expression. I have revised it.

Accedi per commentare.

 Risposta accettata

The code for shaperead contains,

        reservedNames = {'Geometry', 'X', 'Y', 'Lat', 'Lon', ...
                 'BoundingBox', 'Height', 'INDEX'};

I have not yet been able to figure out why Height and INDEX are reserved, but we can see from the code that it is deliberate.

1 Commento

Thank you very much for your answer. So we cannot use any of names listed in the code, right? I just found that the shapeinfo function can read all of attribute names correctly, so I can fix it using the result of shapeinfo.

Accedi per commentare.

Più risposte (0)

Prodotti

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by