Skip to content

Instantly share code, notes, and snippets.

@lakshmanok
Last active March 7, 2020 17:17
Show Gist options
  • Save lakshmanok/580a45f76b6191b5b7ecc97a55b1c411 to your computer and use it in GitHub Desktop.
Save lakshmanok/580a45f76b6191b5b7ecc97a55b1c411 to your computer and use it in GitHub Desktop.
def create_rectangle_geo(LATRES, LONRES, ORIGIN_LAT, ORIGIN_LON, rowno, startcol, linedata):
# find a rectangle of pixels with the same value, and represent that pixel instead
endcol = startcol
while (endcol < len(linedata)) and (linedata[endcol] == linedata[startcol]):
endcol = endcol + 1
return create_geo(LATRES, LONRES, ORIGIN_LAT, ORIGIN_LON, rowno, startcol, endcol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment