[gdal-dev] Using gdal_calc without python

Idan Miara idan at miara.com
Fri Jan 6 12:14:35 PST 2023


Hi!

gdal_calc is implemented fully in python, so you would need python to run
it.

Assuming your client uses Windows and you don't have admin privileges to
install software, you could install official Python and gdal (from
https://www.lfd.uci.edu/~gohlke/pythonlibs/, which unfortunately is not
maintained anymore) on another Windows machine and then just zip it and
unzip on your clients' pc.

Another option is using OSGeo4W (or QGIS).
In the same way, you could also be able to install it, zip and unzip (I
haven't tried this method recently)

You might still need to install on your clients' pc Visual Studio
Redistributables (which I think both Python and QGIS installers install for
you automatically).
I was successful with both methods, but I think that the first method is
easier.

Maybe also https://pyinstaller.org/en/stable/ could help if you needed to
pack gdal_calc more like a "stand alone app", but I think that wasn't your
issue.

Kind regards,
Idan

On Fri, 6 Jan 2023 at 21:34, Carsten Lockenkötter <
carsten.lockenkoetter at web.de> wrote:

> Hi,
>
>
>
> I'm currently building a workflow to crop possible white or black borders
> from my Geotiff files and create raster tiles with an alpha band.
>
> I'm using some Python functions provided by you, such as gdal_calc.py.
>
>
>
> My workflow works so far, but my problem is that I have to run everything
> on my customer's server.
>
> Unfortunately, I don't have the ability to install software there, so I
> can't install Python and gdal_calc.py can't be run.
>
>
>
> So far, I've always downloaded the compiled binaries from gisinternals.com
> and copied them to the server (the zip archive) to use gdalwarp, for
> example.
>
> But with that, I can't run gdal_calc, right? Python is still needed for
> that, or am I mistaken?
>
>
>
> Is there a way to use gdal_calc/gdal_retile without having to install
> software components?
>
> If there are approaches to control the functions through a wrapper, that
> would also help me.
>
> I have knowledge in C# and could use MaxRev.Gdal.Core, for example.
> However, I haven't found an approach yet to use gdal_calc.
>
> I probably have to rewrite the Python script in C#?
>
>
>
> Regards,
>
> Carsten
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230106/157eb31a/attachment.htm>


More information about the gdal-dev mailing list