shruby


Nameshruby JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryA wrapper for ArcGIS API and GeoPandas DataFrame that adds a simple API to repetitive processes used in GIS calculations.
upload_time2023-11-17 05:00:36
maintainer
docs_urlNone
authormsherburne
requires_python>=3.9,<3.12
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Shruby

This library provides one kind of object dubbed "ShrubyFrame". This modified dataframe mimics a GeoDataframe with a few special tweaks. It is designed to work hand in hand with the ArcGIS API for Python. This project is in progress but version 0.1.0 will have the following methods:

- create_buffers: creates a buffer around a point.
- create_cones: creates triangle like cones that show a range and direction of a point.

### Installation

```bash
pip install shruby
```

### Usage

```python
import pandas as pd
from shruby import ShrubyFrame

df = pd.read_csv("data.csv")
sdf = ShrubyFrame(df, lat_field="lat", lon_field="lon", crs="EPSG:4326")
sdf.create_buffers(distance=100, metric="meters")
```

### ShrubyFrame

##### Constructor

| Parameter        | Type                                          | Default   | Details                                                            |
| ---------------- | --------------------------------------------- | --------- | ------------------------------------------------------------------ |
| sdf              | Pandas DF, GeoDF, ArcGIS spacially enabled DF |           | The input data in the form of a dataframe.                         |
| lat_field        | string                                        | None      | The latitude or Y field. If None, defaults to SHAPE from ArcGIS.   |
| lon_field        | string                                        | None      | The longitude or X field. If None, defaults to SHAPE from ArcGIS.  |
| crs              | string                                        | EPSG:4326 | The spatial reference/projection in the form of EPSG:XXXX.         |
| using_arcgis_api | bool                                          | False     | Whether to return GeoAccessor Objects for use with the ArcGIS API. |
| args             |                                               |           | args for a GeoDataframe                                            |

#### create_buffers

| Argument  | Type             | Default | Details                                                                                                                                                       |
| --------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| distance  | numerical/string | None    | The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.                                        |
| metric    | string           | None    | The unit of measurement for the distance. Can be any of the following: "meters", "kilometers", "feet", "miles", "nautical_miles".                             |
| quad_segs | int              | 8       | The number of segments to use to create the buffer. The more segments that are used, the more circular the buffer will be, at the expense of processing time. |

Returns a ShrubyFrame with a geometry set to column "buffer_geometry" containing polygons. If using ArcGIS API, returns a GeoAccessor object.

#### create_cones

| Argument    | Type             | Default | Details                                                                                                                                                          |
| ----------- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| distance    | numerical/string | None    | The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.                                           |
| metric      | string           | None    | The unit of measurement for the distance. Can be any of the following: "meters", "kilometers", "feet", "miles", "nautical_miles".                                |
| orientation | numerical/string | None    | The orientation of the cone. Can be a plain number or a field in the dataframe that contains the orientation for each row. Must be a number between 0 and 360.   |
| offset      | numerical        | 20      | The offset of the cone. This offset will decide how wide the cones angle is.                                                                                     |
| precision   | int              | 50      | The number of points to use to create the cone. The more points that are used, the more circular the end of the cone will be, at the expense of processing time. |

Returns a ShrubyFrame with a geometry set to column "cone_geometry" containing polygons. If using ArcGIS API, returns a GeoAccessor object.

#### create_rings

| Argument  | Type             | Default | Details                                                                                                                                                       |
| --------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| distance  | numerical/string | None    | The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.                                        |
| metric    | string           | None    | The unit of measurement for the distance. Can be any of the following: "meters", "kilometers", "feet", "miles", "nautical_miles".                             |
| quad_segs | int              | 8       | The number of segments to use to create the buffer. The more segments that are used, the more circular the buffer will be, at the expense of processing time. |

