Skip to main content

Fuzzy Granular-Ball and OPRAm-based spatial query answering framework

Project description

FGB-OPRAm (Fuzzy Granular-Ball and OPRAm Spatial Query Answering)

Package Name: fgb-opram
Version: 0.1.1 Author: Bongjae Kwon bongjae.kwon@snu.ac.kr
GitHub: https://github.com/bongjaekwon/FGB-OPRAm-SQAUE

Overview

The fgb-opram package integrates the Fuzzy Granular-Ball model with OPRAm (Oriented Point Relation Algebra modulo m) directional calculus and fuzzy RCC-8 (Region Connection Calculus) topology. It enables robust spatial query answering under uncertainty.

Key Features

  • GranularBall: A class representing a fuzzy spatial region using a Gaussian membership function.
  • fuzzy_overlap and compute_fuzzy_rcc8: Functions to compute fuzzy intersection, union, and RCC-8 topological relations between two regions.
  • opram_direction, opram_converse, opram_composition: OPRAm-based directional reasoning utilities.
  • SpatialQueryEngine: Engine that produces pairwise spatial relations (direction + topology) among multiple fuzzy regions.
  • visualize_fuzzy_balls: A Matplotlib-based function to visualize two fuzzy regions and their overlap.
  • GUI Example: A Tkinter-based window that redirects stdout to a scrolling text widget, demonstrating the entire pipeline.

Installation

From PyPI

pip install fgb-opram

From Source (Development Mode)

git clone https://github.com/bongjaekwon/FGB-OPRAm-SQAUE.git
cd FGB-OPRAm-SQAUE
pip install .

Usage Example

from fgb_opram import GranularBall, opram_direction, compute_fuzzy_rcc8

# Create two fuzzy regions
ball1 = GranularBall(center=(1, 1), radius=2, sigma=0.3)
ball2 = GranularBall(center=(4, 5), radius=3, sigma=0.5)

# Compute membership of a point
muA = ballA.membership((37.5675, 126.9810))
muB = ballB.membership((37.5675, 126.9810))
print(f"Ball A Membership: {muA:.4f}, Ball B Membership: {muB:.4f}")

# Compute fuzzy RCC-8 topological relations
rcc8_relations = compute_fuzzy_rcc8(ballA, ballB)
print("Fuzzy RCC-8 memberships:", rcc8_relations)

# Compute OPRAm direction (m=2 → 8 directions)
direction_label = opram_direction(ballA.center, ballB.center, m=2)
print("OPRAm-2 direction from A to B:", direction_label)

GUI Example

After installation, run the following command in your terminal to launch the GUI example:

fgb_opram_gui

This will open a Tkinter window that prints spatial reasoning results (memberships, overlap, RCC-8, OPRAm, etc.) into a scrolling text widget and displays a Matplotlib plot of two fuzzy regions.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

fgb_opram-0.1.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

fgb_opram-0.1.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file fgb_opram-0.1.1.tar.gz.

File metadata

  • Download URL: fgb_opram-0.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for fgb_opram-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e101fb10654c1c3849167f01c8cfe876098cd74f25ae9e4311267474c98f73f8
MD5 3ff3a5a2d58ab215d94821de589b0859
BLAKE2b-256 3255b12ed3928534c96d31333d1652add0b5072e1d1a8bc135634de0bd748f3f

See more details on using hashes here.

File details

Details for the file fgb_opram-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fgb_opram-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for fgb_opram-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bba3e92c83b970ca3d037bc9a8272f0bf39569cca739f231f54d66c601bf69b
MD5 61b7df040c35cd38cc982179cb0ffbdf
BLAKE2b-256 a4f29ddb3eae7e65e0a7b65b05e68211f6ae1470e6023cce9fff32111aac671b

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