Skip to main content
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 ...
Ben W's user avatar
  • 23.1k
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 ...
rafa.pereira's user avatar
  • 1,277
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: ...
Taras's user avatar
  • 34k
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....
Kadir Şahbaz's user avatar
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 ...
J.R's user avatar
  • 17.4k
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 ...
Babel's user avatar
  • 74.9k
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). ...
Marco's user avatar
  • 3,260
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 ...
Cyril Mikhalchenko's user avatar
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...
Inactivated Account's user avatar
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 ...
TomazicM's user avatar
  • 27k
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 ...
Hornbydd's user avatar
  • 44.6k
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\...
Bera's user avatar
  • 77.8k
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 (...
csk's user avatar
  • 25.1k
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 ...
Steven Kay's user avatar
  • 20.6k
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 ...
ksahr's user avatar
  • 31
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 ...
ndawson's user avatar
  • 27.9k
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.
Edzer Pebesma's user avatar
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 ...
Matt Houston's user avatar
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.
Padmanabha's user avatar
  • 1,412
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='...
Strabonio's user avatar
  • 251
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) (...
Spacedman's user avatar
  • 66.5k
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 ...
Elio Diaz's user avatar
  • 3,528
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 ...
Andrea Aime's user avatar
  • 17.7k
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 ( ...
four-eyes's user avatar
  • 3,440
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. ...
Babel's user avatar
  • 74.9k
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.
Hornbydd's user avatar
  • 44.6k
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 ...
nrabinowitz's user avatar
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....
FelixIP's user avatar
  • 23.3k
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 ...
PolyGeo's user avatar
  • 65.4k
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 ...
M_M's user avatar
  • 323

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