I am working with GDAL and modify ESRI shapefiles with it. I am searching a possibility how to find all distince values from a single column of an attribute table with GDAL (Python). In SQL it would be SELECT DISTINCT field FROM table. I found how to do that in ArcPy but i prefer to use open source software.
Furthermore, i was thinking about iterating through the column (which are different classes) and calculate their area. Anybody an idea?
for i in range(layer.GetFeatureCount()): feature = layer.GetFeature(i) #here somehow iterate/sort through "feature.GetField("classes")"