Skip to main content
47 votes

Filter by bounding box in GeoPandas

You can use the cx method on a geodataframe to select rows within a bounding box. For your example frames: xmin, ymin, xmax, ymax = df_sussex.total_bounds sac_sussex = df_sac.cx[xmin:xmax, ymin:ymax] ...
jdmcbr's user avatar
  • 904
28 votes

Displaying overlapping points in QGIS

Try renderers: "Point displacement" or "Point Cluster" from symbology menu. (QGIS 3.x required for point cluster.) As point displacement they can look like this for example: And ...
MrXsquared's user avatar
  • 34.5k
26 votes
Accepted

Check whether table has overlapping polygons, in PostGIS?

In the situation where you only need to know whether a table contains any overlapping polygons, and you're not concerned with the size or abundance of overlaps, I recommend a query of the following ...
dbaston's user avatar
  • 13.1k
22 votes

Refering to another layer with Field Calculator in QGIS

It can be done in Field Calculator with function aggregate(). In point layer create new field with field calculator expression like this: aggregate( layer:= 'polygon_layer_name', aggregate:='...
Oto Kaláb's user avatar
  • 6,915
20 votes
Accepted

Merging overlapping features using Geopandas?

The GeoDataFrame import geopandas as gpd g1 = gpd.GeoDataFrame.from_file("poly_intersect.shp") g1.shape (4, 3) 1) You can use the itertools module a) If you want to merge the intersections of the ...
gene's user avatar
  • 55k
20 votes

Counting points in polygons using QGIS

The tool you're looking for is now called "Count points in polygons", and it can be found in the QGIS's Processing Toolbox (Ctrl+Alt+T) under Vector analysis tools or can be also launched ...
HDunn's user avatar
  • 8,656
17 votes

Summing up values of overlapping polygons in QGIS

QGIS 3.2 Thanks to new Union tool in QGIS 3.2, this has become quite easy!!! What we do, is just use Union and Aggregate tools. (1) Union (Processing Toolbox | Vetor Overlay | Union) (2) We ...
Kazuhito's user avatar
  • 30.9k
15 votes
Accepted

Identifying polygons that intersect with another layer using QGIS

There is a possibility using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Let's assume we have three features in 'vegetation' (green) and four in 'treatment' ...
Taras's user avatar
  • 33k
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,245
14 votes

Joining attributes by the biggest overlapping areas in QGIS

Since QGIS 3.12 (see the Changelog for more details) the "Join Attributes by Location" algorithm from the Processing Toolbox (Ctrl+Alt+T) has a switch to do exactly this: The type of the ...
ndawson's user avatar
  • 27.7k
14 votes
Accepted

Removing overlaps and keeping highest priority polygon using PostGIS

Fortunately, with the prio dependency, this is easier to solve than a purely recursive difference aggregation. I'd prefer the LATERAL statement (here in full verbose mode), both for clarity of the ...
geozelot's user avatar
  • 30.3k
14 votes
Accepted

Correcting the geometry of overlapping polygons in the same layer in QGIS

First make sure your Buildings have a unique "id" (which does not contain a | character, you will see why below). You can add it for example via field calculator by adding a new field with ...
MrXsquared's user avatar
  • 34.5k
13 votes

Summing attribute values for areas where multiple polgons overlap using ArcGIS Desktop?

You can do this with 2 tools, Feature to Polygon and Spatial Join First, run your polygons through Feature to Polygon. Delete any of the attributes you don't need from the output (I still got them ...
Evil Genius's user avatar
  • 6,289
13 votes

Calculating percentage of overlap between two different layers using ArcMap

Add a new field to both layers to hold the original areas and call it Area Calculate the areas for all the polygons in each layer and put into the Area field Execute a union of layer 1 and layer 2 - ...
jbalk's user avatar
  • 7,583
13 votes

Show more than 6 labels for the same point using QGIS

