-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyqgis.ps1
29 lines (21 loc) · 888 Bytes
/
pyqgis.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Set OSGEO4W_ROOT variable
$env:OSGEO4W_ROOT = "C:\OSGeo4W"
# Call the o4w_env.bat script
& "$env:OSGEO4W_ROOT\bin\o4w_env.bat"
# Call the env.bat script for GRASS
& "$env:OSGEO4W_ROOT\apps\grass\grass78\etc\env.bat"
# Add directories to the system PATH
$env:PATH = $env:PATH + ";$env:OSGEO4W_ROOT\apps\qgis\bin"
$env:PATH = $env:PATH + ";$env:OSGEO4W_ROOT\apps\grass\grass78\lib"
$env:PATH = $env:PATH + ";$env:OSGEO4W_ROOT\apps\Qt5\bin"
$env:PATH = $env:PATH + ";$env:OSGEO4W_ROOT\apps\Python39\Scripts"
# Set PYTHONPATH
$env:PYTHONPATH = $env:PYTHONPATH + ";$env:OSGEO4W_ROOT\apps\qgis\python"
# Set PYTHONHOME
$env:PYTHONHOME = "$env:OSGEO4W_ROOT\apps\Python39"
# Add Git to the system PATH
$env:PATH = "C:\Program Files\Git\bin;" + $env:PATH
# Navigate to your project directory (replace with your actual project path)
Set-Location ""
# Start VS Code at this location
code .