diff --git a/.gitignore b/.gitignore index 50ed7dcb7..503fe9f56 100644 --- a/.gitignore +++ b/.gitignore @@ -134,10 +134,11 @@ 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 @@ -145,4 +146,8 @@ pygeoapi-config.yml init_db.py my_test.py data/*.png -*.dbml \ No newline at end of file +*.dbml +data/ +openAPI/ +!openAPI/IndoorFeature_openAPI.yaml +database/init_str_unique.sql \ No newline at end of file diff --git a/README.md b/README.md index df1a54f0d..3e2743992 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. --- @@ -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`. @@ -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 diff --git a/pygeoapi-config.yml b/pygeoapi-config.yml index ec6e76efb..10478278a 100644 --- a/pygeoapi-config.yml +++ b/pygeoapi-config.yml @@ -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: diff --git a/pygeoapi-config_indoorFeature.yml b/pygeoapi-config_indoorFeature.yml index 83ab14a49..bb1c886cb 100644 --- a/pygeoapi-config_indoorFeature.yml +++ b/pygeoapi-config_indoorFeature.yml @@ -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 @@ -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: diff --git a/pygeoapi/provider/postgresql_indoordb.py b/pygeoapi/provider/postgresql_indoordb.py index d92c33021..940224e1c 100644 --- a/pygeoapi/provider/postgresql_indoordb.py +++ b/pygeoapi/provider/postgresql_indoordb.py @@ -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' @@ -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) diff --git a/requirements.txt b/requirements-indoorfeature.txt similarity index 100% rename from requirements.txt rename to requirements-indoorfeature.txt diff --git a/start.sh b/start.sh index 7090be992..714df53ed 100755 --- a/start.sh +++ b/start.sh @@ -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