Skip to main content

Determination of quadrants based on angle, coordinates and others

Overview

This library allows you to determine quadrant(s) based on

  • angle (360° or 400 Gon)

  • location (latlon)

Setup

Via Pip:

pip install quadrantic

Via Github (latest):

pip install git+https://github.com/earthobservations/quadrantic

Implementations

Get quadrant for angle

Determine quadrant based on

Degree

#####################
#         # 90°     #
#         #         #
# 180°    #      0° #
#####################
#         #         #
#         #         #
#         # 270°    #
#####################

or

Gon

#####################
#         # 100°    #
#         #         #
# 200°    #      0° #
#####################
#         #         #
#         #         #
#         # 300°    #
#####################
from quadrantic import QuadrantFromAngle, AngleUnit, Q

quad = QuadrantFromAngle() # no args need for this method

# Single quadrant
quad.get(45.0, AngleUnit.DEGREE)
# [Q.FIRST]

# Two quadrants
quad.get(90.0, AngleUnit.DEGREE)
# [Q.FIRST, Q.SECOND]

# More then full circle (360°)
quad.get(450.0, AngleUnit.DEGREE) # same as above + 360°
# [Q.FIRST, Q.SECOND]

# Negative degree
quad.get(-45.0, AngleUnit.DEGREE)
# [Q.FOURTH]

# Degree in Gon
quad.get(90.0, AngleUnit.GON)
# [Q.FIRST]

Get quadrant for coordinates

#####################
# (-1,1)  #   (1,1) #
#         #         #
#         # (0,0)   #
#####################
#         #         #
#         #         #
#         #         #
#####################
from quadrantic import QuadrantFromCoords, AngleUnit, Q
from shapely.geometry import Point

# Single quadrant
quad = QuadrantFromCoords((0.0, 0.0))
quad.get((1.0, 1.0))
# [Q.FIRST]

# Two quadrants
quad = QuadrantFromCoords((0.0, 0.0))
quad.get((0.0, 1.0))
# [Q.FIRST, Q.SECOND]

# All quadrants
quad = QuadrantFromCoords((0.0, 0.0))
quad.get((0.0, 0.0))
# [Q.FIRST, Q.SECOND, Q.THIRD, Q.FOURTH]

# Single quadrant with shapely Point
quad = QuadrantFromCoords(Point(0.0, 0.0))
quad.get(Point(1.0, 1.0))
# [Q.FIRST]

Examples

Visualized examples can be found in the examples folder.

License

Distributed under the MIT License. See LICENSE.rst for more info.

Changelog

Development

0.1.0 (25.09.2022)

  • Add first version of quadrantic

Metadata

Release files for quadrantic 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quadrantic 0.1.0
File Size Uploaded
quadrantic-0.1.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quadrantic 0.1.0
File Interpreter ABI Platform
quadrantic-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / quadrantic-0.1.0.tar.gz

Download URL quadrantic-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
760a59465f599e86251b1324125da91c39b6d76a8ebf276b64ad47f3a7b7f08c
BLAKE2b-256 checksum
How to use checksums
3059c13f95c83cc62b4763386d9e969dfb212de33aff8b55515ab3b2dda4b2e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

Release files / quadrantic-0.1.0-py3-none-any.whl

Download URL quadrantic-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
618c4d9457db732f5af0f8579ef0fc76613b9dda9854288bc0f3e771f0e7385e
BLAKE2b-256 checksum
How to use checksums
562717aa3301a47a578aa73e1761e4c3640c85c4cbe7797f46347ea853e3b605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page