Ticket #6246: ogrinspect.py.diff

File ogrinspect.py.diff, 932 bytes (added by jos3ph, 17 years ago)
  • django/contrib/gis/utils/ogrinspect.py

     
    110110   
    111111    # Setting up the SRID parameter string.
    112112    if srid is None:
    113         srid = layer.srs.srid
    114         if srid is None:
     113        try:
     114            srid = layer.srs.srid
     115        except AttributeError:
    115116            srid_str = 'srid=-1'
    116         elif srid == 4326:
    117             # WGS84 is the default.
    118             srid_str = ''
    119117        else:
    120             srid_str = 'srid=%s' % srid
     118            if srid is None:
     119                srid_str = 'srid=-1'
     120            elif srid == 4326:
     121                # WGS84 is the default.
     122                srid_str = ''
     123            else:
     124                srid_str = 'srid=%s' % srid
    121125    else:
    122126        srid_str = 'srid=%s' % srid
    123127
Back to Top