I'm working with polygon coordinates in QGIS using PyQGIS using ESRI shapefiles as input data.

Are the polygon vertices (I am referring only to the outer boundary in the case of polygons with holes) stored as clockwise or as counterclockwise in a shapefile or can be in mixed order?

Is the order always the same or can be different depending on the source of the data: digitizing, converting from other sources as *.csv files, etc.?


According to the Shapefile white paper (page 8), polygons are stored in a clockwise fashion except for interior polygon hole parts (i.e. 'donut holes'), which are stored in a counter-clockwise fashion. In fact, that's how polygon holes are recognized.

Not the answer you're looking for? Browse other questions tagged or ask your own question.