Hot answers tagged

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
  • 63k
16 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
  • 62.5k
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
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,409
14 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
  • 283
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.4k
14 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,225
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
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,261
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
12 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
11 votes
Accepted

Alternative to 'Editors Merge' feature using ArcPy

You could use the arcpy.Geometry() object's .union() method: >>> g1, g2 = [f[0] for f in arcpy.da.SearchCursor("BufferedPoints","SHAPE@")] >>> g1 <Polygon object at 0x1929f830[...
Alex Tereshenkov'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
  • 12k
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
  • 64.8k
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
  • 68.7k
9 votes

Loading multiple shapefiles from +1000 subfolders

The good news is you can achieve this without 'learning' Python coding. The bad news is, you still need to use Python code! Open a fresh instance of ArcMap, go to the Geoprocessing menu and select ...
Adam's user avatar
  • 1,383
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
  • 9,799
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,083
8 votes

Finding and merging lines that touch in PostGIS?

You could avoid the need for a recursive query by taking the following approach: From each input LineString, extract the endpoints into a two-point MultiPoint Run ST_ClusterWithin on the extracted ...
dbaston's user avatar
  • 13k
8 votes
Accepted

Merging .asc files = "The command line is too long"

This is a pretty long standing problem with the gdal_merge tool accessed through the user interface. The easiest way to get around it is to first build a virtual raster (VRT) file and then (if ...
Ed Rollason's user avatar
  • 3,868
8 votes

Merging tif images into a single GeoTiff with QGIS

The tutorial in the answer posted by Venug uses the Raster > Miscellaneous > Merge functionality. What I don't like about that method is that it requires you to find the files you want to merge in ...
rudivonstaden's user avatar
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.6k
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
  • 40.4k
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,798
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
  • 31.3k
8 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
7 votes
Accepted

Optimizing arcpy.da.Walk performance?

I agree with @Paul above - the best way to optimise this code is to ensure that it never runs. If you're happy to install third party packages I'd also take a look at the the formic package, which is ...
om_henners's user avatar
  • 15.6k

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