OGC API资源-功能¶
本节提供有关OGC API-Feature提供的资源类型的基本信息。
每个资源都提供 链接 相关资源。这使客户端应用程序能够导航资源,从登录页面一直导航到各个功能。服务器通过以下方式标识资源和其他链接资源之间的关系 链接关系类型 ,由属性‘rel’表示。类的实现使用的链接关系类型。 OGC API - Features - Part 1: Core 可在以下位置找到 Section 5.2 标准的标准。
登录页¶
登录页是充当入口点的顶级资源。客户端应用程序需要知道服务器登录页面的位置。然后,客户端应用程序可以从登录页检索到一致性声明、集合和API定义路径的链接。登录页面的示例是https://services.interactive-instruments.de/t15/daraa?f=json
通过“service-desc”和“service-doc”链接关系类型标识到API定义的链接。
指向一致性声明的链接通过“一致性”链接关系类型标识。
指向集合的链接通过“data”链接关系类型标识。
演示服务器登录页面的摘录如下所示。
{
"title" : "Daraa",
"description" : "This is a test dataset from the Open Portrayal Framework thread of the OGC Testbed-15 initiative.",
"links" : [ {
"rel" : "self",
"type" : "application/json",
"title" : "This document",
"href" : "https://services.interactive-instruments.de/t15/daraa?f=json"
}, {
"rel" : "service-desc",
"type" : "application/vnd.oai.openapi+json;version=3.0",
"title" : "Formal definition of the API in OpenAPI 3.0",
"href" : "https://services.interactive-instruments.de/t15/daraa/api?f=json"
}, {
"rel" : "conformance",
"title" : "OGC API conformance classes implemented by this server",
"href" : "https://services.interactive-instruments.de/t15/daraa/conformance"
}, {
"rel" : "data",
"title" : "Access the data",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections"
}
]
}
一致性声明¶
OGC API-Feature的实现通过声明它实现了哪些一致性类来描述它支持的功能。一致性声明声明API遵循的标准或社区规范(由URI标识)中的一致性类。然后,客户端可以使用此信息,尽管不要求它们这样做。使用HTTP get访问一致性声明将返回服务器实现的一致性类的URI列表。一致性类描述服务器为满足标准中指定的一组或多组要求而应实现的行为。
下面是对请求https://services.interactive-instruments.de/t15/daraa/conformance?f=json的响应的摘录
请注意,该示例显示了一个名为“Alternate”的链接关系类型,它标识了一种检索资源提供的信息的替代表示形式的方法。在本例中,“替代”链接关系引用一致性声明的HTML表示形式。
{
"links" : [ {
"rel" : "self",
"type" : "application/json",
"title" : "This document",
"href" : "https://services.interactive-instruments.de/t15/daraa/conformance?f=json"
}, {
"rel" : "alternate",
"type" : "text/html",
"title" : "This document as HTML",
"href" : "https://services.interactive-instruments.de/t15/daraa/conformance?f=html"
} ],
"conformsTo" : [ "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson", "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/html", "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30", "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core" ]
}
要素集合¶
通过实施 OGC API - Features - Part 1: Core 被组织到一个或多个要素集合中。“集合”资源提供有关集合列表的信息和对集合列表的访问权限。
对于每个集合,都有指向集合详细描述的链接(由路径表示 /collections/{{collectionId}} 和链接关系 self )。
对于每个集合,都有指向集合中要素的链接(由路径表示 /collections/{{collectionId}}/items 和链接关系 项目 )和有关该集合的其他信息。服务器提供以下信息来描述每个集合:
集合的本地标识符,该标识符对于数据集是唯一的
可由服务器返回几何的坐标参考系(CRS)列表
集合的可选标题和说明
可用于指示集合的空间和时间范围的可选范围
关于集合中项目类型的可选指示符(如果未提供该指示符,则默认值为“Feature”)。
下面是对请求https://services.interactive-instruments.de/t15/daraa/collections?f=json的响应的摘录
{
"title" : "Daraa",
"description" : "This is a test dataset from the Open Portrayal Framework thread of the OGC Testbed-15 initiative",
"links" : [ {
"rel" : "self",
"type" : "application/json",
"title" : "This document",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections?f=json"
}],
"collections" : [ {
"title" : "Aeronautic (Curves)",
"description" : "Aeronautical Facilities: Information about an area specifically designed and constructed for landing, accommodating, and launching military and/or civilian aircraft, rockets, missiles and/or spacecraft.<br/>Aeronautical Aids to Navigation: Information about electronic equipment, housings, and utilities that provide positional information for direction or otherwise assisting in the navigation of airborne aircraft.",
"links" : [{
"rel" : "self",
"title" : "The 'Aeronautic (Curves)' feature collection",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv"
}, {
"rel" : "items",
"type" : "application/geo+json",
"title" : "Access the features in the collection 'Aeronautic (Curves)'",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items?f=json"
}],
"id" : "AeronauticCrv",
"extent" : {
"spatial" : {
"bbox" : [ [ 36.395158, 32.6933011, 36.4308137, 32.7173334 ] ],
"crs" : "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
},
"crs" : [ "#/crs" ],
"storageCrs" : "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}, {
"title" : "Other (Points)",
"links" : [{
"rel" : "self",
"title" : "The 'Other (Points)' feature collection",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections/o2s_p"
}, {
"rel" : "items",
"type" : "application/geo+json",
"title" : "Access the features in the collection 'Other (Points)'",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections/o2s_p/items?f=json"
}],
"id" : "o2s_p",
"extent" : {
"spatial" : {
"bbox" : [ [ 35.9396036, 32.5449626, 36.443695, 32.9846485 ] ],
"crs" : "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
},
"crs" : [ "#/crs" ],
"storageCrs" : "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
} ]
}
要素集合¶
这个 集合 资源提供有关请求中标识的集合的详细信息。
下面是对请求https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/?f=json的响应的摘录
{
"title" : "Aeronautic (Curves)",
"description" : "Aeronautical Facilities: Information about an area specifically designed and constructed for landing, accommodating, and launching military and/or civilian aircraft, rockets, missiles and/or spacecraft.<br/>Aeronautical Aids to Navigation: Information about electronic equipment, housings, and utilities that provide positional information for direction or otherwise assisting in the navigation of airborne aircraft.",
"links" : [ {
"rel" : "self",
"type" : "application/json",
"title" : "This document",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv?f=json"
}, {
"rel" : "items",
"type" : "application/geo+json",
"title" : "Access the features in the collection 'Aeronautic (Curves)'",
"href" : "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items?f=json"
} ],
"id" : "AeronauticCrv",
"extent" : {
"spatial" : {
"bbox" : [ [ 36.395158, 32.6933011, 36.4308137, 32.7173334 ] ],
"crs" : "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
},
"temporal" : {
"interval" : [ [ null, null ] ],
"trs" : "http://www.opengis.net/def/uom/ISO-8601/0/Gregorian"
}
},
"crs" : [ "http://www.opengis.net/def/crs/OGC/1.3/CRS84", "http://www.opengis.net/def/crs/EPSG/0/3395", "http://www.opengis.net/def/crs/EPSG/0/3857", "http://www.opengis.net/def/crs/EPSG/0/4326" ],
"storageCrs" : "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
功能¶
Feature资源返回由请求中标识的集合包含的功能组成的文档。响应中包括的特征由服务器基于请求的查询参数来确定。为了支持在不过载客户端的情况下访问较大的集合,如果选择的功能多于页面大小,则API支持带下一页链接的分页访问。
下面是对请求https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items?f=json的响应的摘录
{
"type": "FeatureCollection",
"links": [],
"numberReturned": 10,
"numberMatched": 20,
"timeStamp": "2020-07-23T17:58:40Z",
"features": [{
"type": "Feature",
"id": "1",
"geometry": {
"type": "MultiLineString",
"coordinates": [[[36.4251993, 32.7137029], [36.4270026, 32.7114543]]]
},
"properties": {
"F_CODE": "GB075",
"ZI001_SDV": "2011-03-16T14:51:12Z",
"UFI": "2d008c34-4458-4226-b335-cf903d261ce9",
"ZI005_FNA": "No Information",
"FCSUBTYPE": 100454
}
}, {
"type": "Feature",
"id": "2",
"geometry": {
"type": "MultiLineString",
"coordinates": [[[36.4252966, 32.7137689], [36.4251993, 32.7137029], [36.4231106, 32.7125398], [36.4208881, 32.7113022], [36.4031334, 32.7013331], [36.400909, 32.700077]]]
},
"properties": {
"F_CODE": "GB075",
"ZI001_SDV": "2015-09-11T19:15:35Z",
"UFI": "1257bf27-3f91-461d-8a3b-a95af2ea1f5a",
"ZI005_FNA": "No Information",
"FCSUBTYPE": 100454
}
}]
}
请注意,本文档是有效的GeoJSON文档。
可以使用附加参数来仅选择集合中的特征子集。
A bbox 或 日期时间 参数可用于仅选择集合中位于 bbox 参数指定的时间间隔或 日期时间 参数。一个示例请求,该请求使用 bbox 参数为https://services.interactive-instruments.de/t15/daraa/collections/VegetationSrf/items?f=json&bbox=36.0832432,32.599852,36.1168237,32.6283697
这个 限制 参数可用于通过指定响应中应返回的最大功能数来控制页面大小。一个示例请求,该请求使用 限制 参数为https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items?f=json&limit=2
每个页面可以包括关于选择和返回的特征的数量的信息(‘number Matching’和‘number Returned’)以及支持分页的链接(链接关系‘Next’)。
功能¶
特征资源用于检索单个特征、其几何表示和其他属性。在下面的示例中,检索了‘id’为1的要素。通过请求https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items/1?f=json检索响应
{
"type": "Feature",
"links": [{
"href": "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items/1?f=json",
"rel": "self",
"type": "application/geo+json",
"title": "This document"
}, {
"href": "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv/items/1?f=html",
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML"
}, {
"href": "https://services.interactive-instruments.de/t15/daraa/collections/AeronauticCrv?f=json",
"rel": "collection",
"type": "application/json",
"title": "The collection the feature belongs to"
}],
"id": "1",
"geometry": {
"type": "MultiLineString",
"coordinates": [[[36.4251993, 32.7137029], [36.4270026, 32.7114543]]]
},
"properties": {
"F_CODE": "GB075",
"ZI001_SDV": "2011-03-16T14:51:12Z",
"UFI": "2d008c34-4458-4226-b335-cf903d261ce9",
"ZI005_FNA": "No Information",
"FCSUBTYPE": 100454
}
}