Skip to main content
12 votes

Counting adjacent polygons using QGIS

Using the field calculator, you can use array_length( overlay_intersects( @layer,"")) to identify and count the intersecting geometries
JGH's user avatar
  • 43.4k
8 votes
Accepted

Creating list of adjacent polygons in QGIS

You can use SQL and join the layer to itself based on a maximum distance and where the ids are different (to prevent joining polygons to themselves). Change mylayer to the name of your layer, and 30 ...
Bera's user avatar
  • 77.9k
7 votes
Accepted

How do I merge/dissolve two polygons within one shapefile in QGIS?

It's a little tricky given that the dissolve/union simply extracts separate shapefile. Here is how you could do that: STEP 1: In the menu item go to: VIEW>TOOLBAR, and then toggle on "Advanced ...
hillsonghimire's user avatar
7 votes

Creating list of adjacent polygons in QGIS

To complete the answers given so far: you can also use the field calculator to get a list of neighbours, with the expression: array_to_string( overlay_nearest( layer:='polygons', ...
eurojam's user avatar
  • 11.9k
6 votes

Determining if polygon not enclosed by other polygons

Assuming your polygons are topologically correct (no gaps, or overlaps), then a polygon A is enclosed by other polygons if its perimeter is equal to the sum of intersection length between its ...
dbaston's user avatar
  • 13.2k
6 votes
Accepted

Make line from each polygon centroid to each adjacent polygon centroid in QGIS

Use this expression: collect_geometries( array_foreach( overlay_intersects (@layer, centroid ($geometry)), make_line (centroid($geometry), @element) ) )
Babel's user avatar
  • 75k
5 votes

Dissolve (merge) polygons QGIS based on attribute values only when are adjacent

Option one: Merge features only when they belong to the same country. The Dissolve tool allows you to select more than one attribute as the Dissolve field. Use these two fields for the Dissolve field:...
csk's user avatar
  • 25.1k
5 votes

How to find neighboring polygons which share a common feature in ArcMap 10.4?

This can be done in ModelBuilder as you have asked to automate this. Use a feature selection iterator to iterate over your regions. Output of that feeds into a select by location tool to select your ...
Hornbydd's user avatar
  • 44.6k
5 votes
Accepted

Are contiguity matrix and adjacency matrix the same?

Yes. An online comparer has this for "contiguous": The state of being adjacent or contiguous; contiguity; as, the adjacency of lands or buildings. I'd say "adjacent" was the ...
Spacedman's user avatar
  • 66.5k
5 votes
Accepted

Counting adjacent polygons using QGIS

The suggestion provided by @JGH is good but will only work in some instances, I'd suggest you to use nearest with an upper limit and a safe maximum distance. In my example below I used array_length(...
Al rl's user avatar
  • 682
4 votes

how to remove small water bodies in binary mask array that we get from ndwi values?

You can use gdal_sieve to remove small areas of noise. From the documentation: gdal_sieve.py script removes raster polygons smaller than a provided threshold size (in pixels) and replaces them with ...
JonasV's user avatar
  • 3,794
4 votes
Accepted

Merging polygons that share one vertex (node neighbors) using ArcGIS Desktop?

Suggestion in my comments "Convert back to integer raster, region group, to polygons, dissolve to multipart" will work for polygons derived from rasters. However in general it's better to start with ...
FelixIP's user avatar
  • 23.3k
4 votes

Why do clipped polygon features (clipped with adjacent polygon tiles) still overlap with each other?

I can't say how to correct the topology automatically but these images should show what happens. These are the vertices of the left side polygon (clipped1) and the location of the overlap. These are ...
user30184's user avatar
  • 69.2k
4 votes
Accepted

Filtering polygons that share more than 2 vertices using QGIS

You can achieve this using a virtual layer. It would select polygons from the layer where they intersect the source layer, then only for these, it would compute the intersection and if there is more ...
JGH's user avatar
  • 43.4k
3 votes

Ordering polygon neighbors in clockwise order using ArcMap

This workflow will create mid points of edges between polygons and delete outer ones called "LINKS": arcpy.FeatureToLine_management(in_features="PGONS", out_feature_class="C:/...
FelixIP's user avatar
  • 23.3k
3 votes

Simplifying adjacent polygons on subset of vertices only

I hope that I understood your question correctly. Let's assume there one layer "polygons" with its corresponding attribute table accordingly, see image below. And of course there are some ...
Taras's user avatar
  • 34.1k
3 votes

Determining if polygon not enclosed by other polygons

I have an answer that should be logically correct but the SQL part is not complete. The idea is based on intersections of adjacent polygons. The intesections are either lines if polygons share segment(...
user30184's user avatar
  • 69.2k
3 votes

Identifying/exporting adjacent polygons in ArcGIS Desktop?

An approach is: select the polygons with your agricultural data (e.g counties where wheat is only grown). You would do that with your select by attribute tool. Then run the select by location tool ...
Hornbydd's user avatar
  • 44.6k
3 votes
Accepted

Merging adjacent polygons in QGIS

You could ask the dissolve tool which you can select through the Vector tab, then Geoprocessing tools. Then select the dissolve tool to open and input the dataset You could also refer to QGIS ...
whyzar's user avatar
  • 12.1k
2 votes
Accepted

Counting polygon neighbours and writing to table using PyQGIS?

The script from the linked website writes not the number of neighboring polygons but the summed up value for an attribute from the layer (e.g. the total population for all neighboring countries) to ...
tallistroan's user avatar
  • 2,351
2 votes
Accepted

Using Polygon Neighbors for boundary polygons to find boundary lengths in ArcMap?

The trick here is counting number of neighbors that share polygon edges. Workflow for that using spatial join one to many: arcpy.Integrate_management(in_features="COUNTIES #", cluster_tolerance="0.01 ...
FelixIP's user avatar
  • 23.3k
2 votes

Simplifying adjacent polygons using PostGIS?

As of PostGIS 3.4.0, there is a dedicated function which does exactly this: ST_CoverageSimplify(geometry winset geom, float8 tolerance, boolean simplifyBoundary = true) ST_CoverageSimplify docs ...
Leon Powałka's user avatar
2 votes

Identifying shared polygon boundaries in ArcGIS Desktop

To do this I would use the Polygon Neighbors tool which (with my bolding): Creates a table with statistics based on polygon contiguity (overlaps, coincident edges, or nodes).
PolyGeo's user avatar
  • 65.4k
1 vote

ArcGIS Pro matching and dissolving neighbours

Without seeing the full dataset and understanding the topological relationships within your data we only have your isolated block of touching polygons to go by. What we don't know is the nature of ...
Hornbydd's user avatar
  • 44.6k
1 vote

Why do clipped polygon features (clipped with adjacent polygon tiles) still overlap with each other?

So, your raw data in text format is shown below: P1 MULTIPOLYGON((( 20.0857554080356 49.1905790194619, 20.0887585780746 49.1908207752517, 20.0913701395045 49.1907900830797, 20.0919317359928 49....
Cyril Mikhalchenko's user avatar
1 vote

Polygon Neighbors tool produces incorrect results

This is what tool does if you uncheck "Include both sides" option: So if you'll decide to compute number of neighbors by counting frequency of src_OBJECTID, you'll end up with very few (...
FelixIP's user avatar
  • 23.3k
1 vote

Identifying shared polygon boundaries in ArcGIS Desktop

For example Intersect with Polygon inputs and line output: Then you can Select By Location to select the polygons that intersect the intersect lines.
Bera's user avatar
  • 77.9k
1 vote

Simplifying adjacent polygons on subset of vertices only

The job can be done with OpenJUMP but the method is generic and any software can be used. What matters is that the software must be able to create a planar graph and build polygons from closed areas ...
user30184's user avatar
  • 69.2k
1 vote

Simplifying adjacent polygons on subset of vertices only

Clarification - if you do not have an "id" field in your table, create it and use it to identify the right and left (upper and lower) adjacent polygons. One of the ways to solve this ...
Cyril Mikhalchenko's user avatar
1 vote
Accepted

Checking if selected features are adjacent using OpenLayers

Using turf.js#intersect method you can find out if two features share a border. from their docs: Takes two polygons and finds their intersection. If they share a border, returns the border; if ...
orpheus's user avatar
  • 201

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