Vgrid
A unified framework for working with DGGS
Vgrid User Guide


Vgrid Introduction
Vgrid DGGS is a python package for working with popular geodesic DGGS and graticule-based DGGS.
Vgrid supports a wide range of popular geodesic DGGS, including H3, S2, A5, rHEALPix, Open-EAGGR ISEA4T, ISEA3H, DGGRID, DGGAL, EASE-DGGS, QTM, along with graticule-based DGGS such as OLC, Geohash, MGRS, GEOREF, TileCode, Quadkey, Maidenhead, and GARS.
Vgrid supports popular input and output GIS formats, including CSV, GeoJSON, Pandas/GeoPandas, Shapefile, GeoPackage, and GeoParquet.
The following Vgrid user guide is intended for use in a Command Line Interface (CLI) environment. Full Vgrid DGGS documentation is available at vgrid document.
To work with Vgrid DGGS directly in GeoPandas and Pandas, please use vgridpandas. Full Vgridpandas DGGS documentation is available at vgridpandas document
To work with Vgrid DGGS in QGIS, install the Vgrid Plugin.
To visualize DGGS in Maplibre GL JS, try the vgrid-maplibre library.
For an interactive demo, visit the Vgrid Homepage.
References:
Vgrid Installation
DGGS Conversion
Lat lon to DGGS
Convert lat, long in WGS84 CRS to DGGS cellID (H3, S2, A5, rHEALPix, OpenEaggr ISEA4T and ISEA3H, EASE-DGGS, QTM, OLC/ OpenLocationCode/ Google Plus Code, Geohash, GEOREF, MGRS, Tilecode, Quadkey, Maidenhead, GARS).
> latlon2h3 10.775276 106.706797 13
> latlon2s2 10.775276 106.706797 21
> latlon2a5 10.775276 106.706797 18
> latlon2rhealpix 10.775276 106.706797 14
> latlon2isea4t 10.775276 106.706797 21
> latlon2isea3h 10.775276 106.706797 27
> latlon2ease 10.775276 106.706797 6
> latlon2dggrid 10.775276 106.706797 FULLER4D 10
> latlon2qtm 10.775276 106.706797 11
> latlon2olc 10.775276 106.706797 11
> latlon2geohash 10.775276 106.706797 9
> latlon2georef 10.775276 106.706797 4
> latlon2mgrs 10.775276 106.706797 4
> latlon2tilecode 10.775276 106.706797 23
> latlon2quadkey 10.775276 106.706797 23
> latlon2maidenhead 10.775276 106.706797 4
> latlon2gars 10.775276 106.706797 1
DGGS to GeoJSON
Convert DGGS cell IDs to GeoJSON.
> h32geojson 8d65b56628e46bf
> s22geojson 31752f45cc94
> a52geojson 8e65b56628e0d07
> rhealpix2geojson R31260335553825
> isea4t2geojson 13102313331320133331133
> isea3h2geojson 1327916769,-55086
> ease2geojson L6.165767.02.02.22.45.63.05
> dggrid2geojson 8478420 FULLER4D 10
> qtm2geojson 42012323131
> olc2geojson 7P28QPG4+4P7
> geohash2geojson w3gvk1td8
> mgrs2geojson 34TGK56063228
> gzd
> tilecode2geojson z23x6680749y3941729
> quadkey2geojson 13223011131020212310000
> maidenhead2geojson OK30is46
> gars2geojson 574JK1918
{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[106.70789209957029, 10.77601109480422], [106.70745212203926, 10.777918172217145], [106.7055792173179, 10.778494886227104], [106.70414629547702, 10.777164500398262], [106.70458630070586, 10.775257408234628], [106.70645920007833, 10.774680716650128], [106.70789209957029, 10.77601109480422]]]}, "properties": {"h3": "8965b56628fffff", "resolution": 9, "center_lat": 10.7765878, "center_lon": 106.7060192, "avg_edge_len": 215.295, "cell_area": 120421.396}}]}
Vector to DGGS
Convert Vector layers (Point/ Multipoint, Linestring/ Multilinestring, polygon/ Multipolygon) in GeoJSON to DGGS.
> geojson2h3 -r 11 -geojson polygon.geojson
> geojson2s2 -r 18 -geojson polygon.geojson -compact
> geojson2a5 -r 18 -geojson polygon.geojson -compact
> geojson2rhealpix -r 11 -geojson polygon.geojson
> geojson2isea4t -r 17 -geojson polygon.geojson
> geojson2isea3h -r 18 -geojson polygon.geojson
> geojson2ease -r 4 -geojson polygon.geojson
> geojson2dggrid -t ISEA4H -r 17 -geojson polyline.geojson
> geojson2qtm -r 18 -geojson polygon.geojson
> geojson2olc -r 10 -geojson polygon.geojson
> geojson2geohash -r 7 -geojson polygon.geojson
> geojson2mgrs -r 3 -geojson polygon.geojson
> geojson2tilecode -r 18 -geojson polygon.geojson
> geojson2quadkey -r 18 -geojson polygon.geojson
DGGS Compact
> h3compact -geojson h3.geojson -cellid h3
> s2compact -geojson s2.geojson -cellid s2
> a5compact -geojson a5.geojson -cellid a5
> rhealpixcompact -geojson rhealpix.geojson -cellid rhealpix
> isea4tcompact -geojson isea4t.geojson -cellid isea4t
> isea3hcompact -geojson isea3h.geojson -cellid isea3h
> easecompact -geojson ease.geojson -cellid ease
> qtmcompact -geojson qtm.geojson -cellid qtm
> olccompact -geojson olc.geojson -cellid olc
> geohashcompact -geojson geohash.geojson -cellid geohash
> tilecodecompact -geojson tilecode.geojson -cellid tilecode
> quadkeycompact -geojson quadkey.geojson -cellid quadkey
DGGS Expand
> h3expand -geojson h3_11.geojson -r 12 -cellid h3
> s2expand -geojson s2_18.geojson -r 19 -cellid s2
> a5expand -geojson a5_18.geojson -r 19 -cellid a5
> rhealpixexpand -geojson rhealpix_10.geojson -r 11 -cellid rhealpix
> isea4texpand -geojson isea4t_18.geojson -r 19 -cellid isea4t
> isea3hexpand -geojson isea3h_18.geojson -r 19 -cellid isea3h
> easeexpand -geojson ease_4.geojson -r 5 -cellid ease
> qtmexpand -geojson qtm_18.geojson -r 19 -cellid qtm
> olcexpand -geojson olc_8.geojson -r 10 -cellid olc
> geohashexpand -geojson geohash_7.geojson -r 8 -cellid geohash
> tilecodeexpand -geojson tilecode_18.geojson -r 19 -cellid tilecode
> quadkeyexpand -geojson quadkey_18.geojson -r 19 -cellid quadkey
DGGS Binning
Binning point layer to DGGS
> h3bin -point point.geojson -r 8 -stats count -field numeric_field -category group
> s2bin -point point.geojson -r 13 -stats count -field numeric_field -category group
> a5bin -point point.geojson -r 18 -stats count -field numeric_field -category group
> rhealpixbin -point point.geojson -r 8 -stats count -field numeric_field -category group
> isea4tbin -point point.geojson -r 13 -stats count -field numeric_field -category group
> qtmbin -point point.geojson -r 13 -stats count -field numeric_field -category group
> olcbin -point point.geojson -r 9 -stats count -field numeric_field -category group
> geohashbin -point point.geojson -r 6 -stats count -field numeric_field -category group
> tilecodebin -point point.geojson -r 15 -stats count -field numeric_field -category group
> quadkeybin -point point.geojson -r 13 -stats count -field numeric_field -category group
Raster to DGGS
Convert raster layers in geographic CRS to output DGGS with closest matching resolution.
> raster2h3 -raster raster.tif
> raster2s2 -raster raster.tif
> raster2a5 -raster raster.tif
> raster2rhealpix -raster raster.tif
> raster2isea4t -raster raster.tif
> raster2qtm -raster raster.tif
> raster2olc -raster raster.tif
> raster2geohash -raster raster.tif
> raster2tilecode -raster raster.tif
> raster2quadkey -raster raster.tif
DGGS Generator
Generate DGGS at a specific resolution within a bounding box
> h3grid -r 11 -b 106.699007 10.762811 106.717674 10.778649
> s2grid -r 18 -b 106.699007 10.762811 106.717674 10.778649
> a5grid -r 18 -b 106.699007 10.762811 106.717674 10.778649
> rhealpixgrid -r 11 -b 106.699007 10.762811 106.717674 10.778649
> isea4tgrid -r 17 -b 106.699007 10.762811 106.717674 10.778649
> isea3hgrid -r 20 -b 106.699007 10.762811 106.717674 10.778649
> easegrid -r 4 -b 106.6990073571 10.7628112647 106.71767427 10.778649620
> dggridgen -t ISEA3H -r 2 -a ZORDER
> qtmgrid -r 8 -b 106.6990073571 10.7628112647 106.71767427 10.778649620
> olcgrid -r 8 -b 106.6990073571 10.7628112647 106.71767427 10.778649620
> geohashgrid -r 6 -b 106.699007 10.762811 106.717674 10.778649
> geohashgrid -r 2 -b 106.699007 10.762811 106.717674 10.778649
> mgrsgrid -r 1 -gzd 48P
> tilecodegrid -r 20 -b 106.699007 10.762811 106.717674 10.778649
> quadkeygrid -r 20 -b 106.699007 10.762811 106.717674 10.778649
> maidenheadgrid -r 4 -b 106.699007 10.762811 106.717674 10.778649
> garsgrid -r 1 -b 106.699007 10.762811 106.717674 10.778649
DGGS INSPECT
> h3inspect -r 3
> s2inspect -r 6
> a5inspect -r 5
> rhealpixinspect -r 4
> isea4tinspect -r 5
> isea3hinspect -r 3
> easeinspect -r 0
> qtminspect -r 6
> olcinspect -r 4
> geohashinspect -r 3
> georeftats -r 1
> tilecodeinspect -r 7
> quadkeyinspect -r 7
> maidenheadinspect -r 2
> garsinspect -r 1
> dggridinspect -t ISEA4T -r 3
Distribution of DGGS Area Distortions visualized from DGGS Inspect
Visualization of DGGS IPQ Compactness visualized from DGGS Inspect
DGGS Stats
> h3stats
> s2stats
> a5stats
> rhealpixstats
> isea4tstats
> isea3hstats
> dggridstats -t FULLER3H -r 8
> easestats
> qtmstats
> olcstats
> geohashstats
> georeftats
> mgrstats
> tilecodestats
> quadkeystats
> maidenheadstats
> garsstats
POLYHEDRA GENERATOR
> tetrahedron
> cube
> octahedron
> fuller_icosahedron
> rhombic_icosahedron