openapi: 3.1.0
info:
  title: Town Planning Board — Digital Planning Data of Statutory Plans
  version: csdi-native-readonly-v1
  description: Deterministic derivative of retained native CSDI metadata. Read-only GET operations are selected only where native capabilities and protocol documentation support them. Publisher originals remain separate. Successful metadata retrieval does not prove current data-query success, complete response fields or all layer combinations.
paths:
  /arcgis2/rest/services/DATA/OZP_PLAN_CSDI/FeatureServer/{layerId}/query:
    get:
      operationId: ArcgisFeatureServerQueryFeatures
      tags:
        - ArcGIS REST
      summary: Query published features
      description: Read-only GET query follows the source-advertised Query capability. One parameterized operation covers all queryable layers. Metadata field types are declared without inventing universally required attributes. Omitted f may produce the native REST default representation, which is not asserted as a JSON payload.
      parameters:
        - name: layerId
          in: path
          required: true
          description: Published queryable layer or table. Values are publisher identifiers; examples are choices, not a closed enumeration. The full ID/title directory is in x-csdi-layer-choices.
          schema:
            type: integer
          examples:
            choice1:
              summary: TPIS_ADM.OD_OZP_PLAN_CSDI
              value: 0
          x-choice-count: 1
        - name: f
          in: query
          required: false
          description: Advertised query representation. Supply this selector for the represented JSON/GeoJSON/PBF responses.
          schema:
            type: string
            enum:
              - json
              - geojson
              - pbf
          example: json
        - name: where
          in: query
          required: false
          description: SQL WHERE expression over the published fields; source protocol supports this read-only query filter.
          schema:
            type: string
          example: 1=1
        - name: outFields
          in: query
          required: false
          description: Comma-separated source field names, or *. Field schemas are conditional on the selected layer and returned fields.
          schema:
            type: string
          example: "*"
        - name: returnGeometry
          in: query
          required: false
          description: Whether native feature geometry should be included.
          schema:
            type: boolean
          example: false
        - name: resultRecordCount
          in: query
          required: false
          description: Bound returned records where the selected layer advertises pagination; no global range is inferred.
          schema:
            type: integer
          example: 1
          x-supported-layer-ids:
            - 0
      responses:
        "200":
          description: Native publisher response; protocol or business errors may also be returned. Metadata connection and actual data-query success are separate.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisJsonEnvelope"
            application/geo+json:
              schema:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisGeoJson"
            application/x-protobuf:
              schema:
                type: string
                format: binary
      externalDocs:
        url: https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/
      servers:
        - url: https://www.ozp.tpb.gov.hk
      x-native-source-evidence:
        - url: https://www.ozp.tpb.gov.hk/arcgis2/rest/services/DATA/OZP_PLAN_CSDI/FeatureServer?f=pjson
          sha256: 48731e49991c680ee3d0cce876e93fc08d98824614fca5a6a4c07315b475c004
          httpStatus: 200
          contentType: text/plain; charset=UTF-8
          role: arcgis-service
          parseStatus: pass
          kind: arcgis-service
        - url: https://www.ozp.tpb.gov.hk/arcgis2/rest/services/DATA/OZP_PLAN_CSDI/FeatureServer/0?f=pjson
          sha256: 63335514a63129c1143dbacef36e06201b19e93165cc5f99ed2975bc4ae83b61
          httpStatus: 200
          contentType: text/plain; charset=UTF-8
          role: arcgis-layer
          parseStatus: pass
          kind: arcgis-layer
