FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
QGIS_Python_Scripts/test_script.py at master · Zia-/QGIS_Python_Scripts · GitHub
Zia-
/
QGIS_Python_Scripts
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
QGIS_Python_Scripts
/
test_script.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (22 loc) · 813 Bytes
Breadcrumbs
QGIS_Python_Scripts
/
test_script.py
Copy path
File metadata and controls
26 lines (22 loc) · 813 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# Customize this starter script by adding code
# to the run_script function. See the Help for
# complete information on how to create a script
# and use Script Runner.
""" Your Description of the script goes here """
# Some commonly used imports
from
PyQt4
.
QtCore
import
*
from
PyQt4
.
QtGui
import
*
from
qgis
.
core
import
*
from
qgis
.
gui
import
*
import
PyQt4
.
QtGui
def
run_script
(
iface
):
mapreg
=
QgsMapLayerRegistry
.
instance
()
mapreg
.
removeAllMapLayers
()
wb
=
QgsVectorLayer
(
'/home/zia/Documents/Data/ITU/Campus ITU Shapefiles/campus_shp_4326/campus_info.shp'
,
'world_borders'
,
'ogr'
)
mapreg
.
instance
().
addMapLayer
(
wb
)
renderer
=
wb
.
rendererV2
()
symb
=
renderer
.
symbol
()
symb
.
setColor
(
QColor
(
Qt
.
red
))
wb
.
setCacheImage
(
None
)
wb
.
triggerRepaint
()
iface
.
refreshLegend
(
wb
)
Back
|
FazBrowse Home
|
New Git URL