Skip to main content
27 votes
Accepted

How can I superimpose a geopandas dataframe on a raster plot?

For me it works if I pass the matplotlib ax object explicitly to rasterio.plot.show: fig, ax = plt.subplots(figsize=(15, 15)) rasterio.plot.show(raster, ax=ax) countries.plot(ax=ax, facecolor='none', ...
joris's user avatar
  • 3,933
24 votes
Accepted

equivalent of sp package's point in polygon / overing using sf

You can get the same result by using st_join: First create a demo polygon and some points with sf. library(sf) library(magrittr) poly <- st_as_sfc(c("POLYGON((0 0 , 0 1 , 1 1 , 1 0, 0 0))")) %>...
sebdalgarno's user avatar
  • 1,733
14 votes
Accepted

QGIS expression with overlay-fuction: filter-condition based on comparison of attributes from two layers

I tested some configurations, tried to understand how it works. So ! I figure it out. The scope of the filter parameter in the expression function of overlay_nearest is purely the layer set in the ...
J. Monticolo's user avatar
  • 15.9k
12 votes
Accepted

Changing blending of contour label to multiply

You can change the blend mode of the text buffer in label settings (see below). Multiply works best if the buffer colour is a dark colour. However, that won't achieve what you have in your ...
she_weeds's user avatar
  • 12.7k
10 votes
Accepted

Creating Radial Sector Overlay using QGIS

(Too long for a comment but thought this might be helpful in some way.) There is a plugin called Proportional circles which allows you create a legend broken into x number of segments (polygons) with ...
Joseph's user avatar
  • 76.1k
10 votes
Accepted

Averaging overlapping rasters with GDAL

The following approach worked pretty well. First I build virtual raster. gdalbuildvrt raster.vrt -srcnodata 0 -input_file_list paths.txt paths.txt is file with following content: a.tif b.tif Then ...
Владислав Мокроусов's user avatar
8 votes
Accepted

How to select polygons by points in R?

Think of the over function returning a query, now you have to do something with it. One easy approach is to pass an is.na() evaluation to a bracket index of the the SpatialPolygonsDataFrame object. ...
Jeffrey Evans's user avatar
8 votes
Accepted

Computing dominant area in polygon using ArcGIS Desktop?

INPUT: After dissolving zones use following WORKFLOW: arcpy.Intersect_analysis("GRID #;ZONE #","D:/Scratch.gdb/intersect") arcpy.Sort_management("intersect", "D:/Scratch.gdb/sorted","Shape_Area ...
FelixIP's user avatar
  • 23.2k
8 votes
Accepted

Performing polygon drilldown/overlay in PostGIS?

I think this works. It is a windowing function, getting the difference between the intersection of each geometries intersection with the query box and the union of the preceding geometries. The ...
Nicklas Avén's user avatar
8 votes
Accepted

Vector overlap analysis in QGIS

You can get pretty close with: Merge vector layers. It will merge the four layers into one with a column named layer with the name of the layer, for example A,B,C or D Union the merge with the merge ...
Bera's user avatar
  • 76.2k
7 votes

QGIS expression with overlay-fuction: filter-condition based on comparison of attributes from two layers

With QGIS 3.22.1 and 3.16.15 and newer versions, it will be possible to use a much simpler and more efficient expression to achieve the expected result: make_line( eval( 'overlay_nearest(\'...
Andrea Giudiceandrea's user avatar
7 votes

Overlaying image with polygon shapefile in QGIS

Create a new layer, draw a polygon covering your area Difference geoprocessing tool, with your polygon as input, and the blocks as Overlay. Set a dark grey or black symbol Now you have a polygon with ...
Bera's user avatar
  • 76.2k
7 votes
Accepted

Merging two shapefiles to show boundaries

What you want to do is set the fill color of your region to be transparent. That way it doesn't mess with the colors as you say because you are not changing the opacity of the entire symbology just ...
Kalak's user avatar
  • 3,919
6 votes

Computing dominant area in polygon using ArcGIS Desktop?

I attempted this with a test dataset. I'm using a geodatabase so that the area is calculated (recommended). If you must use a shapefile, calculate a field with geometry for the shape_area before you ...
jbchurchill's user avatar
  • 4,489
6 votes

Tile server overlay in Google Earth?

I created GEOS, the Google Earth Overlay Server for exactly this purpose. That's a python server running locally and creating KML overlays for tiled maps. You can specify custom mapsources in XML-...
Gregor Sturm's user avatar
6 votes

Overlaying re-projected points and polygons in R?

Try the commented and reproducible example below! I use the sf package because is much faster than rgdal to open Shapefiles. Also, I used the great package mapview for interactive visualization in R. ...
Guz's user avatar
  • 3,176
6 votes

equivalent of sp package's point in polygon / overing using sf

Instead of using st_join(pts, poly, join = st_intersects) you can just use st_intersection(pts, poly) It is faster, and gives only points that are inside the poly.
Jeppe Olsen's user avatar
6 votes

Calculating the distance between polygons and polygons (or polygons and lines) in QGIS

Since QGIS version 3.16, you have new overlay expressions you can use for this. For older versions see the refFunctions Plugin. I have a polygon layer with buildings (orange) and a street layer (blue),...
Babel's user avatar
  • 73.8k
6 votes
Accepted

Use field calculator to check for intersection

Let's presume you have a layer with polygons that contains an attribute "name": in the screenshot below, this name field has the values A, B, C, D, E and F (polygons are labeled). We further ...
Babel's user avatar
  • 73.8k
6 votes
Accepted

Getting all of combinations of features found on two layers using QGIS

You can use Intersection tool in "Processing Toolbox Ctrl+Alt+T > Vector overlay" for this. For example, I have two layers as below: After using Intersection tool, you get a new layer: ...
Kadir Şahbaz's user avatar
6 votes
Accepted

Create line from point to two polygon centroids that meet a condition

Try some thing like this. collect_geometries( array_foreach( array_slice( aggregate( layer:='target_polygon_layer', aggregate:='array_agg', ...
Mayo's user avatar
  • 4,042
5 votes

Performing polygon drilldown/overlay in PostGIS?

A bit of a different approach to this. There is a caveat that I don't know how it will scale performance wise, but on an indexed table it should be ok. It performs about the same as Nicklas's query (...
MickyT's user avatar
  • 3,430
5 votes
Accepted

Detecting automatically where rivers flow, directly into the sea or into another river

You can make an overlay (intersects/touches) of your river lines with a polygon representing the sea. Before you can do this, you need a polygon layer representing the sea. Best use data for the sea ...
Babel's user avatar
  • 73.8k
5 votes
Accepted

Buffer Polygons without overlapping regions of neighbouring boundaries in ArcGIS Pro

The simplest buffer would be a buffer ignoring state division along the coastal edge and this can be achieved with the buffer tool and setting the Dissolve Type parameter to Dissolve all output ...
Hornbydd's user avatar
  • 44.1k
5 votes
Accepted

QGIS expression - overlay function, using overlay function as filter

Not a very elegant way, but I think it will work. with_variable( 'maxval', array_max( overlay_intersects( 'point_layer', "id" ) ), ...
Mayo's user avatar
  • 4,042
4 votes
Accepted

Spatial Join for coregistered polygon data from different dates

If your polygon dataset is identical except for the measurements like you stated, you can use one of your files as a main layer and Join all other files to the main one. Once you joined all your files,...
Celik A's user avatar
  • 650
4 votes

Calculating proportional data for polygon by taking attributes from other polygon

A more automated way to accomplish this is first to run the Make Feature Layer tool on your block group data. In the Field Info section of this tool is a column called Use Ratio Policy. Check the box ...
Tim Ormsby's user avatar
4 votes

Rasters in R - merge taking mean, excluding NAs. Overlay and Mosaic both giving funny results

I think the problem with: water_mean_overlay <- do.call(overlay, c(water_rasters, fun = mean, na.rm = T)) is that na.rm=T is being passed to overlay, and the help for overlay doesn't show an na....
Spacedman's user avatar
  • 65.6k
4 votes
Accepted

Calculate overlay area - QGIS (Essen)

You just have to write $area instead of "field_name" = $area under Expression's panel
Hugo Roussaffa's user avatar
4 votes

Defining which layer (overlay) is displayed on Leaflet map?

It sounds like you want to designate just that overlay layer to be shown/active/displayed when you first load the map? You just need to add the layer to the map: var overlays = { "AL HOUDA ...
cmrRose's user avatar
  • 1,150

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