Score:0

What is the quickest way to convert a GeoTIFF file to PNG and crop the output?

gb flag

I need to automate for a project converting tons of GeoTIFF files to PNG and being able to resize them in 4 equally sized squares.

What would be a program I could use for this?

cn flag
anything relates to convering images: check the `convert` command from `imagemagick`.
kz-n avatar
gb flag
convert doesnt seem to work with GeoTIFF
cn flag
then how about https://gis.stackexchange.com/a/41597
Score:0
jp flag

How about QGIS for Ubuntu? If you have access to ArcGIS environment on another machine the same steps apply.

(I am assuming by "resize into 4 equally sized squares" you want to split into quadrants)

  1. Import the Geotiff
  2. Clip as necessary.
  3. Generate a 2x2 fishnet (https://gis.stackexchange.com/questions/123444/creating-fishnet-grid-shapefile-in-qgis)
  4. Extract by the fishnet polygons using the Extract by Mask Layer tool (May need to break up the fishnet polygons first)
  5. Save out the individual raster subsets as desired

NOTE: you may need to clip your raster such that it divides evenly along raster pixel boundaries for the fishnet such that you don't get sub-pixel effects on the edges of your raster. (see Point #2)

As far as automation you can look into batch processing with QGIS.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.