# WFS CQL_FILTER Advanced Query Findings Summary

**Date:** 2026-02-08
**GeoServer endpoint:** https://ymspace.ga.nycu.edu.tw:8080/geoserver/wfs
**CRS:** EPSG:3826 (TWD97 / TM2 zone 121)

---

## Executive Summary

A systematic exploration of the GeoServer WFS endpoint using CQL_FILTER queries, DescribeFeatureType, resultType=hits, BBOX filters, pagination, multiple output formats, and workspace enumeration was conducted. Here are the key findings:

### Key Finding #1: NO Hidden Data in gis: Layers

**All 47 gis: layers return identical feature counts** whether queried with:
- Default GetFeature (no filter)
- CQL_FILTER=1=1 (get all)
- resultType=hits (server-side count)

This confirms the server does NOT apply default filters or row-level security that would hide features from anonymous access. Our existing archived data is complete for all gis: layers.

### Key Finding #2: MASSIVE gis_room: Workspace Discovered

The capabilities document reveals a **second workspace** `gis_room:` with **approximately 350+ floor-level room boundary layers**, one per building per floor. This represents the indoor room/space data for every building on the Yangming campus.

### Key Finding #3: Rich Building Metadata

The `gis:gis_building` layer has **41 properties** (far more than the 5 in `gis:gis_building_geom`). Key populated fields include:
- **32/47 buildings** have Chinese descriptions (DescCh)
- **5 buildings** have 360-degree Google Street View panorama URLs
- All buildings have addresses, floor counts, area data, lifetime info, etc.

### Key Finding #4: Server Supports Multiple Output Formats

Successfully confirmed support for:
- `application/json` (GeoJSON)
- `text/xml; subtype=gml/3.1.1`
- `csv`
- `application/vnd.google-earth.kml+xml` (KML)
- `SHAPE-ZIP` (Shapefile)

---

## Detailed Findings

### 1. Layer Feature Count Comparison (gis: workspace)

All counts match between CQL_FILTER=1=1, default GetFeature, and existing archived files:

| Layer | Features | Notes |
|-------|----------|-------|
| gis:gis_building_geom | 47 | Building polygon geometries |
| gis:gis_building | 47 | Building metadata (41 properties!) |
| gis:gis_campus | 3 | Campus boundaries |
| gis:gis_parking | 38 | Parking locations |
| gis:gis_busstop | 10 | Bus stops with route info |
| gis:gis_restaurant | 3 | Restaurants |
| gis:gis_aed | 3 | AED locations |
| gis:gis_artwork | 4 | Artworks |
| gis:gis_atm | 4 | ATMs (has extra test/DescCh/DescEn fields) |
| gis:gis_auditorium | 5 | Auditoriums |
| gis:gis_auditorium2 | 2 | Accessible auditoriums (has photo/lat/lon) |
| gis:gis_barrierfreetoilet | 20 | Accessible toilets v1 |
| gis:gis_barrierfreetoilet2 | 20 | Accessible toilets v2 (has lat/lon) |
| gis:gis_block | 11 | Campus blocks/zones |
| gis:gis_busroutes_1 | 1 | Bus Route 559 |
| gis:gis_busroutes_2 | 1 | Green Route |
| gis:gis_busroutes_3 | 1 | Red Route |
| gis:gis_campusphotos | 4 | Campus photo locations |
| gis:gis_conveniencestore | 1 | Convenience store |
| gis:gis_elevator | 24 | Elevators v1 |
| gis:gis_elevator2 | 20 | Accessible elevators v2 (has photo/lat/lon) |
| gis:gis_emergencycall | 35 | Emergency call points |
| gis:gis_emergencycall2 | 2 | Emergency call v2 |
| gis:gis_firestation | 1 | Fire hydrant |
| gis:gis_gateway | 2 | Campus entrance gates |
| gis:gis_handicapparking | 9 | Accessible parking v1 |
| gis:gis_handicapparking2 | 12 | Accessible parking v2 (has photo/lat/lon) |
| gis:gis_healthroom | 1 | Health room |
| gis:gis_monthlyparking | 4 | Monthly parking |
| gis:gis_postoffice | 1 | Post office |
| gis:gis_securityoffice | 3 | Security offices |
| gis:gis_sport | 11 | Sport facilities (has photo/x/y) |
| gis:gis_sport_p | 5 | Sport facility polygons |
| gis:gis_telephonebooth | 1 | Emergency telephone booth |
| gis:gis_timerecorder | 8 | Time recorders |
| gis:gis_wheelchairramp | 15 | Wheelchair ramps v1 |
| gis:gis_wheelchairramp2 | 16 | Wheelchair ramps v2 (has photo/lat/lon) |
| gis:AED_test11 | 3 | Test layer (parking pay stations) |
| gis:bak_gis_building_geom_v1 | 48 | Backup building geom v1 (48 vs current 47) |
| gis:bak_gis_campus_v1 | 1 | Backup campus v1 |
| gis:bak_gis_campus_v2 | 1 | Backup campus v2 |
| gis:test_c | 13 | Test layer with building refs |
| gis:toilet | 2 | Toilet layer |
| gis:point_sample | 4 | Sample points |
| gis:gis_test202305016 | 4 | Test layer from 2023 |
| gis:AEDtest2 | ERROR | Non-JSON response |
| gis:gis_test | ERROR | Non-JSON response |
| **Total gis features** | **~475** | |

