配置geoDjango

详细参见官网文档

https://docs.djangoproject.com/en/1.11/ref/contrib/gis/tutorial/

https://docs.djangoproject.com/en/1.11/ref/contrib/gis/install/#windows

先安装PostGIS,用来配置PostgreSQL数据库

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

安装psycopg2包,用于在python中访问PostgreSQL

pip install psycopg2

anaconda也可以

安装OSGeo4W,这样有些地理处理的包好安装

设置环境变量

set OSGEO4W_ROOT=C:\OSGeo4W64
set PYTHON_ROOT=E:\ProgramBig\Anaconda3
set GDAL_LIBRARY_PATH=%OSGEO4W_ROOT%\share\gdal
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set PATH=%PATH%;%PYTHON_ROOT%;%OSGEO4W_ROOT%\bin
reg ADD “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v Path /t REG_EXPAND_SZ /f /d “%PATH%”
reg ADD “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v GDAL_LIBRARY_PATH /t REG_EXPAND_SZ /f /d “%GDAL_LIBRARY_PATH%”
reg ADD “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v PROJ_LIB /t REG_EXPAND_SZ /f /d “%PROJ_LIB%”

转载自:https://blog.csdn.net/sinat_28046641/article/details/78389394

You may also like...

退出移动版