• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

OSGeo4w and python

Messages
55
Country
unitedstates
Hi all,

After a bunch of experimenting and searching around, I'm a bit stuck getting the gdal tools that work in concert with python to function properly. Specifically, I'm trying to retile a GeoTiff using gdal_retile.py.

I have no problem using gdal tools to warp imagery or add or remove metadata. I regularly create mosaics of smaller tiles and and translate them between projections using gdalwarp and gdal_translate, but the functions that require python support are causing me problems.

From within the OSGeo4w command prompt, I have tried beginning the command with "python gdal_retile.py..." This results in "python: can't open file gdal_retile.py: [Errno 21] no such file or directory"

I have also tried switching to python from the OSGeo4w command prompt, and beginning the gdal_retile.py command string there. In this case, I get an invalid syntax error.

There is plenty of talk online about getting gdal tools to work with python, but I'm afraid they all assume a basic level of understanding of python that I simply don't have.

Has anyone had an experience similar to mine? Are there any OSGeo4w users here that could point me to some helpful literature or who could possibly determine which steps I've messed up?

Thanks a lot!

bmart
 
I wonder if you could open the script using the IDLE GUI window.

Do the tools work under Python 2.7 or Python 3.3? The syntax is QUITE different between versions.

I am a python beginner, but that would be where I would start I think.
 
Hi,

Did you start the OSGeo4W shell? In that case you should be able to just type gdal_retile (without calling python first).
 
Hi,

Did you start the OSGeo4W shell? In that case you should be able to just type gdal_retile (without calling python first).

Yes, I always enter the commands from the OSGeo4W shell. I'll post a screenie of what's going on. I'm thinking that either my syntax is bad or the python bindings are somehow screwed up.
 
I just now got it working. Thanks for your help, Arno and hcornea. I believe the problem was a simultaneous installation of python elsewhere on my machine which I may have at one point or another told gdal to search for. Uninstallation resulted in proper functioning of gdal_retile. If this is only coincidence, then the problem may have been that my syntax was wrong--I may have been issuing the command "gdal_retile.py" instead of just "gdal_retile". In either case, I'm on my way now...
 
Back
Top