1.. _vector.oapif:
2
3OGC API - Features
4==================
5
6.. versionadded:: 2.3
7
8.. shortname:: OAPIF
9
10.. build_dependencies:: libcurl
11
12This driver can connect to a OGC API - Features service. It assumes that the
13service supports OpenAPI 3.0/JSON/GeoJSON encoding for respectively API
14description, feature collection metadata and feature collection data.
15
16.. note::
17
18    In versions prior to GDAL 3.1, this driver was called the WFS3 driver, and
19    only supported draft versions of the specification.
20
21Driver capabilities
22-------------------
23
24.. supports_georeferencing::
25
26Dataset name syntax
27-------------------
28
29The syntax to open a OGC API - Features datasource is :
30*OAPIF:http://path/to/OAPIF/endpoint*
31
32where endpoint is the landing page or a the path to collections/{id}.
33
34Layer schema
35------------
36
37OGR needs a fixed schema per layer, but OGC API - Features Core doesn't impose
38fixed schema. So the driver will retrieve the first page of features (10
39features) and establish a schema from this.
40
41Filtering
42---------
43
44The driver will forward any spatial filter set with SetSpatialFilter()
45to the server. In OGC API - Features Core, only a subset of attributes allowed by
46the server can be queried for equalities, potentially combined with a
47AND logical operator. More complex requests will be partly or completely
48evaluated on client-side.
49
50Rectangular spatial filtering is forward to the server as well.
51
52Open options
53------------
54
55The following options are available:
56
57-  **URL**\ =url: URL to the OGC API - Features server landing page, or to a given collection.
58   Required when using the "OAPIF:" string as the connection string.
59-  **PAGE_SIZE**\ =integer: Number of features to retrieve per request.
60   Defaults to 10. Minimum is 1, maximum 10000.
61-  **USERPWD**: May be supplied with *userid:password* to pass a userid
62   and password to the remote server.
63-  **IGNORE_SCHEMA**\ = YES/NO. (GDAL >= 3.1) Set to YES to ignore the XML
64   Schema or JSON schema that may be offered by the server.
65
66Examples
67--------
68
69-  Listing the types of a OGC API - Features server :
70
71   ::
72
73      $ ogrinfo OAPIF:https://www.ldproxy.nrw.de/rest/services/kataster
74
75      INFO: Open of `OAPIF:https://www.ldproxy.nrw.de/rest/services/kataster'
76            using driver `OAPIF' successful.
77      1: flurstueck (Multi Polygon)
78      2: gebaeudebauwerk (Multi Polygon)
79      3: verwaltungseinheit (Multi Polygon)
80
81-  Listing the summary information of a OGC API - Features layer :
82
83   ::
84
85      $ ogrinfo -al -so OAPIF:https://www.ldproxy.nrw.de/rest/services/kataster flurstueck
86
87      Layer name: flurstueck
88      Metadata:
89        TITLE=Flurstück
90      Geometry: Multi Polygon
91      Feature Count: 9308456
92      Extent: (5.612726, 50.237351) - (9.589634, 52.528630)
93      Layer SRS WKT:
94      GEOGCS["WGS 84",
95          DATUM["WGS_1984",
96              SPHEROID["WGS 84",6378137,298.257223563,
97                  AUTHORITY["EPSG","7030"]],
98              AUTHORITY["EPSG","6326"]],
99          PRIMEM["Greenwich",0,
100              AUTHORITY["EPSG","8901"]],
101          UNIT["degree",0.0174532925199433,
102              AUTHORITY["EPSG","9122"]],
103          AUTHORITY["EPSG","4326"]]
104      id: String (0.0)
105      aktualit: Date (0.0)
106      flaeche: Real (0.0)
107      flstkennz: String (0.0)
108      land: String (0.0)
109      gemarkung: String (0.0)
110      flur: String (0.0)
111      flurstnr: String (0.0)
112      gmdschl: String (0.0)
113      regbezirk: String (0.0)
114      kreis: String (0.0)
115      gemeinde: String (0.0)
116      lagebeztxt: String (0.0)
117      tntxt: String (0.0)
118
119-  Filtering on a property (depending on if the server exposes filtering capabilities of the properties, part or totally of the filter might be evaluated on client side)
120
121   ::
122
123
124      $ ogrinfo OAPIF:https://www.ldproxy.nrw.de/rest/services/kataster flurstueck -al -q -where "flur = '028'"
125      Layer name: flurstueck
126      Metadata:
127        TITLE=Flurstück
128      OGRFeature(flurstueck):1
129        id (String) = DENW19AL0000geMFFL
130        aktualit (Date) = 2017/04/26
131        flaeche (Real) = 1739
132        flstkennz (String) = 05297001600193______
133        land (String) = Nordrhein-Westfalen
134        gemarkung (String) = Wünnenberg
135        flur (String) = 016
136        flurstnr (String) = 193
137        gmdschl (String) = 05774040
138        regbezirk (String) = Detmold
139        kreis (String) = Paderborn
140        gemeinde (String) = Bad Wünnenberg
141        lagebeztxt (String) = Bleiwäscher Straße
142        tntxt (String) = Platz / Parkplatz;1739
143        MULTIPOLYGON (((8.71191 51.491084,8.7123 51.491067,8.712385 51.491645,8.712014 51.491666,8.711993 51.491603,8.71196 51.491396,8.711953 51.491352,8.71191 51.491084)))
144
145      [...]
146
147-  Spatial filtering
148
149   ::
150
151      $ ogrinfo OAPIF:https://www.ldproxy.nrw.de/rest/services/kataster flurstueck -al -q -spat 8.7 51.4 8.8 51.5
152
153      Layer name: flurstueck
154      Metadata:
155        TITLE=Flurstück
156      OGRFeature(flurstueck):1
157        id (String) = DENW19AL0000ht7LFL
158        aktualit (Date) = 2013/02/19
159        flaeche (Real) = 18
160        flstkennz (String) = 05292602900206______
161        land (String) = Nordrhein-Westfalen
162        gemarkung (String) = Fürstenberg
163        flur (String) = 029
164        flurstnr (String) = 206
165        gmdschl (String) = 05774040
166        regbezirk (String) = Detmold
167        kreis (String) = Paderborn
168        gemeinde (String) = Bad Wünnenberg
169        lagebeztxt (String) = Karpke
170        tntxt (String) = Fließgewässer / Bach;18
171        MULTIPOLYGON (((8.768521 51.494915,8.768535 51.494882,8.768569 51.494908,8.768563 51.494925,8.768521 51.494915)))
172      [...]
173
174See Also
175--------
176
177-  `"OGC API - Features - Part 1: Core" Standard
178   <http://docs.opengeospatial.org/is/17-069r3/17-069r3.html>`__
179-  :ref:`WFS (1.0,1.1,2.0) driver documentation <vector.wfs>`
180