<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Hi Idan,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Yes, the operating system is Windows.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>You mean that I should zip the whole Python installation folder and copy it to the customer environment? <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Or just the Scripts folder? <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Sorry, I am a beginner in Python.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I had also thought of the third option with the "stand alone app".<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I was just not sure if all dependencies (e.g. numpy) are included.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I will try out the options soon, thank you.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I had just hoped that there was an easier way.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>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.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I had already tried to install GDAL via „pip install GDAL“, but it requires c++ build tools.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Can't this be simplified?<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Why are scripts like gdal_calc not included to the „standard“ package so that they can be run similarly to gdalinfo?<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>This would probably make everything a little easier.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Carsten<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b>Von:</b> Idan Miara <idan@miara.com> <br><b>Gesendet:</b> Freitag, 6. Januar 2023 21:15<br><b>An:</b> Carsten Lockenkötter <carsten.lockenkoetter@web.de><br><b>Cc:</b> gdal-dev@lists.osgeo.org<br><b>Betreff:</b> Re: [gdal-dev] Using gdal_calc without python<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi!<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>gdal_calc is implemented fully in python, so you would need python to run it.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Assuming your client uses Windows and you don't have admin privileges to install software, you could install official Python and gdal (from <a href="https://www.lfd.uci.edu/~gohlke/pythonlibs/">https://www.lfd.uci.edu/~gohlke/pythonlibs/</a>, which unfortunately is not maintained anymore) on another Windows machine and then just zip it and unzip on your clients' pc. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Another option is using OSGeo4W (or QGIS).<o:p></o:p></p></div><div><p class=MsoNormal>In the same way, you could also be able to install it, zip and unzip (I haven't tried this method recently)<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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).<o:p></o:p></p></div><div><p class=MsoNormal>I was successful with both methods, but I think that the first method is easier.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Maybe also <a href="https://pyinstaller.org/en/stable/">https://pyinstaller.org/en/stable/</a> could help if you needed to pack gdal_calc more like a "stand alone app", but I think that wasn't your issue.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Kind regards,<o:p></o:p></p></div><div><p class=MsoNormal>Idan<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Fri, 6 Jan 2023 at 21:34, Carsten Lockenkötter <<a href="mailto:carsten.lockenkoetter@web.de">carsten.lockenkoetter@web.de</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I'm using some Python functions provided by you, such as gdal_calc.py.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>My workflow works so far, but my problem is that I have to run everything on my customer's server. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>So far, I've always downloaded the compiled binaries from <a href="http://gisinternals.com" target="_blank">gisinternals.com</a> and copied them to the server (the zip archive) to use gdalwarp, for example. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>But with that, I can't run gdal_calc, right? Python is still needed for that, or am I mistaken?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is there a way to use gdal_calc/gdal_retile without having to install software components? <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>If there are approaches to control the functions through a wrapper, that would also help me. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I probably have to rewrite the Python script in C#?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regards,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Carsten<o:p></o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></p></div></blockquote></div></div></body></html>