gars-field


Namegars-field JSON
Version 0.3.3 PyPI version JSON
download
home_pagehttps://github.com/corteva/gars-field
SummaryToolkit to generate Global Area Reference System grids.
upload_time2023-02-09 19:12:38
maintainer
docs_urlNone
authorgars-field Contributors
requires_python>=3.8
licenseBSD License
keywords gars grid
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==================
gars-field
==================

- GARS - `Global Area Reference System <https://en.wikipedia.org/wiki/Global_Area_Reference_System>`__
- Field - Corteva Agriscience farming reference.


.. image:: https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square
    :alt: All Contributors
    :target: https://github.com/corteva/gars-field/blob/main/AUTHORS.rst

.. image:: https://img.shields.io/badge/License-BSD%203--Clause-yellow.svg
    :target: https://github.com/corteva/gars-field/blob/main/LICENSE

.. image:: https://img.shields.io/pypi/v/gars_field.svg
    :target: https://pypi.python.org/pypi/gars_field

.. image:: https://pepy.tech/badge/gars_field
    :target: https://pepy.tech/project/gars_field

.. image:: https://img.shields.io/conda/vn/conda-forge/gars_field.svg
    :target: https://anaconda.org/conda-forge/gars_field

.. image:: https://github.com/corteva/gars-field/workflows/Tests/badge.svg
    :target: https://github.com/corteva/gars-field/actions?query=workflow%3ATests

.. image:: https://codecov.io/gh/corteva/gars-field/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/corteva/gars-field

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
    :target: https://github.com/pre-commit/pre-commit

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/python/black


Bugs/Questions
--------------

- Report bugs/feature requests: https://github.com/corteva/gars-field/issues
- Ask questions: https://github.com/corteva/gars-field/discussions


Usage
-----

.. note:: See the module docstrings for more details.


GARSField: determine GARS grids based on bounding box
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

    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

.. code-block:: python

    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

.. code-block:: python

    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

.. code-block:: python

    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:

