Skip to main content

New answers tagged

3 votes

Difference of attributes between two shapefiles based on similar field in QGIS

You can create a virtual layer and use coalesce The coalesce() function accepts two or more arguments and returns the first non-null argument. with full outer join The FULL OUTER JOIN keyword ...
Bera's user avatar
  • 75k
1 vote

In PostgreSQL how to build polygons using lines around each dot

Polygonize all lines then inner join your points to them, and select distinct polygons: with polygonized as ( select l.id, st_makepolygon((st_dump(l.geom)).geom) as geom from test.lines as l ) select ...
Bera's user avatar
  • 75k
1 vote

Changing values where two geometries are equal otherwise keep value with QGIS Virtual layer

The solution demonstrated by @Bera is correct for cases where there is a 1 to 1 equality of geometries from two layers. If the second layer has two or more features with geometries equal to features ...
Taras's user avatar
  • 33.3k
5 votes
Accepted

Changing values where two geometries are equal otherwise keep value with QGIS Virtual layer

b.DTV will be NULL when there are no duplicate geometries so a.DTV+NULL=NULL. With coalesce you can replace NULL with 0, whenever b.DTV is NULL: select a.DTV + coalesce(b.DTV, 0) as DTV, a....
Bera's user avatar
  • 75k
1 vote
Accepted

gpkg filename to add PostGIS table field

You can use the -sql flag to create arbitrary columns in the output. I've not got a PostGIS handy so I'm going to add to an existant table.gpkg file. It has 5 rows and the file column is all "nc1&...
Spacedman's user avatar
  • 65.2k
2 votes

Merging PostGIS tables with billions of rows

Is CTE + union all + case statements the best way to join multiple tables? You can simplify that to just two full joins: demo at db<>fiddle select*from pop.children full join pop.men using(...
Zegarek's user avatar
  • 712

Top 50 recent answers are included