Skip to content

Install GDAL via a Python wheel - #303

Merged
brianhelba merged 1 commit into
mainfrom
gdal-install
Jan 16, 2026
Merged

brianhelba merged 1 commit into
mainfrom
gdal-install

Conversation

@brianhelba

Copy link
Copy Markdown
Member

No description provided.

Comment thread bats_ai/settings/base.py
Comment on lines +128 to +129
GDAL_LIBRARY_PATH = osgeo.GDAL_LIBRARY_PATH
GEOS_LIBRARY_PATH = osgeo.GEOS_LIBRARY_PATH

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread pyproject.toml
Comment thread pyproject.toml
Comment thread dev/django.Dockerfile
@brianhelba

Copy link
Copy Markdown
Member Author

I think this is an improvement, as I'd like to get towards a place where system libraries aren't required, as this makes deployment much easier and more portable. It also aligns with 12 Factor: Dependencies, as we want all of our application dependencies to be defined within our Python lockfile, rather than implicitly depending on system versions that we may not always have full control over.

I need help testing this and need help understanding exactly where GDAL is being required from (so we can make sure that the installed wheel satisfies the usage).

@BryonLewis

Copy link
Copy Markdown
Collaborator

I need help testing this and need help understanding exactly where GDAL is being required from (so we can make sure that the installed wheel satisfies the usage).

So we used to have a tile server for the spectrograms until we converted to using side-by-side JPEGS.

The other case is in the creation of the GRTS Cell Ids. This is a 10x10km grid across the North America that is used by USGS with their NABat project to identify locations of bats. They originally provided this to us as a large CSV with a tons of rows to be ingested. It's quicker to utilize the shapefiles and process them for ingestion (like 2 minutes vs the 15-20 for the CSV they gave us)
./core/managment/commands/loadGRTS.py or docker compose run --rm django ./manage.py loadGRTS

@BryonLewis BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wiped my local DB and tested this specifically with a new DB and the loadGRTS management command to use geopandas to process the shapefiles. Everything worked properly.
Additionally, tested the spectrogram creation (even though this should no longer have any dependency on GDAL) and that worked properly as well.

Thanks for the links to Notion and Large Image for background information.

@brianhelba
brianhelba merged commit abcffcb into main Jan 16, 2026
5 checks passed
@brianhelba
brianhelba deleted the gdal-install branch January 16, 2026 17:51
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

Successfully merging this pull request may close these issues.

2 participants