Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
33 votes
3 answers
35k views

Understanding "Join Attributes by Location" in QGIS

I wonder if there is somewhere an explanation for the parameters that can be set when running the Algorithm "Join Attributes by Location" in QGIS 2.18. I had a look here: Documentation QGIS Testing |...
four-eyes's user avatar
  • 3,440
17 votes
3 answers
28k views

Changing value of attribute of QgsFeature using PyQGIS

I would like to update one attribute of a feature. However, I don't know to update it using the feature object. I have to use a data provider to update it. layers = QgsMapLayerRegistry.instance()....
wannik's user avatar
  • 535
16 votes
3 answers
39k views

Summing data from column in QGIS Attribute table

I'm working with population data, and I have an issue when it comes to knowing the sum of a population inside the attribute table. In my attribute table, I'd like to add all the numbers in the red ...
Tim56's user avatar
  • 1,042
8 votes
2 answers
14k views

Spatially joining polygon fields onto point layer in QGIS

I have gridded depth points in CSV format that I'm trying to add other map data to, in additional columns. I've tried joining fields, hoping that I could link the shapefile data to the CSV, but when I ...
dez93_2000's user avatar
  • 1,089
52 votes
9 answers
59k views

Identifying duplicate attributes in field using QGIS

I have a point shapefile with thousands of points. It has an "ID" code field that is supposed to be unique. Every now and then the data entry clerk wrongly type the "ID" creating ...
obsidianz's user avatar
  • 523
47 votes
10 answers
114k views

Determining the centroid of polygons in QGIS

I have a polygon vector and I want to quickly attain the centroid of this polygon for insertion in a text document. I am working with QGIS. I searched through other questions and although some are ...
David's user avatar
  • 771
29 votes
4 answers
92k views

Merging/Dissolving polygons by Common Attribute Field in QGIS?

I have joined corresponding Local Enterprise Partnerships table data into a polygon shapefile containing UK Local Authorities. How do I Dissolve or Merge the the Local Authorities polygons by ...
Jeremy's user avatar
  • 471
14 votes
2 answers
35k views

Maximum length of text fields in shapefile and geodatabase formats?

The maximum text string for a field in a geodatabase is 320 characters. The data I am importing has long character strings and it seems to be truncating when I convert into shapefile at the max ...
user23159's user avatar
  • 165
29 votes
4 answers
59k views

Reading attribute values using PyQGIS

What is the way to get the information contained in the attribute table, say in column 2, row 2 using PyQGIS?
user16018's user avatar
  • 309
20 votes
3 answers
35k views

Selecting features using expression with PyQGIS

How can I select features with PyQGIS using an expression? I tried to use an QgsExpression but the select method doesn't take it: exp = QgsExpression("'ogc_fid' = 482") cLayer = canvas....
ustroetz's user avatar
  • 8,049
10 votes
3 answers
13k views

Deleting column/field in PyQGIS

How to remove or delete column fields in a shapefile using PyQGIS?
Nahm's user avatar
  • 871
16 votes
4 answers
45k views

Changing data type in QGIS Attribute table

I have county data in which the "FIP"s (actually State "FIP"s and County "FIP"s combined). I have data imported as CSV with the same "FIP"s data titled '...
user10525's user avatar
  • 301
9 votes
2 answers
30k views

Why can't I edit attribute table imported through 'text as layer'

I imported the coordinates from an Excel table. They show as single points as intended. Now I want to add columns to the attribute table, but I'm not able to edit it. I wanted to import the following ...
user23609's user avatar
96 votes
5 answers
157k views

Renaming attributes/fields in shapefile attribute table using QGIS

I would like to rename some fields in my attribute table: Like rename "XRF_N3"in something else. It seems quite a easy issue but I don't find any information about how can I do that.
G M's user avatar
  • 2,078
52 votes
5 answers
38k views

Change style properties of several layers simultaneously?

I'm working on bulk data. I have a few hundred GeoTIFF images imported into a QGIS project, and I'd like to modify their layer properties - things like the no-data-value, transparency of certain pixel ...
Kay F. Jahnke's user avatar
8 votes
1 answer
3k views

Adding calculated fields with PyQGIS

