Opened 17 years ago

Last modified 13 years ago

#480 assigned enhancement

clip based on extent of other dataset(s)

Reported by: maphew@… Owned by: timlinux
Priority: minor: annoyance Milestone: Version 2.0.0
Component: Python plugins and bindings Version: Trunk
Keywords: clip, tiles Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

A task I frequently need to do, and judging from the increasing frequency of messages of a similar vein on the gdal and fwtools mailing lists so do many others, is cut up a dataset based on the extent of another. More often raster than vector, but vector too. A similar oft-repeated question is how to take a humungous image and chop it into smaller more manageable tiles. Both of these I think could be handled by the same mechanism.

I'm proposing this for qgis rather than gdal as I think this is better suited to an interactivity (select polys x,y,z, then clip) more often than not. Of course exporting to script is desired too! In my head it looks like this:

  • query extent of Object A, where A can be either a whole dataset, a sub-selection thereof (e.g. a polygon), or a super-selection (all of these layers together)
  • clip Object B
  • if a A is multi-part (many polygons, or perhaps a raster catalog) then create many tiles.

It might look something like: clip [options] [dest] [source]

source = any raster or vector, or sub/super selection thereof (which is why source is at the end of the list)
dest = single file (clipped.tif) or directory (d:\tiles\)

Options:

--padding N% or Npx or Nmap-units. Expands spatial extent by specified amount, defaults to 10%. Negative number to shrink extent. None or 0 (zero) mean exact match.

--multi [yes, no] should whole data extent be used or are we making tiles? Defaults to no.

--name-on [attribute] base output filename(s) on specified attribute's value. Probably only makes sense in a tiling operation.

--create-index also create a gdaltindex style index of the output.

--pass-thru "..." options to hand off to the backend, e.g. "-co compress=lzw", "--outsize 50% 50%" etc. not sure if this one is a good idea

Change History (4)

comment:1 by timlinux, 16 years ago

Awaiting user input: unset
Milestone: Version 1.0.0Version 2.0.0
Owner: changed from nobody to timlinux
Priority: major: does not work as expectedminor: annoyance or enhancement
Status: newassigned

Changed to minor since this is not functionality that we currently have and is broken, but rather a feature request. I'm also changing to 2.0.0 milestone since we wont have time to do it pre 1.0.0 release. Nice idea though and I am sure we will implement it in the future.

comment:2 by pcav, 15 years ago

Seems a good task for a python plugin.

comment:3 by pcav, 15 years ago

Component: C++ PluginsPython plugins and bindings
Summary: clip based on extend of other dataset(s)clip based on extent of other dataset(s)

comment:4 by billywill, 13 years ago

This ticket is same as #3066 GdalTools: clipping based on a shapefile mask - since the effort of TeamQGIS - I now say "works for me" in 1.7

as far as raster is concerned, but I have not used the vector / vector clipping tools.

So close?

Note: See TracTickets for help on using tickets.