Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,20 @@ pygeoapi/db.sqlite3
.pygeoapi/docker/examples/mvt-tippecanoe/ES/data

# Tonny local
# If you want to keep your test uploads private/local
venv/
__pycache__/
*.pyc
data/*.json # If you want to keep your test uploads private/local
data/*.json

# Seongmin local
run.sh
pygeoapi-config.yml
init_db.py
my_test.py
data/*.png
*.dbml
*.dbml
data/
openAPI/
!openAPI/IndoorFeature_openAPI.yaml
database/init_str_unique.sql
52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# IndoorFeature API

IndoorFeature api is a RESTful api implementation of the **OGC IndoorGML 2.0** standard, designed to align with **OGC API - Features** standards. This api extends the pygeoapi framework to provide specialized service layers for indoor environments.
# API-IndoorFeatures

API - IndoorFeatures is a RESTful api implementation of the **OGC IndoorGML 2.0** standard, designed to align with **OGC API - Features** standards. This api extends the pygeoapi framework to provide specialized service layers for indoor environments.
- We are working on `branch_for_indoorAPI` [branch](https://github.com/STEMLab/API_IndoorFeatures/tree/branch_for_indoorAPI).

### Naming

This API is referred to as the **IndoorFeature API** because it implements
the IndoorGML conceptual model, including spatial subdivision, topology,
This API is referred to as the **API-IndoorFeatures** because it implements
the IndoorGML 2.0 conceptual model, including spatial subdivision, topology,
layering, and duality relationships.

All resources are exchanged using **IndoorJSON**, which serves as the
Expand All @@ -18,22 +18,18 @@ concrete JSON encoding of IndoorGML concepts.

This project is a extension of
[pygeoapi](https://pygeoapi.io), designed to provide a RESTful API for IndoorGML 2.0 standard.
### Key Accomplishments
* **OGC Standards Alignment:** Successfully mapped IndoorGML 2.0 Indoorfeature to the OGC API - Features core.
* **Dual-Space Logic:** Full implementation of Primal Space and Dual Space connectivity via. Poincare's Duality.
* **Advanced Navigation:** Custom service endpoints for Shortest Path (Dijkstra) and Topological N-Hop analysis.
* **Engineering Precision:** Native support for **SRID 0** (Cartesian Plane) for building-scale accuracy.


---

## 🛠 Technical Pedigree

### Built on [pygeoapi](https://pygeoapi.io)
This engine is built upon a specialized fork of **pygeoapi**, a Python server implementation of the OGC API suite of standards.
* **Standardized Access:** Provides RESTful endpoints using OpenAPI, GeoJSON, and HTML.
* **Extended Core:** We have customized the `api/indoorgml.py` core and developed custom providers to handle the unique hierarchy of `IndoorFeatures`.
* **PostgreSQL/PostGIS:** Optimized schema for spatial bounding and geometric queries.
* **pgRouting:** Dynamic graph traversal without the overhead of static topology creation.
This engine is built upon a specialized fork of **pygeoapi 0.22.0**, a Python server implementation of the OGC API suite of standards.
* **Standardized Access:** Provides RESTful endpoints using OpenAPI, JSON, and HTML.
* **Extended Core:** We have customized the `api/indoorgml.py` core and developed custom providers `provider/postgresql_indoordb.py` to handle the unique hierarchy structure of `IndoorFeatures`.
* **PostgreSQL/PostGIS:** Optimized schema of indoor DB for efficient query and geometric functions.
* **pgRouting:** Routing the optimal path in the graph(DualSpace).
* **Dockerized:** Fully containerized environment for immediate deployment.

---
Expand All @@ -43,9 +39,12 @@ This engine is built upon a specialized fork of **pygeoapi**, a Python server im
| Category | Endpoint | Description |
| :--- | :--- | :--- |
| **Core** | `/collections/{collection_id}/items/{feature_id}` | Standard OGC resource discovery and Feature access. |
| **IndoorFeature** | `.../layers/{layer_id}/...` | Specialized access to IndoorJSON components (Thematic layers). |
| **Navigation** | `...{layer_id}/routing` | Shortest path calculation powered by pgRouting.|
| **Spatial** | `/geoquery` | Advanced spatial filtering via WKT-form 2D geometries. |
| **IndoorFeature** | `.../layers/{layer_id}/` | Specialized access to IndoorJSON `ThematicLayer`. |
| **IndoorFeature** | `.../interlayerconnections/{connection_id}/` | Specialized access to IndoorJSON `interLayerConnection`. |
| **IndoorFeature** | `.../primal/{member_id}/...` | Specialized access to IndoorJSON primal space components (`cellSpace` and `cellBoundary`). |
| **IndoorFeature** | `.../dual/{member_id}/...` | Specialized access to IndoorJSON dual space components (`node` and `edge`). |
| **Services** | `...{layer_id}/routing` | Shortest path calculation powered by pgRouting.|
| **Services** | `/geoquery` | Advanced spatial filtering via WKT-form 2D geometries. |

💡 Tip: For a full list of over 20+ endpoints, including detailed parameter schemas and CRUD operations, please refer to our interactive documentation at:
🔗 Swagger UI: `/openapi`.
Expand All @@ -55,24 +54,27 @@ This engine is built upon a specialized fork of **pygeoapi**, a Python server im
## 📥 Installation & Setup
### 1. Prerequisites
* Docker & Docker Compose (For PostGIS/pgRouting)
* Python 3.10+ (For pygeoapi)
* Python 3.10+ (For pygeoapi 0.22.0)

### 2. Environment Startup
We recommend using a Python virtual environment to manage dependencies and avoid conflicts with system-level packages.
```bash
# Clone the repository
git clone [https://github.com/STEMLab/IndoorGML_API.git](https://github.com/STEMLab/IndoorGML_API.git)
cd IndoorGML_API
git clone [https://github.com/STEMLab/API-IndoorFeatures.git](https://github.com/STEMLab/API-IndoorFeatures.git)
cd API-IndoorFeatures

# Create and activate a Python Virtual Environment
python3 -m venv venv
source venv/bin/activate
python3 -m venv .venv
source .venv/bin/activate

# Install required dependencies
pip install -r requirements-indoor.txt
pip install -r requirements-indoorfeature.txt
pip install -e .

# Start Docker Containers
docker-compose up -d --build

./start.sh
bash ./start.sh
```

### 3. Testing api
Expand Down
6 changes: 3 additions & 3 deletions pygeoapi-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ metadata:
name: MIT
url: https://opensource.org/licenses/MIT
contact:
name: Taehoon KIM
email: kim.taehoon@aist.go.jp
url: https://github.com/STEMLab/IndoorGML_API
name: Dong Kwon Kang / Seongmin Choi / Taehoon KIM
email: kangdg2001@pusan.ac.kr / csm010311@pusan.ac.kr / kim.taehoon@aist.go.jp
url: https://github.com/STEMLab/API-IndoorFeatures

resources:
obs:
Expand Down
8 changes: 4 additions & 4 deletions pygeoapi-config_indoorFeature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ logging:

metadata:
identification:
title: IndoorFeatures API Demonstration
title: API-IndoorFeatures Demonstration
description: Developing IndoorGML and IndoorJSON support for OGC API Standards.
keywords:
- IndoorGML
Expand All @@ -41,9 +41,9 @@ metadata:
name: MIT
url: https://opensource.org/licenses/MIT
contact:
name: Taehoon KIM
email: kim.taehoon@aist.go.jp
url: https://github.com/STEMLab/IndoorGML_API
name: Dong Kwon Kang / Seongmin Choi / Taehoon KIM
email: kangdg2001@pusan.ac.kr / csm010311@pusan.ac.kr / kim.taehoon@aist.go.jp
url: https://github.com/STEMLab/API-IndoorFeatures

resources:
pusan_national_university:
Expand Down
2 changes: 0 additions & 2 deletions pygeoapi/provider/postgresql_indoordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def __init__(self, datasource=None):
"""
PostgresIndoorDB Class Constructor
"""
# define defaults inside init to avoid class-level state issues
self.host = 'localhost'
self.port = 5432
self.dbname = 'indoordb'
Expand All @@ -31,7 +30,6 @@ def __init__(self, datasource=None):
if datasource is not None:
self.host = datasource.get('host', self.host)
self.port = datasource.get('port', self.port)
# Fixed: Ensure code matches docstring (using 'dbname' consistently)
self.dbname = datasource.get('dbname', self.dbname)
self.user = datasource.get('user', self.user)
self.password = datasource.get('password', self.password)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export PYGEOAPI_OPENAPI=$(pwd)/openAPI/IndoorFeature_openAPI.yaml
# 2. Generate the OpenAPI Document
# This creates the 'local.openapi.yml' file from your config.
# We run this every time to ensure your API changes (like new collections) appear in Swagger.
echo "Regenerating OpenAPI configuration..."
# echo "Regenerating OpenAPI configuration..."
# pygeoapi openapi generate "$PYGEOAPI_CONFIG" --output-file "$PYGEOAPI_OPENAPI"

# 3. Start the Server
Expand Down
Loading