easyidp.geotiff.pixel2geo#

easyidp.geotiff.pixel2geo(points_hv, header)#

Convert geotiff pixel coordinate (horizontal, vertical) to point cloud xyz coordinate (x, y, z)

Parameters:
  • points_hv (numpy nx2 array) – [horizontal, vertical] points

  • header (dict) – the geotiff head dictionary from get_header()

Return type:

The ndarray pixel position of these points (horizontal, vertical)

Example

>>> header = {'width': 19436, 'height': 31255, 'dim':4,
              'scale': [0.001, 0.001], 'nodata': None,
              'tie_point': [484576.70205, 3862285.5109300003],
              'crs': pyproj.CRS.from_string("WGS 84 / UTM zone 53N")}
>>> pixel_coord = np.asarray([
        [16972, 26086],
        [16708, 25585],
        [16946, 25445],
        [17228, 25956],
        [16972, 26086]])
>>> idp.geotiff.pixel2geo(pix_coord, header)
array([[16972.69654   , 26086.79569047],
       [16708.59742997, 25585.10598028],
       [16946.36805996, 25445.77883044],
       [17228.72418998, 25956.37087012],
       [16972.69654   , 26086.79569047]])