15
votes
Snapping a point to a unique hexagon in QGIS
You can try the script below.
Note: Before you do anything else, please make a backup copy of your point layer file in case of unexpected or undesired results (don't just duplicate the layer in the ...
10
votes
Accepted
Seeking shapefile of hexagons that covers world?
Uber has recently developed H3, which is a geospatial indexing system using multiple hexagonal grids of different sizes organized hierarchically.
There is an R package called h3r that makes it easy ...
9
votes
Accepted
Creating nested hex grids in QGIS
Step 1. Create a grid with the "Create grid" geoalgorithm
Step 2. Use the "Geometry by expression" from the Processing Toolbox (Ctrl+Alt+T).
With the following expression:
...
9
votes
Snapping a point to a unique hexagon in QGIS
You can use the following script. It creates a new layer for the relocated points.
# h: hexagon, p: point
h_lyr = QgsProject.instance().mapLayersByName("Hexagons")[0]
p_lyr = QgsProject....
6
votes
Creating nested hex grids in QGIS
Create an hexagonal grid then add some centroid fill using hexagonal symbol. you may control the colour of each symbol by using data override on each symbol.
Edit :
If you don't have hexagon symbol ...
6
votes
Calculate distance from centroid to border of polygon
On the centroid layer, you can use the following expression with Field calculator to caclulate the distance from the centroids of the hexagon to the closest point of the nearest feature on the layer ...
6
votes
Accepted
Creating geodesic hexagonal global grid in QGIS?
The dggridR R package "builds discrete global grids which partition the surface of the Earth into hexagonal, triangular, or diamond cells, all of which have the same size."
Richard Barnes (2017). ...
5
votes
Accepted
How to Create a Custom-shaped Fishnet Grid in QGIS
So, here is my suggestion, if I understood you correctly, proceed as follows,
i.e. it is a technique that can be automated:
Input data are hexagons fig. 1
Vector>Processing geometry>Point ...
4
votes
Accepted
Points in Polygon missing from QGIS 2.16.x?
You can find it in the Processing > Toolbox > search for Count Points in Polygon
Not sure why it's missing from the Vector menu...
3
votes
Accepted
Leaflet artifact on GeoJSON hexgrid without borders at zoom 10
It seems like some kind of a bug. I didn't go into details why this happens, just found a workaround with modifying style.
Instead of stroke weight 0, it gets weight 1. Since polygons overlap, this ...
3
votes
Generate Tessellations looping through all shapefiles from folder in ArcGIS Pro ModelBuilder?
If you read the help file syntax section for Generate Tessellation its second parameter is Extent and its data type is Extent.
The output of your iterator is a FEATURECLASS, hopefully you'll agree ...
3
votes
Accepted
Generate Tessellations looping through all shapefiles from folder in ArcGIS Pro ModelBuilder?
You can use arcpy as an alternative to ModelBuilder:
import arcpy, os
input_workspace = r'C:\Test\Inputshapes' #Change, can also be a file geodatabase, if so add .gdb
output_workspace = r'C:\Test\...
3
votes
Accepted
Failing to create a grid with hexagonal units
These are the grid extent values you used:
xmin: -11.3
xmax: -6.7
ymin: 35.8
ymax: 38.6
These look like decimal degree values (ie, latitude and longitude). However, the selected coordinate system (...
3
votes
Creating geodesic hexagonal global grid in QGIS?
You could take a look at AntiPrism. I've not tried this myself yet, but it looks like it can generate do various types of Geodesic grids.
There seem to be various output formats, wavefront OBJ and ...
3
votes
Seeking shapefile of hexagons that covers world?
Note that it is impossible to partition a sphere into hexagons only; such a partition must contain some non-hexagonal cells. For example, every resolution of Uber's H3 contains exactly 12 pentagons ...
2
votes
How to snap a road network to a hexagonal grid in QGIS?
The geometry snapper in qgis 3.0 has been reworked and now allows snapping between different geometry types. It also has lots of fixes. You could try a "daily snapshot" version to get access to the ...
2
votes
Accepted
'st_touches' from 'sf' R package does not return all boundaries
You probably need to set the precision of the coordinates to a non-zero value before you call st_touches. Read the documentation of st_set_precision.
2
votes
Creating nested hex grids in QGIS
Whilst @Taras has provided a great answer , I wanted to share another solution I came across - the "Shape Tools" plugin.
Not only could I edit the shape of my hexes, but I could also rotate ...
2
votes
Accepted
Creating Density Map using Hexagonal Grids in QGIS
This was really an easy solution. I had to do spatial join with the hexagon grid layer and polygon layer (which had the residential density data). The tool join attributes by location is used.
2
votes
Accepted
Transforming admin units into hexagons: the assignment problem
I finally solved it by using another implementation of the Hungarian algorithm that completes even on larger datasets. Here's the full function:
generateHexBins <- function( sdf, grid_type='...
2
votes
Accepted
Creating hexagons around polygon using sf
For Q1 (a) (why is sp/sf different?) the difference is just down to however the algorithm decides to start its hexagonal grid (either in points for spsample or polys for st_make_grid). For Q1 (b) (...
1
vote
Accepted
Divide spatial hexagon in equal areas (pies) in r
A hexagon may be divided in three equal parts by intersecting it with a same sized hexagon that has been displaced the length of the side (consecutive vertices); conveniently this can be queried with ...
1
vote
GeoServer hexagonal grid?
GeoServer does not have a hex binning functionality yet (it can be implemented, given enough dev resources).
Last time I had to do hex binning on the cheap, I delegated everything to PostGIS using a ...
1
vote
Creating Hexagon Grid over streets using PostGIS
Indeed, I ended up doing this
WITH baseStreet AS (
SELECT
ST_Union(
ST_Buffer(geom , 20, 'endcap=round join=round')
) AS geom
FROM all_streets
), bbox AS (
...
1
vote
Accepted
Hexbins missing points, layer extent problem in graphical modeler?
Add a buffer around the extent of your point layer to really cover all points with the hexagon grid.
The very shape of hexagons leads to the fact that not every column reaches up to the max. extent. ...
1
vote
Creating Hexagon from centroids of polygons using ArcMap
You should always check out the code sharing website on the Esri website, there are many tools shared by the user community for free. One such tool is a tool for generating hexagons from points.
1
vote
Distorted h3 hexagons using h3js with Mapbox
Something is definitely off there - while H3 hexagons do have some distortion in various parts of the globe, and while this distortion is further distorted at extreme latitudes when rendered in a ...
1
vote
Accepted
Generating statistics from line and hex grid in ArcGIS Pro?
Input:
Workflow that will handle overlaps:
arcpy.Intersect_analysis("LINES #;POLYGONS #", "./intersect.shp")
arcpy.DeleteIdentical_management("intersect", "LINE_ID;PGON_ID")
arcpy....
1
vote
Finding toolbox in Geoprocessing Package (GPK)?
The GPK file is a Geoprocessing package.
There are instructions on how to unpack it to find any contained toolboxes at Using a geoprocessing package:
When you open a geoprocessing package, the ...
1
vote
Hexabin map from multiple polygon layer
Thank you for help.
I have to say that I am not that confortable with python language... So I had to tought of a diferent aproach:
1) INTERSECTed my Hexagonal grid with my polygons
2) Then I used ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
hexagonal-grid × 50qgis × 17
hexagon-binning × 9
arcgis-desktop × 8
r × 6
arcgis-pro × 5
python × 4
sf × 4
mmqgis × 4
h3 × 4
arcmap × 3
pyqgis × 3
qgis-3 × 3
vector-grid × 3
postgis × 2
polygon × 2
geojson × 2
modelbuilder × 2
cartography × 2
qgis-2 × 2
grids-graticules × 2
snapping × 2
sp × 2
density × 2
dggs × 2