[gdal-dev] Using gdal_calc without python

Carsten Lockenkötter carsten.lockenkoetter at web.de
Sun Jan 8 03:02:26 PST 2023


Hi,

 

i tried the „stand alone apps“ and it works as aspected. Thanks Idan.

In the discussion there was posted some new wheel files 1 hour ago.

 <https://github.com/cgohlke/gdal.whl/releases> https://github.com/cgohlke/gdal.whl/releases

 

Von: Micha Silver <tsvibar at gmail.com> 
Gesendet: Sonntag, 8. Januar 2023 08:38
An: Carsten Lockenkötter <carsten.lockenkoetter at web.de>; 'Idan Miara' <idan at miara.com>
Cc: gdal-dev at lists.osgeo.org
Betreff: Re: [gdal-dev] Using gdal_calc without python

 

This might be a good case for installing conda ( <https://conda.io/miniconda.html> https://conda.io/miniconda.html). The installation goes in a user's home directory (no need for admin rights), then you can setup a conda environment with whatever version of python you prefer, and install gdal in that env. and have access to all necessary gdal python scripts.

 

On 07/01/2023 2:18, Carsten Lockenkötter wrote:

Hi Idan,

 

Yes, the operating system is Windows.

You mean that I should zip the whole Python installation folder and copy it to the customer environment? 

Or just the Scripts folder? 

Sorry, I am a beginner in Python.

 

I had also thought of the third option with the "stand alone app".

I was just not sure if all dependencies (e.g. numpy) are included.

 

I will try out the options soon, thank you.

I had just hoped that there was an easier way.

It's a pity that the path with Python is so difficult for beginners and that you may have to install it from an unofficial source.

I had already tried to install GDAL via „pip install GDAL“, but it requires c++ build tools.

Can't this be simplified?

 

Why are scripts like gdal_calc not included to the „standard“ package so that they can be run similarly to gdalinfo?

This would probably make everything a little easier.

 

Regards,

Carsten

 

Von: Idan Miara  <mailto:idan at miara.com> <idan at miara.com> 
Gesendet: Freitag, 6. Januar 2023 21:15
An: Carsten Lockenkötter  <mailto:carsten.lockenkoetter at web.de> <carsten.lockenkoetter at web.de>
Cc: gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org> 
Betreff: Re: [gdal-dev] Using gdal_calc without python

 

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 <mailto: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 <http://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 <mailto:gdal-dev at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/gdal-dev





_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230108/64a1dd3e/attachment.htm>


More information about the gdal-dev mailing list