To find the coordinate reference system, you can use crs() on the layer as shown in the following code:
crs = scf.crs()
The previous code assigns the coordinate reference system to the variable crs. From here, you can inspect it by getting the descriptions shown in the following code:
crs.description()
The previous code will return the output as follows:
'WGS 84'
For a well-known text (WKT) representation of the coordinate reference system, you can use the toWkt() method:
crs.toWkt()
This will return the results as follows:
'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'
You can get the bounding box of the layer by using the extent() method shown as follows:
extent = scf.extent()
You can then get a string of the extent using toString(), get the WKT using asWktPolygon(), or you can get each coordinate individually using xMinimum(), xMaximum(), yMinimum(), and yMaximum(). The methods and their output are shown as follows:
extent.toString()
u'-106.6649165999999980,35.0744279999999975 : -106.6457526013259951,35.0916344666666973'
extent.asWktPolygon()
'POLYGON((-106.66491659999999797 35.0744279999999975, -106.6457526013259951 35.0744279999999975, -106.6457526013259951 35.09163446666669728, -106.66491659999999797 35.09163446666669728, -106.66491659999999797 35.0744279999999975))'
extent.xMinimum()
-106.6649166
extent.xMaximum()
-106.645752601326
extent.yMinimum()
35.074428
extent.yMaximum()
35.0916344666667
To see the methods for the extent object, use dir(extent).
You can get the number of features in the layer by using pendingFeatureCount(). The following code returns the feature count for the SeeClickFix layer:
scf.pendingFeatureCount()
The result is a long datatype and in this case, equals 126.