Layer properties

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"]]' ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.