Skip to content

Correct GeoJSON feature type list (remove Observation from features, add ControlStream) #28

@Sam-Bolling

Description

@Sam-Bolling

Problem

The assessment documentation incorrectly lists Observation as a GeoJSON Feature type and omits ControlStream, which IS a feature type. This creates confusion about what resource types can be spatially represented as GeoJSON features.

Claimed in Assessment:
"7 Feature types: System, Deployment, Procedure, SamplingFeature, Property, Datastream, Observation"

Actual Implementation:
7 Feature types: System, Deployment, Procedure, SamplingFeature, Property, Datastream, ControlStream

The feature count (7) is correct, but the list itself is wrong. Observation is a non-feature resource type that does NOT extend GeoJSON Feature, while ControlStream is a proper GeoJSON feature that was not claimed in the assessment.

Context

This issue was identified during the comprehensive validation conducted January 27-28, 2026.

Related Validation Issues: #11 (GeoJSON Types Validation)
Work Item ID: 4 from Remaining Work Items
Repository: https://github.com/OS4CSAPI/ogc-client-CSAPI
Validated Commit: a71706b9592cad7a5ad06e6cf8ddc41fa5387732

Detailed Findings

Observation is NOT a GeoJSON Feature

Evidence from code structure:

src/ogc-api/csapi/geojson/
├── features/                    ← Feature types directory
│   ├── system-feature.ts
│   ├── deployment-feature.ts
│   ├── procedure-feature.ts
│   ├── sampling-feature.ts
│   ├── property-feature.ts
│   ├── datastream-feature.ts
│   ├── controlstream-feature.ts  ← ControlStream IS here
│   └── index.ts
└── non-features/                ← Non-feature types directory
    ├── observation.ts           ← Observation is HERE (not in features/)
    ├── command.ts
    ├── system-event.ts
    └── feasibility.ts

Code Evidence from src/ogc-api/csapi/geojson/non-features/observation.ts:

// Observation does NOT extend GeoJSON Feature
export interface Observation {
  id?: UniqueID;
  type?: string;
  datastream: UniqueID;           // Links to a Datastream (which IS a feature)
  phenomenonTime: ISODateTime | TimeExtent;
  resultTime?: ISODateTime;
  validTime?: TimeExtent;
  parameters?: Record<string, unknown>;
  result: unknown;                // SWE Common result structure
  resultQuality?: unknown;
  links?: Link[];
}

// Note: No 'geometry' property, no extension of Feature interface

Why Observation is Not a Feature:

  • Observations are temporal data points associated with Datastreams
  • Datastreams (which ARE features) provide the spatial context
  • Observations inherit spatial location from their parent Datastream
  • Per OGC 23-002 spec, observations are non-feature resources accessed via /datastreams/{id}/observations
  • No geometry property or GeoJSON Feature interface extension

ControlStream IS a GeoJSON Feature (but not claimed)

Evidence from src/ogc-api/csapi/geojson/features/controlstream-feature.ts (121 lines):

export interface ControlStreamFeatureProperties extends CSAPIFeatureProperties {
  featureType: 'ControlStream';   // Proper feature type discriminator
  system: UniqueID;
  deployment?: UniqueID;
  procedure?: UniqueID;
  controlledProperty: UniqueID;
  controlledPropertyDefinition?: DefinitionURI;
  inputName?: string;
  samplingFeature?: UniqueID;
  validTime?: TimeExtent;
  resultTime?: TimeExtent;
  schema?: ControlStreamSchema;
  commandCount?: number;
}

export interface ControlStreamFeature 
  extends CSAPIFeature<ControlStreamFeatureProperties, Geometry | null> {
  properties: ControlStreamFeatureProperties;
}

// Includes type guard function
export function isControlStreamFeature(feature: unknown): feature is ControlStreamFeature {
  return (
    typeof feature === 'object' &&
    feature !== null &&
    'type' in feature &&
    feature.type === 'Feature' &&
    'properties' in feature &&
    typeof feature.properties === 'object' &&
    feature.properties !== null &&
    'featureType' in feature.properties &&
    feature.properties.featureType === 'ControlStream'
  );
}

Why ControlStream IS a Feature:

  • Extends CSAPIFeature<ControlStreamFeatureProperties, Geometry | null> (standard GeoJSON feature interface)
  • Has geometry property (can be spatial location or null)
  • Located in features/ directory alongside other feature types
  • Provides isControlStreamFeature() type guard
  • Has corresponding ControlStreamCollection interface
  • Follows identical pattern to Datastream (control is symmetric to observation)

Purpose of ControlStream:

  • Represents control/command channels for systems
  • Analogous to Datastream (observation channel) but for control inputs
  • Can have spatial location (where control is applied)
  • Per OGC 23-002, control streams are feature resources accessed via /controlStreams

Impact Analysis

Documentation Accuracy:

  • Users reading assessment will look for ObservationFeature type that doesn't exist
  • Users will NOT know about ControlStream feature type
  • Misunderstanding of what resources can have spatial representation

