New answers tagged

2 votes

Updating/Setting Field on GML file not working

The first line of the docs states: OGR has limited support for GML reading and writing. Update of existing files is not supported. And even if it was supported, you're opening the file in read mode ...
user avatar
  • 51.7k
6 votes
Accepted

Deleting the same column(s) from different shapefiles in QGIS

A PyQGIS solution. Tested on QGIS 3.24.1-Tisler. Proceed with Plugins > Python Console > Show Editor and paste one of the scripts below. The press Run script and get the output. This approach ...
user avatar
  • 22.7k
1 vote

Unable to join data from another layer

If you want to join attribute data of one layer to other then you should use "Joins and Relates". Run the join command with "Join data from another layer based on spatial location"....
user avatar
1 vote

Unable to join data from another layer

If you only need the attribute table from one layer to another, "join attributes by location" function with "intersect" geometric predicate, should work. If each feature has it's ...
user avatar
3 votes
Accepted

Renaming categorical attribute values in QGIS attribute table: merge two different strings to the same name

Just run Field calculator, update the field by typing this expression: if ( "Species" in ('DD', 'Delphinus Delphinus'), 'Delphinus Delphinus', "Species" ) Here I ...
user avatar
  • 40k
2 votes

QGIS misidentifying fields attribute type

Single quotes ' are for strings, double " for fields. So you are trying to sum the strings 'MTO heat map_total' and 'MTO heat map grouping'. Change ' to " so QGIS understand you are ...
user avatar
  • 51.2k
0 votes

QGIS not always recognizing the field name from excel files

The trick is to add at least one numerical field as last column
user avatar
5 votes

Filling attributes in one field based on second field with same values in QGIS

You can use a short PyQGIS script. First create your new field e.g. "ID_2" and fill it with the values from "ID_1" (the expression to do that is simply "ID_1"). Next open ...
user avatar
  • 13.5k
1 vote

Maximum value of field of vector layer using PyQGIS

There are also several other approaches available: Approach 1 : QgsAggregateCalculator with Max Available aggregates to calculate. Not all aggregates are available for all field types. This approach ...
user avatar
  • 22.7k
6 votes

Filling attributes in one field based on second field with same values in QGIS

If you want to update SID_1 with the value of SID_2 if SID_1 is NULL choose Update existing field in the Field Calculator execute a simple conditional: IF( "SID_1" IS NULL, "SID_2"...
user avatar
  • 23.1k
1 vote

Merging multiple point layers with common fields to create single table in QGIS

There is a possibility using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... Let's assume there are two point layers one called 'points1' and second called '...
user avatar
  • 22.7k
0 votes

How to hide more than one QGIS attribute field at a time?

Couple of lines to set all field widgets to 'Hidden' for active (selected) layer, tested on QGIS 3.24 in Python Console: layer = iface.activeLayer() fields = layer.fields() for i in range(0, fields....
user avatar
  • 9,196
1 vote

Merging multiple point layers with common fields to create single table in QGIS

Menu Processing > Toolbox > Merge Vector Layers. Field calculator: create a new string (text) field with this expression: concatenate( to_string(unique_value1), concatenator:=',', group_by:=...
user avatar
  • 40k
2 votes

Updating attribute field with values from list calculation using PyQGIS

Try this logic: a = [134.24, 134.24, 134.24, 134.99] b = [58.848430067837946, 70.46615125391358, 63.02756211443306, 60.662300968221174] c = 0.6673779977746334 newlayer = iface.activeLayer() with ...
user avatar
  • 24.6k
2 votes

Adding name of each shapefile polygon to its attribute table with add field using ArcMap ModelBuilder

Your shapefile needs to be named differently. Since your model is failing on Add Field, I tested Add Field on a shapefile named test.tif.shp and it returned an error. I suggest trying to rename it ...
user avatar
0 votes
Accepted

Trying to update attributefields from shapefile with field values from intersecting shapefile features

You can do it like this by using a spatial index for a greater performance. Check the code comments for explanations. As mentioned in the last comment, you did not mention what should happen if there ...
user avatar
  • 24.6k

Top 50 recent answers are included