Skip to main content
Improved formatting
Source Link
Hornbydd
  • 44.6k
  • 5
  • 42
  • 84

You can use this to find the pixel:

def Pixel2world( geoMatrix, x, y ): xOrigin = geoMatrix[0] yOrigin = geoMatrix[3] pixelWidth = geoMatrix[1] pixelHeight = geoMatrix[5] coorX = ( xOrigin + ( x * pixelWidth )) coorY = ( yOrigin + ( y * pixelHeight )) return coorX, coorY

def Pixel2world( geoMatrix, x, y ):
    xOrigin   = geoMatrix[0]
    yOrigin   = geoMatrix[3]
    pixelWidth  = geoMatrix[1]
    pixelHeight = geoMatrix[5]
    coorX = ( xOrigin + ( x * pixelWidth ))
    coorY = ( yOrigin + ( y * pixelHeight ))
    return coorX, coorY

You can use this to find the pixel:

def Pixel2world( geoMatrix, x, y ): xOrigin = geoMatrix[0] yOrigin = geoMatrix[3] pixelWidth = geoMatrix[1] pixelHeight = geoMatrix[5] coorX = ( xOrigin + ( x * pixelWidth )) coorY = ( yOrigin + ( y * pixelHeight )) return coorX, coorY

You can use this to find the pixel:

def Pixel2world( geoMatrix, x, y ):
    xOrigin   = geoMatrix[0]
    yOrigin   = geoMatrix[3]
    pixelWidth  = geoMatrix[1]
    pixelHeight = geoMatrix[5]
    coorX = ( xOrigin + ( x * pixelWidth ))
    coorY = ( yOrigin + ( y * pixelHeight ))
    return coorX, coorY
Source Link

You can use this to find the pixel:

def Pixel2world( geoMatrix, x, y ): xOrigin = geoMatrix[0] yOrigin = geoMatrix[3] pixelWidth = geoMatrix[1] pixelHeight = geoMatrix[5] coorX = ( xOrigin + ( x * pixelWidth )) coorY = ( yOrigin + ( y * pixelHeight )) return coorX, coorY