Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I will document how to make multi-band grids using gdal_grid #9233

Closed
jidanni opened this issue Feb 14, 2024 · 1 comment
Closed

I will document how to make multi-band grids using gdal_grid #9233

jidanni opened this issue Feb 14, 2024 · 1 comment

Comments

@jidanni
Copy link
Contributor

jidanni commented Feb 14, 2024

I intend to add an additional gdal_grid example to the manual
that creates a grid with more than one band.
One little problem: I don't know if it is possible.
Currently the only examples use a single band.
Let's say here is the input we will use, input.csv:

X,Y,Band1,Band2
33,-22,1.3,2.4
34,-23,2.2,3.3

If it is not possible, then I will state in the manual that gdal_grid
can only make images with one band.

However, we see

       -ot <type>
              Force the output image bands to have a specific data  type  sup-

where the word bands is seen, with the plural, so there is hope.

We also see

       -l <layername>
              Indicates the layer(s) from the datasource that will be used for
              input features.  May be specified multiple times, but  at  least
              one layer name or a -sql option must be specified.

and the word "multiple", and indeed I did that and did get more bands,
but they were empty.

It want also to show how one could avoid .vrt files, instead just
using all command line options, but for completeness I would also want
to make an example using a .vrt file.

OR, if gdal_grid is not the best tool to make multi-band grids, then I will state in the manual that this is the case, and give the name of the better tool.

@rouault
Copy link
Member

rouault commented Feb 19, 2024

One little problem: I don't know if it is possible.

not directl with gdal_grid.
You might use gdal_grid multiple times to create one band per file, and then use gdalbuildvrt -separate + gdal_translate to combine the one-band-files into a single one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants