Thursday 4 April 2019

Cropping GeoTIFF with GeoTools using integer indexes


I know how to crop a raster by providing coordinates in a CRS:


Envelope envelope2D = new ReferencedEnvelope(envelopeStartX, envelopeEndX, envelopeStartY, envelopeEndY, obj.targetCRS);

GridCoverage2D tile = (GridCoverage2D) ops.crop(obj.coverage, envelope2D);

How do I crop by providing raster indices (ranging from 0..height, 0..width) instead of coordinates in a CRS?





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...