Toolkit to generate Global Area Reference System grids.
Project description
GARS - Global Area Reference System
Field - Corteva Agriscience farming reference.
Bugs/Questions
Report bugs/feature requests: https://github.com/corteva/gars-field/issues
Ask questions: https://github.com/corteva/gars-field/discussions
Usage
GARSField: determine GARS grids based on bounding box
import geopandas
import shapely.geometry
from gars_field import GARSField
geom_bounds = shapely.geometry.box(minx=-175, miny=-76, maxx=-174, maxy=-75)
garsf = GARSField(geom_bounds)
# 6 deg grids (extension)
grids_6deg = garsf.gars_6deg
# 3 deg grids (extension)
grids_3deg = garsf.gars_3deg
# 1 deg grids (extension)
grids_1deg = garsf.gars_1deg
# 30 min grids
grids_30min = garsf.gars_30min
# 15 min grids
grids_15min = garsf.gars_15min
# 5 min grids
grids_5min = garsf.gars_5min
# 1 min grids (extension)
grids_1min = garsf.gars_1min
# convert to geopandas
geopandas.GeoDataFrame(
{"gars_id": [str(grid) for grid in field.gars_1min]},
geometry=[grid.polygon for grid in field.gars_1min],
crs="EPSG:4326",
)
GARSGrid
Grid cell sizes: 1, 5, 15, 30 minutes
from gars_field import GARSGrid
# from latlon
ggrid = GARSGrid.from_latlon(-89.55, -179.57, resolution=5)
# from GARS ID
ggrid = GARSGrid("001AA23")
# get bounding poly
grid_poly = ggrid.polygon
# get GARS ID
gars_id = str(ggrid)
# UTM CRS EPSG Code
epsg_code = ggrid.utm_epsg
EDGARSGrid
This is the extended degree grid system.
Grid cell sizes: 1, 3, 6 degrees
from gars_field import EDGARSGrid
# from latlon
ggrid = EDGARSGrid.from_latlon(-89.55, -179.57, resolution=3)
# from GARS ID
ggrid = EDGARSGrid("D01AA23")
# get bounding poly
grid_poly = ggrid.polygon
# get GARS ID
gars_id = str(ggrid)
# UTM CRS EPSG Code
epsg_code = ggrid.utm_epsg
GEDGARSGrid
This is the giant extended degree grid system
Grid cell sizes: 30, 60 degrees
from gars_field import GEDGARSGrid
# from latlon
ggrid = GEDGARSGrid.from_latlon(-89.55, -179.57, resolution=3)
# from GARS ID
ggrid = GEDGARSGrid("GD1A")
# get bounding poly
grid_poly = ggrid.polygon
# get GARS ID
gars_id = str(ggrid)
Credits
GARSGrid was inspired by:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gars_field-0.2.0.tar.gz
(21.6 kB
view details)
File details
Details for the file gars_field-0.2.0.tar.gz
.
File metadata
- Download URL: gars_field-0.2.0.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdff4ec069f5302e07c6c019df12346cc7e92a5bfd59abf7c94f44c76631c093 |
|
MD5 | ede0473006184de27240331ce61284a5 |
|
BLAKE2b-256 | 25235ffbc4bd76ca346c1905f83d264e149acd4325f0d0ccb62696948da99e30 |