Returns a ShrubyFrame with a geometry set to column "ring_geometry" containing polygons. If using ArcGIS API, returns a GeoAccessor object.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "shruby",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.12",
    "maintainer_email": "",
    "keywords": "",
    "author": "msherburne",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ac/19/e0a8172919d41edfaf9c6a8343a99436d99a722b70f07bd5f1db31c46add/shruby-0.1.0.tar.gz",
    "platform": null,
    "description": "## Shruby\n\nThis library provides one kind of object dubbed \"ShrubyFrame\". This modified dataframe mimics a GeoDataframe with a few special tweaks. It is designed to work hand in hand with the ArcGIS API for Python. This project is in progress but version 0.1.0 will have the following methods:\n\n- create_buffers: creates a buffer around a point.\n- create_cones: creates triangle like cones that show a range and direction of a point.\n\n### Installation\n\n```bash\npip install shruby\n```\n\n### Usage\n\n```python\nimport pandas as pd\nfrom shruby import ShrubyFrame\n\ndf = pd.read_csv(\"data.csv\")\nsdf = ShrubyFrame(df, lat_field=\"lat\", lon_field=\"lon\", crs=\"EPSG:4326\")\nsdf.create_buffers(distance=100, metric=\"meters\")\n```\n\n### ShrubyFrame\n\n##### Constructor\n\n| Parameter        | Type                                          | Default   | Details                                                            |\n| ---------------- | --------------------------------------------- | --------- | ------------------------------------------------------------------ |\n| sdf              | Pandas DF, GeoDF, ArcGIS spacially enabled DF |           | The input data in the form of a dataframe.                         |\n| lat_field        | string                                        | None      | The latitude or Y field. If None, defaults to SHAPE from ArcGIS.   |\n| lon_field        | string                                        | None      | The longitude or X field. If None, defaults to SHAPE from ArcGIS.  |\n| crs              | string                                        | EPSG:4326 | The spatial reference/projection in the form of EPSG:XXXX.         |\n| using_arcgis_api | bool                                          | False     | Whether to return GeoAccessor Objects for use with the ArcGIS API. |\n| args             |                                               |           | args for a GeoDataframe                                            |\n\n#### create_buffers\n\n| Argument  | Type             | Default | Details                                                                                                                                                       |\n| --------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| distance  | numerical/string | None    | The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.                                        |\n| metric    | string           | None    | The unit of measurement for the distance. Can be any of the following: \"meters\", \"kilometers\", \"feet\", \"miles\", \"nautical_miles\".                             |\n| quad_segs | int              | 8       | The number of segments to use to create the buffer. The more segments that are used, the more circular the buffer will be, at the expense of processing time. |\n\nReturns a ShrubyFrame with a geometry set to column \"buffer_geometry\" containing polygons. If using ArcGIS API, returns a GeoAccessor object.\n\n#### create_cones\n\n| Argument    | Type             | Default | Details                                                                                                                                                          |\n| ----------- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| distance    | numerical/string | None    | The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.                                           |\n| metric      | string           | None    | The unit of measurement for the distance. Can be any of the following: \"meters\", \"kilometers\", \"feet\", \"miles\", \"nautical_miles\".                                |\n| orientation | numerical/string | None    | The orientation of the cone. Can be a plain number or a field in the dataframe that contains the orientation for each row. Must be a number between 0 and 360.   |\n| offset      | numerical        | 20      | The offset of the cone. This offset will decide how wide the cones angle is.                                                                                     |\n| precision   | int              | 50      | The number of points to use to create the cone. The more points that are used, the more circular the end of the cone will be, at the expense of processing time. |\n\nReturns a ShrubyFrame with a geometry set to column \"cone_geometry\" containing polygons. If using ArcGIS API, returns a GeoAccessor object.\n\n#### create_rings\n\n| Argument  | Type             | Default | Details                                                                                                                                                       |\n| --------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| distance  | numerical/string | None    | The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.                                        |\n| metric    | string           | None    | The unit of measurement for the distance. Can be any of the following: \"meters\", \"kilometers\", \"feet\", \"miles\", \"nautical_miles\".                             |\n| quad_segs | int              | 8       | The number of segments to use to create the buffer. The more segments that are used, the more circular the buffer will be, at the expense of processing time. |\n\nReturns a ShrubyFrame with a geometry set to column \"ring_geometry\" containing polygons. If using ArcGIS API, returns a GeoAccessor object.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A wrapper for ArcGIS API and GeoPandas DataFrame that adds a simple API to repetitive processes used in GIS calculations.",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2d000e2a972009d3f84989f3ed89875b9575f97e031b9a170830fdd1135b58c",
                "md5": "2539fcbe7d2eca57b47e378c8076de54",
                "sha256": "06d3284e55cc625bf9e5f49743c3f3aeccd874e36595f29957ed47d06f1621a9"
            },
            "downloads": -1,
            "filename": "shruby-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2539fcbe7d2eca57b47e378c8076de54",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.12",
            "size": 5154,
            "upload_time": "2023-11-17T05:00:35",
            "upload_time_iso_8601": "2023-11-17T05:00:35.191771Z",
            "url": "https://files.pythonhosted.org/packages/f2/d0/00e2a972009d3f84989f3ed89875b9575f97e031b9a170830fdd1135b58c/shruby-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac19e0a8172919d41edfaf9c6a8343a99436d99a722b70f07bd5f1db31c46add",
                "md5": "2b69ef1746b3a3a5d775e64c2be5997d",
                "sha256": "34a2df7416d6ab165100a1e2f6514a62e52b4a328ef4cb90e0c76ef871988d68"
            },
            "downloads": -1,
            "filename": "shruby-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2b69ef1746b3a3a5d775e64c2be5997d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.12",
            "size": 4629,
            "upload_time": "2023-11-17T05:00:36",
            "upload_time_iso_8601": "2023-11-17T05:00:36.799223Z",
            "url": "https://files.pythonhosted.org/packages/ac/19/e0a8172919d41edfaf9c6a8343a99436d99a722b70f07bd5f1db31c46add/shruby-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-17 05:00:36",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "shruby"
}
        
Elapsed time: 0.13224s