Conversion Module¶
The conversion module provides comprehensive functions to convert between different coordinate systems, geographic data formats, and discrete global grid systems (DGGS).
Overview¶
The conversion module supports multiple types of conversions:
- Latitude/Longitude to DGGS: Convert lat/lon coordinates to various DGGS cell IDs
- DGGS to GeoJSON: Convert DGGS cell IDs to GeoJSON features
- Vector to DGGS: Convert vector geometries to DGGS cells
- DGGS Compact: Compact/ Expand DGGS cells
- Raster to DGGS: Convert raster data to DGGS cells
- DGGAL Conversions: Use the external
dgg
CLI to convert DGGAL ZoneIDs and lat/lon
Supported DGGS Systems¶
The module supports the following discrete global grid systems:
- H3: Uber's hexagonal hierarchical geospatial indexing system
- S2: Google's spherical geometry library
- A5: Pentagonal DGGS
- RHEALPix: Equal-area hierarchical triangular mesh
- ISEA4T: Icosahedral Snyder Equal Area Aperture 4 Triangle
- ISEA3H: Icosahedral Snyder Equal Area Aperture 3 Hexagon
- EASE: Equal-Area Scalable Earth Grid
- QTM: Quaternary Triangular Mesh
- OLC: Open Location Code (Plus Codes)
- Geohash: Hierarchical spatial data structure
- GEOREF: World Geographic Reference System
- MGRS: Military Grid Reference System
- Tilecode: Hierarchical tiling system
- Quadkey: Microsoft's hierarchical spatial index
- Maidenhead: Amateur radio grid square system
- GARS: Global Area Reference System
- DGGAL: External DGGS family accessed via the
dgg
CLI (e.g., GNOSIS, ISEA3H/9R, IVEA3H/9R, RTEA3H/9R, RHEALPix)
DGGAL Usage¶
Lat/Lon to DGGAL ZoneID¶
1 2 3 4 |
|
DGGAL ZoneID to GeoJSON¶
1 2 3 4 |
|
Conversion module for vgrid.
This module provides functions to convert between different coordinate systems, geographic data formats, and discrete global grid systems (DGGS).
a5compact(input_data, a5_hex=None, output_format='gpd')
¶
Compact A5 cells. Flexible input/output format. input_data: file path, URL, dict, GeoDataFrame, or list of cell IDs output_format: None, 'csv', 'geojson', 'shapefile', 'gpd', 'geojson_dict', 'gpkg', 'geoparquet' Output is always written to the current directory if file-based.
Source code in vgrid/conversion/dggscompact/a5compact.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
a5expand(input_data, resolution, a5_hex=None, output_format='gpd')
¶
Expand (uncompact) A5 cells to a target resolution. Flexible input/output format. input_data: file path, URL, dict, GeoDataFrame, or list of cell IDs resolution: target A5 resolution (int) output_format: None, 'csv', 'geojson', 'shapefile', 'gpd', 'geojson_dict', 'gpkg', 'parquet', 'geoparquet' Output is always written to the current directory if file-based.
Source code in vgrid/conversion/dggscompact/a5compact.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
easecompact(input_data, ease_id=None, output_format='gpd')
¶
Compact EASE cells from input data.
Source code in vgrid/conversion/dggscompact/easecompact.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
easeexpand(input_data, resolution, ease_id=None, output_format='gpd')
¶
Expand EASE cells to a target resolution.
Source code in vgrid/conversion/dggscompact/easecompact.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|
geohashcompact(input_data, geohash_id=None, output_format='gpd')
¶
Compact Geohash cells from input data.
Source code in vgrid/conversion/dggscompact/geohashcompact.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
geohashexpand(input_data, resolution, geohash_id=None, output_format='gpd')
¶
Expand Geohash cells to a target resolution.
Source code in vgrid/conversion/dggscompact/geohashcompact.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
h3compact(input_data, h3_id=None, output_format='gpd')
¶
Compact H3 cells. Flexible input/output format. input_data: file path, URL, dict, GeoDataFrame, or list of cell IDs output_format: None, 'csv', 'geojson', 'shapefile', 'gpd', 'geojson_dict', 'gpkg', 'geoparquet' Output is always written to the current directory if file-based.
Source code in vgrid/conversion/dggscompact/h3compact.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
h3expand(input_data, resolution, h3_id=None, output_format='gpd')
¶
Expand (uncompact) H3 cells to a target resolution. Flexible input/output format. input_data: file path, URL, dict, GeoDataFrame, or list of cell IDs resolution: target H3 resolution (int) output_format: None, 'csv', 'geojson', 'shapefile', 'gpd', 'geojson_dict', 'gpkg', 'parquet', 'geoparquet' Output is always written to the current directory if file-based.
Source code in vgrid/conversion/dggscompact/h3compact.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
isea3hcompact(input_data, isea3h_id=None, output_format='gpd')
¶
Compact ISEA3H cells from input data.
Source code in vgrid/conversion/dggscompact/isea3hcompact.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
isea3hexpand(input_data, resolution, isea3h_id=None, output_format='gpd')
¶
Expand ISEA3H cells to a target resolution.
Source code in vgrid/conversion/dggscompact/isea3hcompact.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
|
olccompact(input_data, olc_id=None, output_format='gpd')
¶
Compact OLC cells from input data.
Source code in vgrid/conversion/dggscompact/olccompact.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
qtmcompact(input_data, qtm_id='qtm', output_format='gpd')
¶
Compact QTM cells from input data.
Source code in vgrid/conversion/dggscompact/qtmcompact.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
qtmexpand(input_data, resolution, qtm_id='qtm', output_format='gpd')
¶
Expand QTM cells to a target resolution.
Source code in vgrid/conversion/dggscompact/qtmcompact.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
quadkeycompact(input_data, quadkey_id='quadkey', output_format='gpd')
¶
Compact Quadkey cells from input data.
Source code in vgrid/conversion/dggscompact/quadkeycompact.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
quadkeyexpand(input_data, resolution, quadkey_id='quadkey', output_format='gpd')
¶
Expand Quadkey cells to a target resolution.
Source code in vgrid/conversion/dggscompact/quadkeycompact.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
raster2dggal(raster_path, dggs_type, resolution=None, output_format='gpd')
¶
Convert raster data to DGGAL grid cells for a given type and resolution.
- raster_path: path to raster in geographic CRS (EPSG:4326)
- dggs_type: one of DGGAL_TYPES
- resolution: integer resolution understood by the
dgg
CLI for the chosen type. If None, auto-selected - output_format: see OUTPUT_FORMATS
Source code in vgrid/conversion/raster2dggs/raster2dggal.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
raster2h3(raster_path, resolution=None, output_format='gpd')
¶
Convert raster data to H3 DGGS format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster_path
|
str
|
Path to the raster file |
required |
resolution
|
int
|
H3 resolution [0..15]. If None, automatically determined |
None
|
output_format
|
str
|
Output format. Options: - None: Returns GeoPandas GeoDataFrame (default) - "gpd": Returns GeoPandas GeoDataFrame - "csv": Returns CSV file path - "geojson": Returns GeoJSON file path - "geojson_dict": Returns GeoJSON FeatureCollection as Python dict - "parquet": Returns Parquet file path - "shapefile"/"shp": Returns Shapefile file path - "gpkg"/"geopackage": Returns GeoPackage file path |
'gpd'
|
Source code in vgrid/conversion/raster2dggs/raster2h3.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
raster2qtm(raster_path, resolution=None, output_format='gpd')
¶
Convert raster data to QTM DGGS output_format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster_path
|
str
|
Path to the raster file |
required |
resolution
|
int
|
QTM resolution level. If None, will be determined automatically. |
None
|
output_format
|
str
|
Output output_format, see supported formats |
'gpd'
|
Returns:
Type | Description |
---|---|
Various formats based on output_format parameter |
Source code in vgrid/conversion/raster2dggs/raster2qtm.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
raster2quadkey(raster_path, resolution=None, output_format='gpd')
¶
Convert raster to quadkey output_format
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster_path
|
str
|
Path to input raster file |
required |
resolution
|
int
|
Quadkey resolution level [0-29]. If None, will be determined automatically |
None
|
output_format
|
str
|
Output output_format, see supported formats |
'gpd'
|
Returns:
Type | Description |
---|---|
Various formats based on output_format parameter |
Source code in vgrid/conversion/raster2dggs/raster2quadkey.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
raster2rhealpix(raster_path, resolution=None, output_format='gpd')
¶
Convert raster data to rHEALPix DGGS.
Source code in vgrid/conversion/raster2dggs/raster2rhealpix.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
raster2tilecode(raster_path, resolution=None, output_format='gpd')
¶
Convert raster to tilecode output_format
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster_path
|
str
|
Path to input raster file |
required |
resolution
|
int
|
Tilecode resolution level [0-26]. If None, will be determined automatically |
None
|
output_format
|
str
|
Output output_format, see supported formats |
'gpd'
|
Returns:
Type | Description |
---|---|
Various formats based on output_format parameter |
Source code in vgrid/conversion/raster2dggs/raster2tilecode.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
s2compact(input_data, s2_token='s2', output_format='gpd')
¶
Compact S2 cells. Flexible input/output format. input_data: file path, URL, dict, GeoDataFrame, or list of cell IDs output_format: None, 'csv', 'geojson', 'shapefile', 'gpd', 'geojson_dict', 'gpkg', 'geoparquet' Output is always written to the current directory if file-based.
Source code in vgrid/conversion/dggscompact/s2compact.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
s2expand(input_data, resolution, s2_token='s2', output_format='gpd')
¶
Expand (uncompact) S2 cells to a target resolution. Flexible input/output format. input_data: file path, URL, dict, GeoDataFrame, or list of cell IDs resolution: target S2 resolution (int) output_format: None, 'csv', 'geojson', 'shapefile', 'gpd', 'geojson_dict', 'gpkg', 'parquet', 'geoparquet' Output is always written to the current directory if file-based.
Source code in vgrid/conversion/dggscompact/s2compact.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
tilecodecompact(input_data, tilecode_id='tilecode', output_format='gpd')
¶
Compact Tilecode cells from input data.
Source code in vgrid/conversion/dggscompact/tilecodecompact.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
tilecodeexpand(input_data, resolution, tilecode_id='tilecode', output_format='gpd')
¶
Expand Tilecode cells to a target resolution.
Source code in vgrid/conversion/dggscompact/tilecodecompact.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
vector2a5(data, resolution=None, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to A5 grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2a5.py
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 |
|
vector2ease(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to EASE grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2ease.py
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
|
vector2geohash(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to Geohash grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2geohash.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
|
vector2h3(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to H3 grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2h3.py
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
|
vector2isea3h(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to ISEA3H grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2isea3h.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
|
vector2mgrs(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to MGRS grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2mgrs.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
vector2olc(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to OLC grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2olc.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
|
vector2qtm(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to QTM grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2qtm.py
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 |
|
vector2quadkey(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to Quadkey grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format. The internal processing always uses GeoDataFrame format for consistency.
Source code in vgrid/conversion/vector2dggs/vector2quadkey.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
|
vector2rhealpix(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to rHEALPix grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2rhealpix.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
|
vector2s2(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to S2 grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format.
Source code in vgrid/conversion/vector2dggs/vector2s2.py
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
|
vector2tilecode(data, resolution, predicate=None, compact=False, topology=False, output_format='gpd', include_properties=True, **kwargs)
¶
Convert vector data to Tilecode grid cells from various input formats. If output_format is a file-based format (csv, geojson, shapefile, gpkg, parquet, geoparquet), the output will be saved to a file in the current directory with a default name based on the input. Otherwise, returns a Python object (GeoDataFrame, dict, etc.) depending on output_format. The internal processing always uses GeoDataFrame format for consistency.
Source code in vgrid/conversion/vector2dggs/vector2tilecode.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
|