VRT builder UI: add advanced option (-te) to set the extents of the VRT.

Issue #387 resolved
Mitxel m created an issue

When running gdalbuildvrt you can use the -te option to set the extents of the VRT by giving xmin ymin xmax ymax values in georeferenced units . All pixels outside the extents area will be ignored, thus it is useful to set a rectangular extent and hide map borders (eg. for scanned maps). This way is quite faster than crop source files and generate new ones. In addition the source file is not touched and image quality and structure is preserved

Command line example:

gdalbuildvrt -a_srs EPSG:25830 -te 447000 4673223 481902 4692780 output_file.vrt input_file.ecw

( the -a_srs option included in the example is not mandatory, I have included it to give a context )

To do this it would be necessary to add a new line in the Advanced options section of the VRT builder UI with something like

Set extents (-te)

and a box to write the xmin ymin xmax ymax values

This text could be added to Tips

  • Use the (-te) option to set the extents of the VRT by giving xmin ymin xmax ymax values in georeferenced units. All pixels outside the extents area will be ignored. This is useful to hide map borders.

Another approach would be to add a generic User options line with a free box where the user could write options for gdalbuildvrt command line when needed. With this one there is no need to add more specefic options to the UI.

May be both lines (Set Extents and User options) could be considered

The Set Extents option could be also useful for qmaptool

Comments (3)

  1. kiozen

    For most users it will be hard to know the right numbers. And probably using QMapTool to crop the map is the better approach anyway.

    But I can add a line edit where you can pass user defined options of all kinds.

  2. Mitxel m reporter

    The user defined options line is quite enough and it works fine for me. Thanks a lot!


    I will add some lines to the tips and tricks section of the wiki on how to hide map margins with this option

  3. Log in to comment