Math, asked by KJasleen9513, 1 year ago

what is the polygon order

Answers

Answered by sonabrainly
0

Two days ago I asked a question about the internal storing order for the vertices of a polygon in ESRI shapefiles. That question was answered (Are polygons stored clockwise or counterclockwise in a shapefile?) and it was also answered in an old post (Polygon creation (Clockwise rotation or not))


But now my question is more general, and I don't know if it has an unique answer. Is the clockwise order only for ESRI shapefiles or for general GIS formats? And what about the internal representation for a GIS software? For example, if I use QGIS and I read a *.shp containing polygons I suppose the internal representation of the outer bound is clockwise as in the original shapefile, but what about for all the file formats supported by QGIS? And for ArcGIS? And in the case there exists a file format with polygons stored in counterclockwise, if these files are loaded in QGIS, ArcGIS, etc., is the orientation changed internally, so if I read the data using PyQGIS, for example, the polygons are clockwise ordered?


My purpose is to write a plugin for QGIS, but the source of data can be ESRI shapefiles or other formats. As I need to check the angles between consecutive sides of polygons using their azimuths I need to known if the order is clockwise. One solution is computing the area of each polygon and, if I remember correctly, if it is positive the order is clockwise and if negative the order is counterclockwise.


Area computation is not an intensive task, so it will not slow my plugin so much. But in the special case of QGIS, anybody knows if it stores the polygons clockwise or counterclockwise, regardless the order in the original source? By now I'm working with ESRI shapefiles and the coordinates in layer.getFeatures().geometry().asPolygon() are stored in clockwise for the outer border and counterclockwise for the holes, i. e. as in the original *.shp.



Answered by XItzBabeX
3

Step-by-step explanation:

What are Polygons?

A Polygon is a closed figure made up of line segments (not curves) in a two-dimensional plane. Polygon is the combination of two words, i.e. poly (means many) and gon (means sides).

A minimum of three line segments is required to connect end to end, to make a closed figure. Thus a polygon with a minimum of three sides is known as Triangle and it is also called 3-gon. An n-sided polygon is called n-gon.

Similar questions