Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 59948

QGIS is a cross-platform GIS application licensed under the GNU General Public License.

2 votes
2 answers
7k views

How to change the active layer in QGIS Console?

I want my script to perform actions on a particular layer. Online advice I've found so far suggests using the iface method "setActiveLayer()". Makes sense based on the name alone. Scenario: In t …
Waterman's user avatar
  • 1,217
1 vote
2 answers
1k views

How to Unselect Features with QGIS tool "selectbyexpression' and the ">" Operator

I'll bet there are more operator symbols than ">" that also don't work with this tool because the "Select By Expression" GUI at the top menu of QGIS only has 9 operator options at the top and ">" isn't …
Waterman's user avatar
  • 1,217
1 vote
0 answers
522 views

Try/Except Statement gives different Results in QGIS Console vs. QGIS Tool

I want my script to do different things depending on whether a particular layer DOES or DOES NOT exist in the Map Layers list. I thought the try: / except: statements would be the best way to achieve …
Waterman's user avatar
  • 1,217
6 votes
1 answer
3k views

Add Values to New Column in Attributes Table using Python Console in QGIS

I've added a new column to my table called "STRNAME" using: path = "/Users/shapefiles/roads/" metro_roads = QgsMapLayerRegistry.instance().mapLayersByName('Metro_roads')[0] processing.runalg('qgis:ad …
Waterman's user avatar
  • 1,217
2 votes
0 answers
41 views

Processing Tools Help Documentation for QGIS? [duplicate]

I'm used to ArcGIS but am attracted to QGIS for its open source (free) nature. … I realize Esri has the budget for this and QGIS is open source, free, and programmed by volunteers, but without good explanations on how to use QGIS tools how can one expect to master them as much as the …
Waterman's user avatar
  • 1,217
1 vote
1 answer
1k views

Determining Layer's DATUM and PROJECTION in "Layer Properties" (QGIS)

I have two layers in a QGIS project: "Layer 1" and "Layer 2". …
Waterman's user avatar
  • 1,217
6 votes
2 answers
3k views

Print values from Tables in QGIS Console

Example 2: >>>fields = vl.pendingFields() >>>fields.toList() Output: [<qgis._core.QgsField object at 0x11f24a770>, <qgis._core.QgsField object at 0x11f24aa68>, <qgis. … _core.QgsField object at 0x11f24ab00>, <qgis._core.QgsField object at 0x11f24ab98>, <qgis._core.QgsField object at 0x11f24ac30>, <qgis. …
Waterman's user avatar
  • 1,217
5 votes

Check if layer exists in QGIS Project using PyQGIS

boolean = False layers = QgsMapLayerRegistry.instance().mapLayers() for name, layer in layers.iteritems(): if layer.name() == ('the_Map_Layer_in_question'): boolean = True # if t …
Waterman's user avatar
  • 1,217
11 votes
3 answers
6k views

Check if layer exists in QGIS Project using PyQGIS

In QGIS, what is the simplest python code (least possible) to verify if a particular layer is PRESENT or ABSENT in the Map Layers list? …
Waterman's user avatar
  • 1,217