def get_srid_info(srid, connection):
 from django.contrib.gis.gdal import SpatialReference
 global _srid_cache
 try:
  SpatialRefSys = connection.ops.spatial_ref_sys()
 except NotImplementedError:
  SpatialRefSys = None
 (alias, get_srs) = ((connection.alias, (lambda srid: SpatialRefSys.objects.using(connection.alias).get(srid=srid).srs)) if SpatialRefSys else (None, SpatialReference))
 if (srid not in _srid_cache[alias]):
  srs = get_srs(srid)
  (units, units_name) = srs.units
  sphere_name = srs['spheroid']
  spheroid = ('SPHEROID["%s",%s,%s]' % (sphere_name, srs.semi_major, srs.inverse_flattening))
  _srid_cache[alias][srid] = (units, units_name, spheroid)
 return _srid_cache[alias][srid]

def get_srid_info ( srid , connection ) : from django . contrib . gis . gdal import SpatialReference global _srid_cache try : SpatialRefSys = connection . ops . spatial_ref_sys ( ) except NotImplementedError : SpatialRefSys = None ( alias , get_srs ) = ( ( connection . alias , ( lambda srid : SpatialRefSys . objects . using ( connection . alias ) . get ( srid = srid ) . srs ) ) if SpatialRefSys else ( None , SpatialReference ) ) if ( srid not in _srid_cache [ alias ] ) : srs = get_srs ( srid ) ( units , units_name ) = srs . units sphere_name = srs [ 'spheroid' ] spheroid = ( 'SPHEROID["%s",%s,%s]' % ( sphere_name , srs . semi_major , srs . inverse_flattening ) ) _srid_cache [ alias ] [ srid ] = ( units , units_name , spheroid ) return _srid_cache [ alias ] [ srid ]
returns the units .