parameters: (srcImage)
return_statement: return raster_extend
docstring: docstring for getRasterExtent
docstring_summary: docstring for getRasterExtent
docstring_tokens: docstring for getRasterExtent
function: def getRasterExtent(srcImage):
      """docstring for getRasterExtent"""
      geoTrans = srcImage.GetGeoTransform()
      ulX = geoTrans[0]
      ulY = geoTrans[3]
      xDist = geoTrans[1]
      yDist = geoTrans[5]
      rtnX = geoTrans[2]
      rtnY = geoTrans[4]
  
      cols = srcImage.RasterXSize
      rows = srcImage.RasterYSize
  
      lrX = ulX + xDist * cols
      lrY = ulY + yDist * rows
  
      # Create ring
      ring = ogr.Geometry(ogr.wkbLinearRing)
      ring.AddPoint(lrX, lrY)
      ring.AddPoint(lrX, ulY)
      ring.AddPoint(ulX, ulY)
      ring.AddPoint(ulX, lrY)
      ring.AddPoint(lrX, lrY)
  
      # Create polygon
      poly = ogr.Geometry(ogr.wkbPolygon)
      poly.AddGeometry(ring)
  
      raster_extend = RasterExtent()
      raster_extend.geoTrans = geoTrans
      raster_extend.poly = poly
      raster_extend.ulX = ulX
      raster_extend.ulY = ulY
      raster_extend.lrX = lrX
      raster_extend.lrY = lrY
      #return geoTrans, poly, ulX, ulY, lrX, lrY
      return raster_extend
function_tokens: def getRasterExtent ( srcImage ) : geoTrans = srcImage . GetGeoTransform ( ) ulX = geoTrans [ 0 ] ulY = geoTrans [ 3 ] xDist = geoTrans [ 1 ] yDist = geoTrans [ 5 ] rtnX = geoTrans [ 2 ] rtnY = geoTrans [ 4 ] cols = srcImage . RasterXSize rows = srcImage . RasterYSize lrX = ulX + xDist * cols lrY = ulY + yDist * rows # Create ring ring = ogr . Geometry ( ogr . wkbLinearRing ) ring . AddPoint ( lrX , lrY ) ring . AddPoint ( lrX , ulY ) ring . AddPoint ( ulX , ulY ) ring . AddPoint ( ulX , lrY ) ring . AddPoint ( lrX , lrY ) # Create polygon poly = ogr . Geometry ( ogr . wkbPolygon ) poly . AddGeometry ( ring ) raster_extend = RasterExtent ( ) raster_extend . geoTrans = geoTrans raster_extend . poly = poly raster_extend . ulX = ulX raster_extend . ulY = ulY raster_extend . lrX = lrX raster_extend . lrY = lrY #return geoTrans, poly, ulX, ulY, lrX, lrY return raster_extend