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

Proper usage of GDAL and OGR #3

Open
iosonobert opened this issue Apr 16, 2021 · 0 comments
Open

Proper usage of GDAL and OGR #3

iosonobert opened this issue Apr 16, 2021 · 0 comments

Comments

@iosonobert
Copy link

Could be wrong here, but Kelly's GDAL issue could be improper/deprecated usage of GDAL by SFODA. Details:

Installed yesterday on a kubuntu VM and with problems except that I made the VM too small.

Reinstalled everything today on a larger VM. I believed I followed the same steps, but now may well be having the same issue as Kelly.

It seems that after you install the GDAL development libraries and then run:

 pip3 install GDAL=3.2.1

It seems this creates the osgeo package in your .../python*/dist-packages directory

The proper import of gdal and ogr should then be

 from osgeo import gdal, ogr

The usage

 import gdal
 import ogr

Appears to be deprecated.

The question remains as to why it works for everyone else (and worked for me last night) but not for Kelly (and not for me today). I believe I have this answer also. For whatever reason, the GDAL install I did yesterday appears to have imported version 3.0.4, but the one I did today has imported 3.2.1. I believe the older version does add the older python bindings such that 'import gdal' and 'import ogr' work fine. My guess is Kelly has a newer version of GDAL.

I think if Matt updates the sfoda code we'll be good to install whatever version of GDAL we choose. Alternately we need to update the suntans_tutorial documentation to specify install for an older version of GDAL. I suspect the former is easier.

Cheers,
Andrew

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

1 participant