Hot answers tagged scripting
You need to open it as a QgsVectorLayer layer = QgsVectorLayer('/path/to/shapefile_folder/test.shp', 'test', 'ogr') QgsVectorLayer objects have a method called geometryType. If you call that method for your newly created layer : >>> print layer.geometryType() 2 Where 0 is points, 1 is lines and 2 is polygons
I guess the "proper" way is to use QGIS' API which I'd hope would expose that. But I don't know how to do that. An alternative is to look without the shapefile itself. The basics of the specification are on Wikipedia: https://en.wikipedia.org/wiki/Shapefile#Shapefile_shape_format_.28.shp.29 What you want is: bytes 32–35 of the main header which dictates ...
It is not included in the ArcGIS install, but adding the iPython Notebook to your workflow sounds like exactly what you're looking for.
You may want to add your vote to the ArcGIS Idea to have a Record macro option in ArcMap: I think a record macro option should increase a lot of people's workspeed with ArcMap, without needing highend programming skills, similar as in MS Excel.
Only top voted, non community-wiki answers of a minimum length are eligible