easyidp.geotiff.point_query#
- easyidp.geotiff.point_query(page, points_hv, header=None)#
Get the pixel value of given point(s)
- パラメータ:
page (TiffPage) -- TIFF image file directory (IFD) from which the crop must be extracted.
points_hv (tuple | list | nx2 ndarray) --
1. one point tuplee.g. (34.57, 45.62)2. one point liste.g. [34.57, 45.62]3. points listse.g. [[34.57, 45.62],[35.57, 46.62]]4. 2d numpy arraye.g. np.array([[34.57, 45.62],[35.57, 46.62]])header (dict, optional) --
the geotiff head dictionary from get_header()if specified, will view the points_hv as geo positione.g. [longtitude, latitude]if not specified, will view as pixel indexe.g. [1038, 567] -> pixel id
- 戻り値:
values -- the obtained pixel value (RGB or height)
- 戻り値の型:
ndarray
サンプル
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> header = idp.geotiff.get_header(test_data.pix4d.lotus_dsm) >>> point1 = (368023.004, 3955500.669) >>> idp.geotiff.point_query(page, point1, header) [97.45558] >>> point2 = [368023.004, 3955500.669] >>> idp.geotiff.point_query(page, point1, header) [97.45558] >>> points3 = [ ... [368022.581, 3955501.054], ... [368024.032, 3955500.465] ... ] >>> idp.geotiff.point_query(page, point3, header) array([97.624344, 97.59617]) >>> point4 = np.array([ ... [368022.581, 3955501.054], ... [368024.032, 3955500.465] ... ]) >>> idp.geotiff.point_query(page, point4, header) array([97.624344, 97.59617])