### 2. gis_room: Workspace - Floor Plan Room Boundaries

This is the biggest discovery. The `gis_room:` workspace contains per-building, per-floor room boundary layers.

**Building codes discovered in gis_room:**

| Code | Building Name (from gis:gis_building) | Floor Layers |
|------|---------------------------------------|--------------|
| A009-A133, A143 | Faculty dormitories (山上/山腰村) | 1F, 2F each (some 3F) |
| B003 | 山下會館(24~27) | 1F-4F, B1 |
| B004 | 博雅中心 | 1F, 2F, B1 |
| B005 | 活動中心 | 1F-6F, B1, 4M, RF |
| B009 | 游泳池 | 1F-3F, RF |
| B010 | BEATA餐廳 | 1F, 2F, B1 |
| B011 | 男三舍 | 1F-5F, B1, RF |
| B012 | 男一舍 | 1F-4F, B1, RF |
| B013 | 藍楹軒(女一舍) | 1F-6F, B1, RF |
| B014 | 桂香居(女二舍) | 1F-7F, RF |
| B015 | 韓偉故居 | 1F, 2F |
| B016 | 女三舍 | 1F-4F, B1, RF |
| B017 | 男二舍 | 1F-4F, B1, RF |
| B018 | 山麓村(B棟) | 1F-7F, B1, R1-R3 |
| B019 | 男五舍 | 1F-7F, B1, R1-R2 |
| B020 | 女五舍 | 1F-7F, B1, R1-R2 |
| B021-B029 | Various dormitories | Multiple floors |
| B030-B034 | 山麓村 C/D/E etc. | 1F-7F, R1-R3 |
| G002 | 致和樓 | 1F-4F, B1, RF |
| G005 | 西安樓 | 1F-7F, B1-B2, RF |
| G007-G022 | Additional G-series buildings | 1F-2F (some 3F) |
| P003 | 圖書資訊暨研究大樓 | 1F-10F, B1-B2, RF |
| P004 | 生物醫學大樓 | 1F-7F, B1, RF |
| P005 | 傳統醫學大樓(甲) | 1F-9F, B1-B2, RF |
| P006 | 守仁樓 | 1F-8F, B1-B2, RF |
| T001 | Unknown T-series | 1F |
| Y001 | 護理館 | 1F-6F, B1, R1-R2 |
| Y002 | 行政大樓 | 1F-3F, B1 |
| Y003 | 醫學二館 | 1F-4F, 2M, RF |
| Y004 | 牙醫館 | 1F-4F, RF |
| Y005 | 醫學館 | 1F, 1M, 2F, 3F, B1, R1, RF |
| Y006 | 知行樓(後棟) | 1F-5F, RF |
| Y007 | 知行樓(前棟) | 1F-3F, B1, RF |
| Y008 | 教學大樓 | 1F-3F, 2M, B1 |
| Y009 | 實驗大樓 | 1F-4F, 10F, B1, RF |
| Y010 | 生醫工程館 | 1F-6F, R1-R2 |
| Y011 | 實驗動物中心 | 1F, 2F, RF |
| Y012 | 運動場(司令台) | 1F-3F |

**Estimated total gis_room layers: ~350+**

### 3. Building Property Deep Analysis (gis:gis_building)

**41 properties total. Population rates:**

