opengeospatial / ideas

Public repository for Innovation Program Ideas
20 stars 3 forks source link

OpenAPI-based Coordinate Reference System (CRS) Resolver API #108

Open ghobona opened 4 years ago

ghobona commented 4 years ago

To give client applications options for which CRS definition servers to use, it may be necessary to offer a CRS Resolver API that allows them to choose the server to retrieve definitions from.

Using OpenAPI, such a CRS Resolver API could be defined as shown in this example.

The source code for the API document is below.

openapi: 3.0.0
info:
  description: |
    This is a sample server for retrieving definitions of EPSG-registered Coordinate Reference Systems (CRS) from different 3rd party servers.
  version: "1.0.0"
  title: CRS Resolver API
  termsOfService: 'http://swagger.io/terms/'
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
servers:
  - description: OGC CRS Resolver
    url: https://www.opengis.net/def
paths:
  /crs/{sourceId}/{verId}/{crsId}:
    get:
      tags:
      - "CRS"
      summary: "Find CRS by ID"
      description: "Returns a single CRS"
      operationId: "getCRSById"
      parameters:
      - name: "sourceId"
        in: "path"
        schema:
           type: string
           enum: [EPSG, OGC]
        required: true      
      - name: "verId"
        in: "path"
        description: "ID of version to return"
        required: true
        schema:
           type: integer        
      - name: "crsId"
        in: "path"
        description: "ID of crs to return"
        required: true
        schema:
           type: string       
      - name: "server"
        in: "header"
        schema:
           type: string        
           enum: [epsg.org, secore]
        required: true
      responses:
        200:
          description: "successful operation"
        400:
          description: "Invalid ID supplied"
        404:
          description: "CRS not found"