use_bundled_database¶
- geodetic_engine.osdudb.use_bundled_database(enabled=True)[source]¶
Switch the bundled database on or off.
The bundled database is the one an installed distribution provides, or else the OSDU database shipped with this package. This overrides the choice made on import, whatever made it. Switched on, the bundled database’s directory is put first on PROJ’s search path and the other directories stay, so grids are still found. Switched off, PROJ’s search path returns to what it was before the bundled database was put first, or else loses the bundled directory.
A later
pyproj.datadir.set_data_dir()overrides this in turn. pyproj keeps one PROJ context per thread: the calling thread switches at once, and another thread the next time it callsactive_database()or resolves a CRS, operation or identifier through this package. A thread that only calls pyproj directly keeps the database it had.- Parameters:
enabled (
bool, default:True) – True to read the bundled database, False to stop.- Return type:
- Returns:
The database PROJ now reads, as
active_database()reports it.- Raises:
FileNotFoundError – If switching on, and this installation has no bundled database; or switching off, and no other directory on PROJ’s search path holds a
proj.db.