Hi,
I know it seems simple but almost a whole day that I struggle to resolve it!
I have a Geotif file in UTM projection, 10m resolution:
Image general information:
Number of bands : 15
No data flags : Not found
Start index : [0,0]
Size : [1521,3541]
Origin : [694595,4.13662e+06]
Spacing : [10,-10] Estimated ground spacing (in meters): [9.97571,10.0183]
Image acquisition information:
Sensor :
Image identification number:
Image projection : PROJCS[“WGS 84 / UTM zone 29N”,
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0,
AUTHORITY[“EPSG”,“8901”]],
UNIT[“degree”,0.0174532925199433,
AUTHORITY[“EPSG”,“9122”]],
AUTHORITY[“EPSG”,“4326”]],
PROJECTION[“Transverse_Mercator”],
PARAMETER[“latitude_of_origin”,0],
PARAMETER[“central_meridian”,-9],
PARAMETER[“scale_factor”,0.9996],
PARAMETER[“false_easting”,500000],
PARAMETER[“false_northing”,0],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]],
AXIS[“Easting”,EAST],
AXIS[“Northing”,NORTH],
AUTHORITY[“EPSG”,“32629”]]
and a GeoPoint in lat/lon format :
POINT (-6.538311613999999 37.119295829)
I wanted to use ExtractROI application to get a patch from the image centred with my point and sized 64x64 pixels, but got really confused how to configure the application in Radius mode:
the center x,y should be considered physical, while radius should be in pixel? it sounds logical but not functional
ExtractROI = otbApplication.Registry.CreateApplication(“ExtractROI”)
ExtractROI.SetParameterString(“in”, “/workspace/ML/S2A_MSIL2A_20190122_R137_T29SPB.tif”)
ExtractROI.SetParameterString(“mode”,“radius”)
ExtractROI.SetParameterFloat(“mode.radius.r”, 32)
ExtractROI.SetParameterString(“mode.radius.unitr”, ‘pxl’)
ExtractROI.SetParameterFloat(“mode.radius.cx”,718707.136771) #converted to UTM
ExtractROI.SetParameterFloat(“mode.radius.cy”, 4110942.70878) #converted to UTM
ExtractROI.SetParameterString(“mode.radius.unitc”,‘phy’ )
ExtractROI.SetParameterString(“out”, “/workspace/data/ExtractROI.tif”)
ExtractROI.ExecuteAndWriteOutput()
Anyone ever got it worked in this manner?
I tried it in standard mode and all in ‘pixel’ units for arbitrary pixel positions (I do not understand how to identify in which pixel my point is located in order to locate properly 'startx,y , sizex,y)
Any help or suggestion is much appreciated.
Panteha