Reference link Add link description
According to this blog , Search on your computer :proj.db file , give the result as follows :
Specify environment variables at the beginning of the program , Specify the path found in the previous step
Cause analysis
Use osgeo.osr Can be installed directly from GDAL The package reads information about the specified projection type , stay proj.db The parameters of common projection systems are stored in , Therefore, it is specified that EPSG No. 1 can start from proj.db Get projection information from .
After investigation , My situation is anaconda In the virtual environment of GDAL And other geospatial libraries , At this time, multiple... May be generated in the same environment path proj.db file , When accessing it, the program will not be able to determine which . So just look for gdal The one installed proj.db Where is the , Specify environment variables in the program to solve .
Search under the path of the virtual environment in the resource manager proj.db, Find the above results :
Solution :
Add the following code at the beginning of the program
import os
# Corresponding to oneself python Package installation address
os.environ['PROJ_LIB'] = r'E:\Users\Lib\site-packages\osgeo\data\proj'
With osgeo A folder path ,