- https://github.com/mil-oss/GARSutils
- https://github.com/Moustikitos/gryd/blob/c79edde94f19d46e3b3532ae14eb351e91d55322/Gryd/geodesy.py

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/corteva/gars-field",
    "name": "gars-field",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "GARS,grid",
    "author": "gars-field Contributors",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/28/62/41c8da3e27017adb446f87dafc2f388cef3ed256dc3cfd03078ed2c5b29e/gars_field-0.3.3.tar.gz",
    "platform": "any",
    "description": "==================\ngars-field\n==================\n\n- GARS - `Global Area Reference System <https://en.wikipedia.org/wiki/Global_Area_Reference_System>`__\n- Field - Corteva Agriscience farming reference.\n\n\n.. image:: https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square\n    :alt: All Contributors\n    :target: https://github.com/corteva/gars-field/blob/main/AUTHORS.rst\n\n.. image:: https://img.shields.io/badge/License-BSD%203--Clause-yellow.svg\n    :target: https://github.com/corteva/gars-field/blob/main/LICENSE\n\n.. image:: https://img.shields.io/pypi/v/gars_field.svg\n    :target: https://pypi.python.org/pypi/gars_field\n\n.. image:: https://pepy.tech/badge/gars_field\n    :target: https://pepy.tech/project/gars_field\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/gars_field.svg\n    :target: https://anaconda.org/conda-forge/gars_field\n\n.. image:: https://github.com/corteva/gars-field/workflows/Tests/badge.svg\n    :target: https://github.com/corteva/gars-field/actions?query=workflow%3ATests\n\n.. image:: https://codecov.io/gh/corteva/gars-field/branch/main/graph/badge.svg\n    :target: https://codecov.io/gh/corteva/gars-field\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white\n    :target: https://github.com/pre-commit/pre-commit\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/python/black\n\n\nBugs/Questions\n--------------\n\n- Report bugs/feature requests: https://github.com/corteva/gars-field/issues\n- Ask questions: https://github.com/corteva/gars-field/discussions\n\n\nUsage\n-----\n\n.. note:: See the module docstrings for more details.\n\n\nGARSField: determine GARS grids based on bounding box\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    import geopandas\n    import shapely.geometry\n    from gars_field import GARSField\n\n\n    geom_bounds = shapely.geometry.box(minx=-175, miny=-76, maxx=-174, maxy=-75)\n    garsf = GARSField(geom_bounds)\n    # 6 deg grids (extension)\n    grids_6deg = garsf.gars_6deg\n    # 3 deg grids (extension)\n    grids_3deg = garsf.gars_3deg\n    # 1 deg grids (extension)\n    grids_1deg = garsf.gars_1deg\n    # 30 min grids\n    grids_30min = garsf.gars_30min\n    # 15 min grids\n    grids_15min = garsf.gars_15min\n    # 5 min grids\n    grids_5min = garsf.gars_5min\n    # 1 min grids (extension)\n    grids_1min = garsf.gars_1min\n\n    # convert to geopandas\n    geopandas.GeoDataFrame(\n        {\"gars_id\": [str(grid) for grid in field.gars_1min]},\n        geometry=[grid.polygon for grid in field.gars_1min],\n        crs=\"EPSG:4326\",\n    )\n\n\nGARSGrid\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGrid cell sizes: 1, 5, 15, 30 minutes\n\n.. code-block:: python\n\n    from gars_field import GARSGrid\n\n    # from latlon\n    ggrid = GARSGrid.from_latlon(-89.55, -179.57, resolution=5)\n\n    # from GARS ID\n    ggrid = GARSGrid(\"001AA23\")\n\n    # get bounding poly\n    grid_poly = ggrid.polygon\n\n    # get GARS ID\n    gars_id = str(ggrid)\n\n    # UTM CRS EPSG Code\n    epsg_code = ggrid.utm_epsg\n\n\nEDGARSGrid\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is the extended degree grid system.\n\nGrid cell sizes: 1, 3, 6 degrees\n\n.. code-block:: python\n\n    from gars_field import EDGARSGrid\n\n    # from latlon\n    ggrid = EDGARSGrid.from_latlon(-89.55, -179.57, resolution=3)\n\n    # from GARS ID\n    ggrid = EDGARSGrid(\"D01AA23\")\n\n    # get bounding poly\n    grid_poly = ggrid.polygon\n\n    # get GARS ID\n    gars_id = str(ggrid)\n\n    # UTM CRS EPSG Code\n    epsg_code = ggrid.utm_epsg\n\n\nGEDGARSGrid\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is the giant extended degree grid system\n\nGrid cell sizes: 30, 60 degrees\n\n.. code-block:: python\n\n    from gars_field import GEDGARSGrid\n\n    # from latlon\n    ggrid = GEDGARSGrid.from_latlon(-89.55, -179.57, resolution=3)\n\n    # from GARS ID\n    ggrid = GEDGARSGrid(\"GD1A\")\n\n    # get bounding poly\n    grid_poly = ggrid.polygon\n\n    # get GARS ID\n    gars_id = str(ggrid)\n\n\nCredits\n--------\n\n``GARSGrid`` was inspired by:\n\n- https://github.com/mil-oss/GARSutils\n- https://github.com/Moustikitos/gryd/blob/c79edde94f19d46e3b3532ae14eb351e91d55322/Gryd/geodesy.py\n",
    "bugtrack_url": null,
    "license": "BSD License",
    "summary": "Toolkit to generate Global Area Reference System grids.",
    "version": "0.3.3",
    "split_keywords": [
        "gars",
        "grid"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48edba1bef3878d364d326b4fa30cf9f9c59b1e60e4b4027657061fc33e51715",
                "md5": "a2ac46422371548ba67c32aa6b93b370",
                "sha256": "ec8718e0a8d9d0ac2dd930743af8da4f50079a09826082827967279f18f48a74"
            },
            "downloads": -1,
            "filename": "gars_field-0.3.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2ac46422371548ba67c32aa6b93b370",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 15892,
            "upload_time": "2023-02-09T19:12:37",
            "upload_time_iso_8601": "2023-02-09T19:12:37.279480Z",
            "url": "https://files.pythonhosted.org/packages/48/ed/ba1bef3878d364d326b4fa30cf9f9c59b1e60e4b4027657061fc33e51715/gars_field-0.3.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "286241c8da3e27017adb446f87dafc2f388cef3ed256dc3cfd03078ed2c5b29e",
                "md5": "536198686aef672e93325658f8f3735e",
                "sha256": "2f889ab5fb12c2a8466201436d0ee9907a58e99112c2414af05b149cf1d1be2a"
            },
            "downloads": -1,
            "filename": "gars_field-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "536198686aef672e93325658f8f3735e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 21885,
            "upload_time": "2023-02-09T19:12:38",
            "upload_time_iso_8601": "2023-02-09T19:12:38.637813Z",
            "url": "https://files.pythonhosted.org/packages/28/62/41c8da3e27017adb446f87dafc2f388cef3ed256dc3cfd03078ed2c5b29e/gars_field-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-09 19:12:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "corteva",
    "github_project": "gars-field",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gars-field"
}
        
Elapsed time: 0.05596s