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', ...
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))")) %>...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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(\'...
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 ...
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 ...
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 ...
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-...
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. ...
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.
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),...
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 ...
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:
...
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',
...
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 (...
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 ...
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 ...
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"
)
),
...
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,...
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 ...
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....
4
votes
Accepted
Calculate overlay area - QGIS (Essen)
You just have to write $area instead of "field_name" = $area under Expression's panel
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
overlay × 498qgis × 113
arcgis-desktop × 85
raster × 84
r × 50
polygon × 36
leaflet × 35
shapefile × 34
coordinate-system × 30
python × 25
geopandas × 25
arcmap × 22
intersection × 22
overlapping-features × 22
openlayers-2 × 20
google-maps × 20
layers × 19
vector × 18
kml × 18
google-earth × 16
openlayers × 15
javascript × 13
spatial-analyst × 13
arcgis-pro × 12
buffer × 12