Skip to main content

A wrapper for ArcGIS API and GeoPandas DataFrame that adds a simple API to repetitive processes used in GIS calculations.

Project description

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

pip install shruby

Usage

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.

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

shruby-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shruby-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file shruby-0.1.0.tar.gz.

File metadata

  • Download URL: shruby-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.8.0 Windows/10

File hashes

Hashes for shruby-0.1.0.tar.gz
Algorithm Hash digest
SHA256 34a2df7416d6ab165100a1e2f6514a62e52b4a328ef4cb90e0c76ef871988d68
MD5 2b69ef1746b3a3a5d775e64c2be5997d
BLAKE2b-256 ac19e0a8172919d41edfaf9c6a8343a99436d99a722b70f07bd5f1db31c46add

See more details on using hashes here.

File details

Details for the file shruby-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shruby-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.8.0 Windows/10

File hashes

Hashes for shruby-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06d3284e55cc625bf9e5f49743c3f3aeccd874e36595f29957ed47d06f1621a9
MD5 2539fcbe7d2eca57b47e378c8076de54
BLAKE2b-256 f2d000e2a972009d3f84989f3ed89875b9575f97e031b9a170830fdd1135b58c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page