Table of Contents

OGC API

Introduction

OGC API allows users to find out the geographical features of a farm. With the help of the OGC API, users can find out the boundary, center point, bounding box, etc. of a holding, plot or land cover. The OGC API has three endpoints namely, Collections, OGC and Conformance.

Collections - The collections endpoint helps you get a list of all feature collections specified in a standard that the server conforms to or metadata describing the collections of data available from Pure Farming's OCG API.

OGC - The OGC endpoint provides information on the landing page that has the links to the API definition, the conformance statements and to the feature collection in the data set.

Conformance - This endpoint provides information about the standards that the OGC API conforms to. The OGC API is based on the REST standard, where URLs represent data, and actions on the data are performed using HTTP verbs (Such as GET for retrieving data and POST for creating data). Any programming language capable of performing HTTPs requests can be used. Data returned from API uses the JSON standard.

OGC API - Features

Pure Farming provides an API which complies with the OGC Features API, which is a multi-part standard.
This allows for querying spatial data as well as laying out guidelines and standards for APIs that seek to share feature data in a consistent manner.

The Pure Farming OGC compliant API allows users to access collections of geographical data representing resource types of holdings, land-covers, and plots.

The API may be used un-authenticated but in order to retrieve any meaningful data from it you must be authenticated. The Pure Farming OGC Features compliant API uses OAuth 2.0 for authentication, see authentication for more details.

If you are authenticated, you will also get additional sub-collections of data depending on the different holdings, land-covers, and plots that you have access to.

To learn more about the OGC API - Features standard, you can visit their website at https://ogcapi.ogc.org/features/.


Static Endpoints

  • Root Page
    OGC provides links to the API definition, conformance and collections endpoints.

    GET /ogc
    
  • Conformance
    Conformance provides links to the standards that Pure Farming's OCG API conforms to.

    GET /ogc/conformance
    
  • Collections
    Collections provides a list of geographic data for holdings, plots and land-covers.

    GET /ogc/collections
    

Dynamic Endpoints

The /ogc/collections endpoint is dynamic, in that if you are authenticated it will return further collections that relate to individual holdings should you wish to only use those.

For more information please look at the collections documentation for all the relevant endpoints.

For example, if you are unauthenticated or didn't have access to any holdings, you would be returned this:

{
  "links": [
    {
      "href":"https://api.purefarming.com/ogc/collections",
      "rel":"self",
      "type":"application/json",
      "hreflang":"en"
    }
  ],
  "collections": [
    {
      "id":"holdings",
      "links": [
        {
          "href":"https://api.purefarming.com/ogc/collections/holdings",
          "rel":"collection",
          "type":"application/json",
          "hreflang":"en",
          "title":"holdings"
        },
        {
          "href":"https://api.purefarming.com/ogc/collections/holdings/items",
          "rel":"items",
          "type":"application/geo+json",
          "hreflang":"en",
          "title":"holdings"
        }
      ]
    },
    ...
  ]
}

Whereas if you were authenticated (and had access to one or more holdings), you would see something like the following:

{
  "links": [
    {
      "href":"https://api.purefarming.com/ogc/collections",
      "rel":"self",
      "type":"application/json",
      "hreflang":"en"
    }
  ],
  "collections": [
    {
      "id":"holdings",
      "links": [
        {
          "href":"https://api.purefarming.com/ogc/collections/holdings",
          "rel":"collection",
          "type":"application/json",
          "hreflang":"en",
          "title":"holdings"
        },
        {
          "href":"https://api.purefarming.com/ogc/collections/holdings/items",
          "rel":"items",
          "type":"application/geo+json",
          "hreflang":"en",
          "title":"holdings"
        }
      ]
    },
    {
      "id": "holdings/a50a28ce-ff23-49e9-8d84-a60869de2096/collections/plots",
      "links": [
        {
          "href": "https://api.purefarming.com/ogc/collections/holdings/items/a50a28ce-ff23-49e9-8d84-a60869de2096",
          "rel": "items",
          "type": "application/geo+json",
          "hreflang": "en",
          "title": "holdings"
        },
        {
	  "href": "https://api.purefarming.com/ogc/collections/holdings/a50a28ce-ff23-49e9-8d84-a60869de2096/collections/plots",
          "rel": "collection",
          "type": "application/json",
          "hreflang": "en",
          "title": "plots-for-a50a28ce-ff23-49e9-8d84-a60869de2096"
        },
        {
          "href": "https://api.purefarming.com/ogc/collections/holdings/a50a28ce-ff23-49e9-8d84-a60869de2096/collections/plots/items",
          "rel": "items",
          "type": "application/geo+json",
	  "hreflang": "en",
	  "title": "plots-for-a50a28ce-ff23-49e9-8d84-a60869de2096"
	}
      ]
    },
    ...
  ]
}