| Property | Count | Rate | Description |
|----------|-------|------|-------------|
| BuildID | 47/47 | 100% | Building identifier (P006, Y001, B005...) |
| BuildName | 47/47 | 100% | Chinese name |
| BuildNameEn | 47/47 | 100% | English name |
| BuildTypeName | 47/47 | 100% | Building type/category name |
| address | 47/47 | 100% | Street address |
| Floors | 47/47 | 100% | Above-ground floors |
| FArea | 46/47 | 98% | Floor area |
| ContractNum | 47/47 | 100% | Contract number |
| Date_Accept | 47/47 | 100% | Acceptance date |
| DeedArea | 47/47 | 100% | Deed area |
| TallyArea | 47/47 | 100% | Tallied area |
| UseNum | 47/47 | 100% | Usage number |
| Lifetime | 47/47 | 100% | Building lifetime info |
| add_area | 47/47 | 100% | Additional area |
| DescCh | 32/47 | 68% | Chinese description |
| UnFloors | 18/47 | 38% | Underground floors |
| view360 | 5/47 | 11% | Google 360 panorama URLs (JSON) |
| Remark | 4/47 | 9% | Remarks |
| DescEn | 1/47 | 2% | English description |
| Campus | 0/47 | 0% | (empty field) |
| CampusID | 0/47 | 0% | (empty field) |
| BuildCategory | 0/47 | 0% | (empty field) |
| BuildType | 0/47 | 0% | (empty field) |

### 4. 360-Degree View Data

5 buildings have embedded Google Street View panorama URLs:

1. **守仁樓 (P006)**: 接待廳, 膺才廳
2. **圖書資訊暨研究大樓 (P003)**: 圖資大樓 (3 panoramas)
3. **活動中心 (B005)**: 表演廳, 第一/二/三會議室, 大禮堂, 多功能室
4. **女五舍 (B020)**: 雙人房, 四人房, 公共設施
5. **男五舍 (B019)**: 雙人房, 四人房, 公共設施

### 5. Campus Boundary Coordinate System

The data uses **EPSG:3826 (TWD97 / TM2 zone 121)** projected coordinates:

| Campus | X Range | Y Range |
|--------|---------|---------|
| 陽明大學校區 (Main) | 301,286 - 302,479 | 2,779,048 - 2,780,020 |
| 立農段二小段 | 301,570 - 301,616 | 2,779,047 - 2,779,090 |
| 福林段二小段 | 303,792 - 303,864 | 2,776,527 - 2,776,564 |

BBOX queries with these coordinates work correctly and return the expected features.

### 6. Supported Output Formats

| Format | Status | Size (2 buildings) |
|--------|--------|-------------------|
| application/json | OK | 7,922 bytes |
| GML 3.1.1 | OK | 10,690 bytes |
| CSV | OK | 8,523 bytes |
| KML | OK | 16,418 bytes |
| SHAPE-ZIP | OK | 4,478 bytes |

### 7. Additional Observations

- **Backup layer bak_gis_building_geom_v1** has 48 features vs current 47 (one building was likely removed)
- **v2 accessibility layers** (auditorium2, barrierfreetoilet2, elevator2, handicapparking2, wheelchairramp2) have additional photo/latitude/longitude fields compared to v1
- **WFS 2.0 GetPropertyValue** works and returns all distinct values per property
- **Only one stored query** exists: the default `GetFeatureById`
- **Campus and CampusID fields** in gis_building are all empty (not populated)
- **BuildType field** is empty but BuildTypeName is 100% populated
- **Other workspaces** found: cite, nurc, sde, sf (spearfish demo data), tiger (US census demo data), topp (demo data), test, test1, topg

---

## Files Generated

| File | Description |
|------|-------------|
| `capabilities.xml` | Full WFS GetCapabilities XML |
| `CQL_EXPLORATION_SUMMARY.json` | Machine-readable summary |
| `CQL_EXPLORATION_DETAILS.json` | Full per-layer exploration results |
| `DEEP_PROPERTY_ANALYSIS.json` | Building + campus + busstop deep data |
| `gis_gis_building_FULL_PROPERTIES.json` | All 47 buildings with all 41 properties |
| `gis_*_cql_all.json` | Per-layer CQL_FILTER=1=1 full GeoJSON (43 files) |

---

## Recommendations for Next Steps

1. **Download all gis_room: layers** - This represents ~350+ floor plan layers that map every room in every building. This is the most valuable undiscovered data.

2. **Export gis:gis_building as CSV** - The 41-property building metadata (especially DescCh, view360, address, Floors, FArea) should be exported in a readable format for reference.

3. **Archive the 360-degree panorama URLs** - The 5 buildings with Google Street View panoramas contain valuable interior imagery links that should be archived.

4. **Compare bak_gis_building_geom_v1 (48 features) with current (47 features)** to identify which building was removed.
