__getitem__(target)
Returns the value of the given string attribute node, None
if the node doesn’t exist. Can also take a tuple as a parameter, (target, child), where child is the index of the attribute in the WKT. For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]' ) >>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326 >>> print (srs[ 'GEOGCS' ]) WGS 84 >>> print (srs[ 'DATUM' ]) WGS_1984 >>> print (srs[ 'AUTHORITY' ]) EPSG >>> print (srs[ 'AUTHORITY' , 1 ]) # The authority value 4326 >>> print (srs[ 'TOWGS84' , 4 ]) # the fourth value in this wkt 0 >>> print (srs[ 'UNIT|AUTHORITY' ]) # For the units authority, have to use the pipe symbol. EPSG >>> print (srs[ 'UNIT|AUTHORITY' , 1 ]) # The authority value for the units 9122 |
Please login to continue.