In the Memory provider described in PyQGIS Cookbook and in the question Creating new empty vector layer with PyQGIS I can see how to create a Vector Layer programmatically using standard fields (...
rpet's user avatar
  • 159
32 votes
8 answers
29k views

Getting list of distinct values from shapefile field using QGIS

I have a shapefile whose features I can filter by specifying a where clause in the query dialogue. F.x. I have a field named "city_name" and by stating "city_name" = 'London' in ...
Raffael's user avatar
  • 550
30 votes
5 answers
60k views

Grouping and counting attribute data in QGIS

I want to group and count features with the same code attribute value. I can classify the data and enable feature count in the layer list but I cannot get counts in the attribute table.
Seren's user avatar
  • 331
17 votes
3 answers
25k views

How to split text attribute by characters in QGIS?

Is it possible to make a new column, for example named "Test" and store the first part of the column "Name" split by -? See below how it should look like:
Danny's user avatar
  • 189
15 votes
4 answers
11k views

Re-ordering fields permanently using ArcGIS Make Query Table tool?

In the Answer to Reordering fields (permanently) in file geodatabase using ArcGIS Desktop? it was stated that the Make Query Table tool could be used to re-order fields in tables and feature classes ...
PolyGeo's user avatar
  • 65.4k
11 votes
3 answers
15k views

Getting attributes of selected features using PyQGIS

Could anybody provide an example how to get the attributes of selected features? I tried the following code in the Python Console : but I'm stuck at the point where I'd like to get the attributes: ...
dimpflmoser's user avatar
22 votes
9 answers
73k views

Changing Field Name in ArcGIS Desktop

How can I change the field names (not the alias) in ArcGIS 10.2? I already found this page on ArcGIS support: "Renaming shapefile fields (Defense Mapping)" but there is is not "Defense ...
user1106951's user avatar
  • 1,498
11 votes
1 answer
2k views

Creating predefined values in field using PyQGIS

I would like to make programmatically (with Python) the same thing than we can do directly in QGIS when you create a list of values for a field. I would like to create a new field and specify a list ...
Etienne's user avatar
  • 597
10 votes
5 answers
26k views

Changing fields order in QGIS

I have to draw several stuff and input the data, all the layers have the same data fields but some require 2\5 attributes to be filled. Is there a way to change the order of those fields to be on top ...
AsdAsd's user avatar
  • 509
9 votes
1 answer
23k views

Summarizing column in QGIS field calculator?

I have data with a column containing a number value, and I want to divide the value of each feature by the total sum of all the values in the column (to get a percentage). So I would like to know if ...
hexamon's user avatar
  • 2,666
9 votes
5 answers
21k views

Renaming field using ArcPy?

What I need to do: rename a field name of a table/feature class copy all values to the new field So far I have done following code as @artwork21 suggests: import sys import traceback import arcpy ...
Emi's user avatar
  • 2,425
6 votes
1 answer
368 views

Attribute subdomain in QField/QGIS

I have a point layer with the attribute/field: kingdom with a value map widget so I can choose the values: Tree or mammal. And a second field: Species (where I will register: Pine, Oak, Deer or Fox)...
Bera's user avatar
  • 77.7k
6 votes
2 answers
1k views

Modifying width and precision of database using QGIS?

I have a database in txt format made of several columns of real numbers. Two column are integer, 17 are real (rounded to the first decimal) and 17 are real rounded to the second decimal. If I import ...
Samuele's user avatar
  • 179
2 votes
2 answers
3k views

Building raster with multiple attributes based on 3 input rasters?

I am trying to make a new raster based on three input rasters which have the same cell size and the grids align perfectly. I now want to construct a new raster, which for each cell, has three ...
Renée's user avatar
  • 351
1 vote
2 answers
4k views

Summarizing data using ArcGIS Desktop?

I am relatively new to GIS and am facing some difficulties trying to summarize/pool data together. I've attached the file to make it easier. FID_pc11_1 (Refers to postcode identifier) and count ...
user32581's user avatar
24 votes
10 answers
14k views

Sorting by multiple fields at same time in QGIS?

Is it possible to sort multiple fields at the same time in QGIS? For example, I'd like to sort a table by state name, and then within each state, sort by county name. This would be the same as ...
Stu Smith's user avatar
  • 8,356
16 votes
3 answers
9k views

Getting field names of layer using PyQGIS

How does one get a list of attributes/field names of a layer by means of PyQGIS 3? If my layer has field names seen in the attribute table or properties. How can I use PyQGIS to give me a string list ...
grego's user avatar
  • 1,073
12 votes
1 answer
8k views

Writing vector layer to CSV file with geometry using PyQGIS?

I use Python try to write vector layer file to csv file with this code: QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV") It can export to xyz.csv but only ...
Anubiz's user avatar
  • 121
11 votes
4 answers
13k views

Looking for QGIS equivalent of ArcGIS "Summarize" [duplicate]

In ArcMap, the user can create a table that groups the field values using summarize field tool (as shown below) How can I create a table that summarizes field values in QGIS?
Hani Draidi's user avatar
11 votes
3 answers
16k views

Merge lines with the same 'name' attribute on QGIS?

I have a shapefile with a few thousand lines, each is a street segment. I'd like to merge all features with the same 'streetName' attribute into a single attribute. I only really care about the name ...
Tercero A's user avatar
  • 111
8 votes
4 answers
30k views

Python Script to Add Fields to Feature Classes

I have to try to add a field called 'Name' to a bunch of different feature classes using python, and then access the name of the feature class to fill in the field. I have no idea how to even start ...
EmilyF's user avatar
  • 429
8 votes
1 answer
3k views

Creating variable distance buffers in QGIS

I would like to create variable distance buffers for some points in QGIS 3.4. I have seen in previous posts that there used to be a tool for this in older versions of QGIS, but that this tool wasn't ...
Phoebe's user avatar
  • 351
7 votes
1 answer
5k views

How to style a vector layer in QGIS using hexadecimal color code stored in attribute?

I have a polygon shapefile storing hexadecimal color codes in a specific attribute. gid | label | color ---------+-----------+------------ 1 | Crops | #FF5F2C 2 | Forest ...
wiltomap's user avatar
  • 2,720
6 votes
2 answers
1k views

Hiding column in attribute table by using PyQGIS

Is there a way to hide a column in the attribute table by using PyQGIS? By hiding I do not mean hiding only the edit widget, I would like to hide the column completely. It is possible to achieve that ...
svoboond's user avatar
6 votes
1 answer
11k views

After performing table join all the fields are "NULL" in QGIS

Within QGIS, I joined .dbf table containing population data to a shapefile of Census tracts. The join field is called "GISJOIN" in both the target table and the shapefile's table, and this ...
Abijah's user avatar
  • 323
5 votes
2 answers
6k views

Updating the attribute table of feature using PyQGIS

The following code updates the value of the field ("name") in the console and shows the result but the actual attribute table does not get updated. Can anybody suggest the error in the code? ...
Bipin Thapaliya's user avatar
5 votes
2 answers
3k views

Converting double field to integer in database view so ArcMap query layer can use field as unique identifier

I have a field in a table that is a double data type, but the values are actually integers. The table is from third-party software, so I don't have control of the field data types. I'm attempting to ...
User1974's user avatar
  • 1,272
3 votes
1 answer
9k views

Exporting QGIS contour attributes in DXF file?

I have a .tiff data file that generates contours in QGIS. I save it as .dxf. The contours don't have any attributes or data. That's bad, because I want to make a 3D landscape in Revit using the ...
QGisRookie's user avatar
2 votes
1 answer
6k views

Assigning field value based on location without join

I'm interested in updating a field in geodatabase feature classes based on their location in relation to another feature class in the geodatabase, but without having to perform a join (and therefore ...
troubbble's user avatar
  • 220
34 votes
3 answers
20k views

How to easily edit attribute data using Regular Expressions?

I am writing a tutorial for MSc students that uses QGIS. One of the tasks requires the attribute data to be modified (see pdf draft of tutorial here if interested ). The question is how to get them ...
RobinLovelace's user avatar
18 votes
2 answers
19k views

Creating drop down list with values in QGIS

I want to show a drop down list in the feature attributes dialog. I have three different building zones. The hot Wohnzon A, B residential zone and residential zone C. Now I have an attribute called ...
user8839's user avatar
  • 623
18 votes
4 answers
19k views

Filter features based on their attributes using Python

How to get features by their attributes (similar to 'IQueryFilter' in ArcObjects) in QGIS using Python? Instead of getting all features and filter it manually, is there any option to use where clause ...
venkat's user avatar
  • 1,051
17 votes
2 answers
24k views

Summing values in field using QGIS

Using QGIS 1.8, I've got a shapefile with an integer field called "AREA" and I'd like to sum the values which are in this shapefile. Does anybody know how to?
Robert 300's user avatar
14 votes
2 answers
17k views

Getting field names in PyQGIS

I am trying to change an plugin from QGIS 1.8 to 2.0. In the 1.8 version I create a table of the field names like this: layer = vlayer provider = layer.dataProvider() feat = QGSFeatrue() allAttrs = ...
Martin's user avatar
  • 2,918
12 votes
1 answer
6k views

KeyError: '-1' when adding field and calculating expression with PyQGIS

I want to use PyQGIS to add a new field and calculate the values for each feature. Similar to the Field Calculator option. My 'Field Calculator' expression is for example: y(start_point($geometry)) ...
OHTO's user avatar
  • 243

1
2 3 4 5
7