Skip to content

Instantly share code, notes, and snippets.

@mikigom
Last active April 26, 2019 12:29
Show Gist options
  • Save mikigom/4bb26a6e1f2ed27277d8b4c9937bc098 to your computer and use it in GitHub Desktop.
Save mikigom/4bb26a6e1f2ed27277d8b4c9937bc098 to your computer and use it in GitHub Desktop.
import ogr
import osr
high_ref = osr.SpatialReference()
low_ref = osr.SpatialReference()
coord_topleft = pixel2coord(high_res_raster, (col_high_res, row_high_res))
high_ref.ImportFromWkt(high_res_raster.GetProjection())
low_ref.ImportFromWkt(low_res_raster.GetProjection())
coord_trans = osr.CoordinateTransformation(high_ref, low_ref)
coord_topleft = ogr.CreateGeometryFromWkt("POINT (%s %s)" % (coord_topleft[0], coord_topleft[1]))
coord_topleft.Transform(coord_trans)
coord_topleft = coord_topleft.GetEnvelope()
coord_topleft = (coord_topleft[0], coord_topleft[2])
pixel_topleft_low_res = coord2pixel(low_res_raster, coord_topleft)
@FuZer
Copy link

FuZer commented Apr 26, 2019

힘 스텟 5 오름

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment