Skip to main content
22 votes
Accepted

ogr2ogr merge multiple shapefiles: What is the purpose of -nln tag?

For GDAL there are datastores which contain layers. Some datastores, like the database ones or GML, can hold several layers but some others like shapefiles can only contain one layer. You can test ...
user30184's user avatar
  • 68.1k
18 votes
Accepted

Merge thousands of rasters with gdal_merge.py

You can create a vrt file with gdalbuildvrt or gdal_merge.py -of VRT and then run gdal_translate -of GTiff on that VRT. Like this, I had much faster results compared to gdal_merge with huge files. ...
pLumo's user avatar
  • 6,549
17 votes
Accepted

sf geometry column naming differences R

I've just written this which I think will safely rename the geometry column by changing the names element and then setting the geometry column with st_geometry - which will affect the sf_column ...
Spacedman's user avatar
  • 65.6k
16 votes

Merging multiple vector layers to one layer using QGIS

In the meantime, a tool called "Merge vector layers" has been added to QGIS under Vector > Data Management Tools > Merge Vector Layers or under Vector general in the Processing Toolbox ...
stopopol's user avatar
  • 303
15 votes
Accepted

Rendering polygons ordered by size in QGIS

Most data providers do not guarantee any order in the way they deliver features. While an apparently stable order is often a side effect of the order in which features are stored in files, one shouldn'...
Matthias Kuhn's user avatar
15 votes

Merging neighbouring polygons in QGIS

You can use the dissolve tool from the QGIS Processing Toolbox. You find it at Vector > Geoprocessing Tools > Dissolve (see documentation). This will give you a large polygon where all parts are ...
Matte's user avatar
  • 6,265
14 votes
Accepted

completing satellite imagery tiles when data coverage is less than 100%

For images of the same location but different dates, I would rather talk about compositing than mosaicing (which combines images from different extents into a larger image). You will find a lot of ...
radouxju's user avatar
  • 49.8k
13 votes
Accepted

Merging a geodataframe and pandas dataframe based on a column

You should specify a common key using on parameter. I removed merged_ prefix for legibility. df = spatial_df.merge(tab_df, on='mukey', how='left') # df = tab_df.merge(spatial_df, on='mukey', how='...
Kadir Şahbaz's user avatar
13 votes
Accepted

Merging multiple temporal inputs in QGIS Graphical Modeler

Change your input back to the 123 Button (="Value-Input"). If you then click on the three dots ... to the right of the input line, you can choose your layers. Here, all layers from your ...
MrXsquared's user avatar
  • 35.3k
12 votes

Merging multiple vector layers to one layer using QGIS

You can also use the v.patch module under GRASS GIS commands. It's available in the processing toolbox. You can search for it when the dropdown at the bottom of the Processing Toolbox window is ...
user55937's user avatar
  • 1,293
12 votes
Accepted

Merging spatially separated polygons into one feature in QGIS

Check the corresponding geoalgorithm in the Processing Toolbox (Ctrl+Shift+T). For QGIS 3 : "Promote to multipart" For QGIS 2 : "Singleparts to multipart"
eclipsed_by_the_moon's user avatar
11 votes
Accepted

How to merge two shapefiles with partial difference in QGIS?

You could use this approach Then to: Ensure the correct shapefile type is selected (points, lines, or polygons). Select the folder where the two (or more) shapefiles you want to merge are located ...
whyzar's user avatar
  • 12.1k
11 votes
Accepted

Merging drone/photogrammetry-derived DEM and satellite-derived DEM using ArcGIS Pro

Assuming: both are in the same projection / coordinate reference system, you have a Image/Spatial Analyst license, and NoData has been set correctly on the High res DEM. You could use a Raster ...
user2856's user avatar
  • 67.9k
10 votes

Merge two shapefiles in R

You can use raster::bind. That function combines the geometries and the attributes, even if the variable names do not match. Example data: library(raster) p <- shapefile(system.file("external/lux....
Robert Hijmans's user avatar
10 votes
Accepted

Merging overlapping buildings but not adjacent buildings using ArcMap?

Intersect the buildings with themselves Select By Location to only select buildings with overlaps: Dissolve the selected features Start editing on building and delete all selected features. Stop ...
Bera's user avatar
  • 76.4k
10 votes

Merging raster in R

The terra package has a new object class SpatRasterCollection for image collections than can be used with terra::mosaic or terra::merge. This greatly simplifies mosaic operations. Here is an example ...
Jeffrey Evans's user avatar
9 votes
Accepted

How to merge line and polygon?

Shapefiles can store only single type of geometry (in your case either polygons or lines, not both). So, a shapefile cannot contain both lines and polygons. Another thing is that a single feature ...
Alex Tereshenkov's user avatar
9 votes
Accepted

Merging small polygons into larger adjacent polygons using QGIS

you can use the processing tool "multiparts to singleparts" before: this will convert the multipolygon (the green one) into single polygons which you can join/merge afterwards.
eurojam's user avatar
  • 11.7k
9 votes

Merging multiple temporal inputs in QGIS Graphical Modeler

I'm on QGIS 3.18.2, array() works for me. Consider this model: You are on the right track with expression, in my case it looks like following the hint "Expected input: an array of layer paths, ....
Jochen Schwarze's user avatar
9 votes
Accepted

Performing merge in PostGIS

Use UNION or UNION ALL, depending on whether you want duplicates. Example: SELECT f1,f2,f3 FROM t1 UNION SELECT f1,f2,f3 FROM t2 Assuming the structure is exact across all three tables, the schema ...
Encomium's user avatar
  • 3,193
9 votes

Joining dangling end in the vector layer using QGIS

You can use "Snap Vertices to Nearest Points by Condition" Processing tool from ProcessX PlugIn. It is made for this purpose. Before running it, just extract the vertices of your lines via &...
MrXsquared's user avatar
  • 35.3k
8 votes

Finding and merging lines that touch in PostGIS?

Another option: use the PostGIS ST_LineMerge function. Here's the previous example redone with it: WITH data(geom) AS ( VALUES ('LINESTRING (0 0, 1 1)'), ('LINESTRING (2 2, 1 1)'),...
dr_jts's user avatar
  • 5,218
8 votes
Accepted

Merging two shapefiles using ArcPy?

You have too many closing parentheses in your code: arcpy.Merge_management(["o.shp", "d.shp"], "C:/GIS/m.shp")) ^ Remove the extra ) arcpy....
Midavalo's user avatar
  • 29.9k
8 votes

Rendering polygons ordered by size in QGIS

You need to use Union Tool from Vector -> Geoprocessing tools -> Union. This should give you the correct topology. Or, you can use difference tool repeatedly to get the difference between big ...
ahmadhanb's user avatar
  • 41.2k
8 votes

QGIS change geometry type in shapefile

From @Joseph comment : Right-click the layer and select Save As.... In the Layer Options section, there is a dropdown menu for SHPT. Select Polygon, this should re-save the polygon layer ...
gisnside's user avatar
  • 7,868
8 votes
Accepted

Merging lines (with and with no overlaps) in QGIS

@oskarlin, I tried to recreate a similar example of your layers. However, I do not know whether your Layers consist of line segments (polylines) or continuous lines (monolines), therefore there are ...
Taras's user avatar
  • 33.8k
8 votes

sf geometry column naming differences R

A way of renaming the geometry variable has been implemented in sf as explained in this issue. Thus in the previous example you just use this command: st_geometry(nc) <- "gyom"
Migue Lo's user avatar
  • 271
7 votes

Merging polygons based on five first digits in id using QGIS

If the field type is not string, then the simplest way is to create a new field with Text type of 5 characters length. Then in the field calculator go to Update existing field and select the newly ...
ahmadhanb's user avatar
  • 41.2k
7 votes
Accepted

Which value does raster merge chose in overlapping area?

If you're using the standard gdal_merge, later rasters overwrite earlier rasters (as in, the order they appear in the command line). From the usage document (emphasis mine) This utility will ...
Steven Kay's user avatar
  • 20.5k
7 votes
Accepted

How to overlap and merge layers in QGIS?

First use 'Symetrical Difference' instead of 'Intersection' in the Geoprocessing toolbox and then in a second step do 'Union'. The yellow triangle in 2. is spatially in the same location as in 1. ...
blabbath's user avatar
  • 975

Only top scored, non community-wiki answers of a minimum length are eligible