components:
  schemas:
    ArcgisFeatureServerArcgisLayer0Attributes:
      type: object
      properties:
        OBJECTID:
          description: "Publisher field type: esriFieldTypeOID"
          title: OBJECTID
          type: integer
        PLAN_NO:
          description: "Publisher field type: esriFieldTypeString"
          title: PLAN_NO
          type:
            - string
            - "null"
          maxLength: 20
        NAME_ENG:
          description: "Publisher field type: esriFieldTypeString"
          title: NAME_ENG
          type:
            - string
            - "null"
          maxLength: 200
        NAME_CHT:
          description: "Publisher field type: esriFieldTypeString"
          title: NAME_CHT
          type:
            - string
            - "null"
          maxLength: 200
        PUB_DATE:
          description: "Publisher field type: esriFieldTypeDate; JSON wire representation remains unknown."
          title: PUB_DATE
        APRV_DATE:
          description: "Publisher field type: esriFieldTypeDate; JSON wire representation remains unknown."
          title: APRV_DATE
        SECT_NO:
          description: "Publisher field type: esriFieldTypeString"
          title: SECT_NO
          type:
            - string
            - "null"
          maxLength: 20
        PLAN_SCALE:
          description: "Publisher field type: esriFieldTypeInteger"
          title: PLAN_SCALE
          type:
            - integer
            - "null"
        GEOJSON_LINK:
          description: "Publisher field type: esriFieldTypeString"
          title: GEOJSON_LINK
          type:
            - string
            - "null"
          maxLength: 4000
        GML_LINK:
          description: "Publisher field type: esriFieldTypeString"
          title: GML_LINK
          type:
            - string
            - "null"
          maxLength: 4000
        SHP_LINK:
          description: "Publisher field type: esriFieldTypeString"
          title: SHP_LINK
          type:
            - string
            - "null"
          maxLength: 4000
        NAME_CHS:
          description: "Publisher field type: esriFieldTypeString"
          title: NAME_CHS
          type:
            - string
            - "null"
          maxLength: 200
        Shape__Area:
          description: "Publisher field type: esriFieldTypeDouble"
          title: SHAPE.STArea()
          type:
            - number
            - "null"
        Shape__Length:
          description: "Publisher field type: esriFieldTypeDouble"
          title: SHAPE.STLength()
          type:
            - number
            - "null"
      additionalProperties: true
    ArcgisFeatureServerArcgisFeatureSet:
      type: object
      properties:
        features:
          type: array
          items:
            type: object
            properties:
              attributes:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              geometry:
                description: Native geometry and spatial reference are not constrained by attribute metadata.
            additionalProperties: true
        exceededTransferLimit:
          type: boolean
      additionalProperties: true
    ArcgisFeatureServerArcgisGeoJson:
      type: object
      properties:
        type:
          type: string
        features:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              properties:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              geometry:
                description: Geometry representation is not constrained by the retained attribute metadata.
            additionalProperties: true
      additionalProperties: true
    ArcgisFeatureServerArcgisJsonEnvelope:
      type: object
      properties:
        type:
          type: string
        features:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              attributes:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              properties:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              geometry:
                description: Geometry is not constrained by attribute metadata.
            additionalProperties: true
        exceededTransferLimit:
          type: boolean
      additionalProperties: true
externalDocs:
  url: https://portal.csdi.gov.hk/csdi-webpage/doc/GeoSpatialServices
x-csdi-layer-choices:
  - id: 0
    title: TPIS_ADM.OD_OZP_PLAN_CSDI
    protocol: arcgis
x-csdi-source-evidence:
  - url: https://portal.csdi.gov.hk/geoportal/csw?service=CSW&version=2.0.2&request=GetRecordById&elementSetName=full&id=f5334b37-85de-557c-bcb6-fe7061b332bb
    sha256: 5422dc90d201288575a35a6f03720fae1f0161fc2e527878804e14eb2ef6aca5
    httpStatus: 200
    contentType: application/xml;charset=UTF-8
    role: csw-record
    parseStatus: pass
    kind: csw-record
  - url: https://www.ozp.tpb.gov.hk/arcgis2/rest/services/DATA/OZP_PLAN_CSDI/FeatureServer?f=pjson
    sha256: 48731e49991c680ee3d0cce876e93fc08d98824614fca5a6a4c07315b475c004
    httpStatus: 200
    contentType: text/plain; charset=UTF-8
    role: arcgis-service
    parseStatus: pass
    kind: arcgis-service
  - url: https://www.ozp.tpb.gov.hk/arcgis2/rest/services/DATA/OZP_PLAN_CSDI/FeatureServer/0?f=pjson
    sha256: 63335514a63129c1143dbacef36e06201b19e93165cc5f99ed2975bc4ae83b61
    httpStatus: 200
    contentType: text/plain; charset=UTF-8
    role: arcgis-layer
    parseStatus: pass
    kind: arcgis-layer
x-csdi-source-scope:
  partialProtocols: []
  nativeMetadataStatus:
    status: http_200_retained
    http200Sources: 3
  fullSourceCompleteness: not_established
  actualDataQueriesByConversion: 0