Code Usage:

  • Developers expecting to spatially query Observations directly will fail
  • Correct pattern: Query Datastreams (features) spatially, then get associated Observations (non-features)
  • ControlStream capabilities will be undiscovered

Specification Compliance:

  • OGC 23-002 defines Observations as non-spatial resources under Datastreams
  • OGC 23-002 defines ControlStreams as feature resources (symmetric to Datastreams)
  • Current documentation contradicts the spec

Correct Feature Type List

All 7 GeoJSON Feature Types in Implementation:

Feature Type File Properties Interface Purpose
SystemFeature system-feature.ts SystemFeatureProperties Sensors, platforms, networks
DeploymentFeature deployment-feature.ts DeploymentFeatureProperties System deployments
ProcedureFeature procedure-feature.ts ProcedureFeatureProperties Measurement procedures
SamplingFeature sampling-feature.ts SamplingFeatureProperties Spatial sampling locations
PropertyFeature property-feature.ts PropertyFeatureProperties Observable properties
DatastreamFeature datastream-feature.ts DatastreamFeatureProperties Observation streams
ControlStreamFeature controlstream-feature.ts ControlStreamFeatureProperties Control/command streams

All 7 feature types:

  • ✅ Extend CSAPIFeature<Properties, Geometry | null>
  • ✅ Extend standard GeoJSON Feature interface
  • ✅ Have geometry property (Geometry | null)
  • ✅ Located in src/ogc-api/csapi/geojson/features/
  • ✅ Provide type guard functions
  • ✅ Have corresponding collection interfaces

Proposed Solution

Update assessment documentation to correct the feature type list:

Current (Incorrect):

**GeoJSON Types**: TypeScript definitions for OGC Connected Systems GeoJSON features
- **7 Feature types**: System, Deployment, Procedure, SamplingFeature, Property, Datastream, Observation

Corrected:

**GeoJSON Types**: TypeScript definitions for OGC Connected Systems GeoJSON features
- **7 Feature types**: System, Deployment, Procedure, SamplingFeature, Property, Datastream, ControlStream

Add clarification note:

**Note**: Observation is a **non-feature resource type** (not a GeoJSON feature). 
Observations are temporal data points associated with Datastreams and inherit 
spatial context from their parent Datastream. See non-feature types below for 
Observation definition.

Acceptance Criteria

  • Assessment document updated to list correct 7 feature types
  • Observation removed from feature type list
  • ControlStream added to feature type list
  • Clarification note added explaining why Observation is NOT a feature
  • Non-feature types section updated to include Observation (see related issue ⚡ Performance Benchmarking & Production Readiness Testing #5)
  • All feature type references throughout documentation are consistent
  • README.md updated if it references feature types
  • Any tutorial or example code uses correct feature type terminology

Implementation Notes

Files to Update:

  1. Assessment Document (primary correction):

    • Locate section: "GeoJSON Types: TypeScript definitions..."
    • Change feature type list from [..., Datastream, Observation] to [..., Datastream, ControlStream]
    • Add note about Observation being non-feature type
  2. README.md (if applicable):

    • Search for references to "Observation" as a feature type
    • Update any examples showing feature type lists
    • Ensure ControlStream is mentioned alongside Datastream
  3. Tutorial/Documentation:

    • Review any getting-started guides
    • Ensure spatial query examples use Datastreams (not Observations)
    • Add examples of ControlStream usage

Code Locations for Reference:

  • Feature types: src/ogc-api/csapi/geojson/features/ (7 files)
  • Non-feature types: src/ogc-api/csapi/geojson/non-features/ (4 files, including observation.ts)
  • Base types: src/ogc-api/csapi/geojson/base-types.ts

Related Work Items:

Validation Reference:


Priority Justification

Priority: High

Reasoning:

  1. Documentation Accuracy (Critical):

    • Assessment is foundational documentation for the library
    • Incorrect feature type list misleads all users
    • Creates confusion about fundamental architecture
  2. User Impact (High):

    • Developers will waste time looking for non-existent ObservationFeature type
    • ControlStream capabilities will be undiscovered
    • Incorrect mental model of spatial vs non-spatial resources
  3. Specification Compliance:

    • Current documentation contradicts OGC 23-002 specification
    • Observations are explicitly non-feature resources in the spec
    • ControlStreams are explicitly feature resources in the spec
  4. Quick Fix (Low Cost):

    • Only requires documentation updates
    • No code changes needed
    • Implementation is already correct, only documentation is wrong
  5. Foundation Issue:

    • Correct feature type list is prerequisite for understanding library architecture
    • Affects downstream documentation, tutorials, and examples
    • Should be fixed before users encounter incorrect information

Cost: Low (documentation-only change)
Benefit: High (prevents confusion, ensures specification compliance)
Risk if not addressed: Users build incorrect mental models and miss ControlStream functionality


Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions