Order of polygons in the shapefile

Hello,
I noticed something interesting when creating a new shapefile of SHP_POLYGON type:
I create three closed polygons shapes, and insert them: Shapefile.EditInsertShape. Save the shapefile.

When opening the shapefile, and reading the shapes, their order is actually reversed to that in which they were created.
What is the reason for this?

Hello @george

EditAddShape will always append to the end, whereas EditInsertShape attempts to insert at the ShapeIndex you provide as a reference parameter. If you specified 0 (zero) for each, then each would be inserted at the beginning, effectively reversing the order.

1 Like

Hi @jerryfaust,

Thank you once again for the useful help! I was not aware of this.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.