程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python tailoring TIF data, it comes from another proj installation

編輯:Python

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 ,


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved