Re: [gdal-dev] clip raster to one cell at coordinates

2023-01-27 Thread Rahkonen Jukka
rinfo from other code. -Jukka Rahkonen- Lähettäjä: gdal-dev Puolesta Alan Snow Lähetetty: perjantai 27. tammikuuta 2023 15.19 Vastaanottaja: karsten Kopio: gdal dev Aihe: Re: [gdal-dev] clip raster to one cell at coordinates This example may be helpful: https://gis.stackexchange.com/questi

Re: [gdal-dev] clip raster to one cell at coordinates

2023-01-27 Thread Alan Snow
This example may be helpful: https://gis.stackexchange.com/questions/358036/extracting-data-from-a-raster/358058 On Fri, Jan 27, 2023, 12:00 AM karsten wrote: > Hi All, > > in an application I have a user click on a map and I need to > programmatically clip a raster layer > to the one raster

Re: [gdal-dev] clip raster to one cell at coordinates

2023-01-27 Thread Michael Sumner
Hi Karsten, An option is to run gdallocationinfo, get the col (P) and row (L) value and then feed that into gdal_translate -srcwin P L col -outsize 1 1 in.tif out.tif ##I think that's right You otherwise have to do the "grid logic", which (while easy ...) I'd rather like to see exposed

[gdal-dev] clip raster to one cell at coordinates

2023-01-26 Thread karsten
Hi All, in an application I have a user click on a map and I need to programmatically clip a raster layer to the one raster cell for those coordinates at the click location. I was looking e.g. at https://gdal.org/programs/gdal_rasterize.html to run as a command line tool, but so far could not