Changeset 5296


Ignore:
Timestamp:
Sep 12, 2003 9:57:06 PM (13 years ago)
Author:
warmerda
Message:

fixed up NULL support for spatial references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pymod/ogr.py

    r5190 r5296  
    2929#
    3030# $Log$
     31# Revision 1.15  2003/09/13 04:57:06  warmerda
     32# fixed up NULL support for spatial references
     33#
    3134# Revision 1.14  2003/08/27 15:40:06  warmerda
    3235# added OGRSetGenerate_DB2_V72_BYTE_ORDER()
     
    280283                    options = [] ):
    281284        if srs is None:
    282             srs = 'NULL'
     285            srs_o = 'NULL'
     286        else:
     287            srs_o = srs._o
    283288        md_c = _gdal.ListToStringList( options )
    284         obj = _gdal.OGR_DS_CreateLayer( self._o, name, srs, geom_type, md_c)
     289        obj = _gdal.OGR_DS_CreateLayer( self._o, name, srs_o, geom_type, md_c)
    285290        _gdal.CSLDestroy(md_c)
    286291        if obj is None and obj != 'NULL':
     
    404409    def RollbackTransaction( self ):
    405410        return _gdal.OGR_L_RollbackTransaction( self._o )
     411
     412    def GetSpatialRef( self ):
     413        srs_o = _gdal.OGR_L_GetSpatialRef( self._o )
     414        if srs_o is not None and srs_o != 'NULL':
     415            return osr.SpatialReference( srs_o )
     416        else:
     417            return None
    406418
    407419#############################################################################
     
    680692    def GetSpatialReference( self ):
    681693        srs_o = _gdal.OGR_G_GetSpatialReference( self._o )
    682         if srs_o is not None:
     694        if srs_o is not None and srs_o != 'NULL':
    683695            return osr.SpatialReference( srs_o )
    684696        else:
Note: See TracChangeset for help on using the changeset viewer.