Use Geometry Generator for full control of no. of labels and their placement By default, QGIS uses max. 8 different positions for label placement as established best practice in cartography is to have ...
Babel's user avatar
  • 71.6k
12 votes
Accepted

Removing overlapping part of polygons using QGIS?

You can use the 'Check Geometries' plugin (Vector/Geometry Tools/Check Geometries) to remove overlapping areas.
eclipsed_by_the_moon's user avatar
12 votes

Counting number of points per line in QGIS

You can use Join by location to join polyline with point shapefiles. However, the point should be exactly snapped to the line in order to be joined, otherwise, it is better to create a buffer of ...
ahmadhanb's user avatar
  • 40.9k
12 votes
Accepted

Fitting known size polygons into irregular polygons using ArcGIS Desktop?

It is very complicated task known as bin packing problem. The script below produces one of countless sub-optimal solutions. Algorithm: places fish net over rotated POLYGON to find out rotation angle ...
FelixIP's user avatar
  • 23.1k
12 votes

Calculating percentage of overlap of two layers in QGIS 3

Since QGIS 3.8, it's now included in QGIS core, without plugin or coding. In the Processing Toolbox, search for Overlap and open the Overlap analysis: Source: http://changelog.qgis.org/en/qgis/...
etrimaille's user avatar
  • 7,260
12 votes
Accepted

One-to-many spatial join with results in one row in QGIS

There is a possibility of using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Let's assume there are two polygon layers: 'Layer_A' (brown) and 'Layer_B' (...
Taras's user avatar
  • 33k
12 votes
Accepted

Getting attribute information of multiple polygon intersected by line using QGIS

Try this expression: array_to_string(overlay_intersects('Layer_A', name)) (assuming the City names are stored in name field in the 'Layer A').
Kazuhito's user avatar
  • 30.9k
12 votes

Dissolving polygons contained within the same larger polygon in QGIS

If you want to dissolve in-place: Start edit mode for the layer. Select the bounding and interior polygons Click "Merge selected features" button () in the Advanced digitizing Toolbar. ...
Kadir ┼×ahbaz's user avatar
11 votes

Calculating proportional area of polygon within another layer's polygon using QGIS

Take your model layer and in the attribute table, add a new field called area_mod for example. Note that there are two ways to generate area: $area is an ellipsoid based calculation using not just ...
SaultDon's user avatar
  • 10.4k
11 votes
Accepted

Filter by bounding box in GeoPandas

Issue is because you are using 'total_bounds' method. It only produces a tuple with max and min points of bounding box. Method to be used is 'envelope'; previous to build its respective 'GeoDataFrame'....
xunilk's user avatar
  • 30k
11 votes
Accepted

Looking for QGIS equivalent of ArcMap's "Selection by Location" tool with "Have their centroid in" option

There is no direct equivalent in Qgis core, but you can use the "Select Within" plugin, which should do exactly what you need (it adds an entry in the vector menu): Otherwise, you would need to ...
Leyan's user avatar
  • 831
11 votes

Deleting polygons within larger polygon in QGIS

Use Menu Vector / Geoprocessing Tools / Difference. Blue Polygon minus yellow polygons = polygon outlined in red:
Babel's user avatar
  • 71.6k
11 votes

Getting only the intersection part of self-intersecting polygons in QGIS

You can create a virtual layer. The query joins the layer to itself where two polygons intersect and their ids are different. And then calculates their intersection geometries. You need an id column ...
BERA's user avatar
  • 73.8k
10 votes
Accepted

Determining if two polygons are overlapping in Google Maps?

JSFiddle Example I've created a JSFiddle demonstrating a solution to your problem using the JavaScript Topology Suite (JSTS) (JSTS) library. Explaination There are two steps to this approach. The ...
elrobis's user avatar
  • 6,466
10 votes

Calculating percentage of overlap of two layers in QGIS 3

Using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... Let's assume there are two overlapping polygon layers called 'LayerA' (brown) and 'LayerB' (grey), see ...
Taras's user avatar
  • 33k

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