[gdal-dev] OAPIF endpoint and trailing slash

Even Rouault even.rouault at spatialys.com
Mon Dec 16 09:14:08 PST 2019


Jukka,

> In the OGC API Features standard
> http://docs.opengeospatial.org/is/17-069r3/17-069r3.html#_http_uris the
> landing page is defined as "The entry point is a Landing page (path /)"
> 
> I read this so that the landing page is "base URL followed by slash"

No, I don't think this must be interpreted as it. Here "path /" is a short way 
of telling the root of the service, but the URL of a OAPIF landing page may or 
may not terminate by slash depending on server implementation tastes.

> That request works OK with this server and so does work the next request
> that ogrinfo generates even if has now two slashes in a row in the middle
> or the URL

OK, I've fixed that. Due to the driver taking shortcut to create the
/collections URL. Normally it should retrieve it from the landing page

> Reference to corresponding part of http standard would be appreciated.

I've no idea what HTTP standard(s) stay about that. Hopefully the above 
mentionned fix should avoid reading them :-)

> Finally I do not understand why using direct URL to a collection work for
> but not for our server
> ogrinfo
> oapif:https://beta-paikkatieto.maanmittauslaitos.fi/maastotiedot_100k/wfs3/
> v1/collections/rautatiepiste
> 

I cannot access at all
oapif:https://beta-paikkatieto.maanmittauslaitos.fi/maastotiedot_100k/wfs3/v1

But tring similarly with
oapif:https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/wfs3/v1/
collections/placenames

the issue is that the answer returned by the server does not follow the right 
schema.
It returns a "collections" array, whereas it should directly return the item 
contained in this array.

So instead of

{
  "links" : [ {
    "href" : "https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/
wfs3/v1/collections/placenames",
    "rel" : "self",
    "type" : "application/json",
    "title" : "This document"
  } ],
  "collections" : [ {
    "name" : "placenames",
    "title" : "PlaceNames",
    "description" : "NLS Finland GNR: Place names",
    "links" : [ {
      "href" : "https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/wfs3/v1/collections/placenames/items",
      "rel" : "item",
      "type" : "application/geo+json"
    } ],
    "crs" : [ "http://www.opengis.net/def/crs/EPSG/0/3067", "http://
www.opengis.net/def/crs/EPSG/0/4258", "http://www.opengis.net/def/crs/OGC/1.3/
CRS84", "http://www.opengis.net/def/crs/EPSG/0/3046", "http://www.opengis.net/
def/crs/EPSG/0/3047", "http://www.opengis.net/def/crs/EPSG/0/3048", "http://
www.opengis.net/def/crs/EPSG/0/3873", "http://www.opengis.net/def/crs/EPSG/
0/3874", "http://www.opengis.net/def/crs/EPSG/0/3875", "http://
www.opengis.net/def/crs/EPSG/0/3876", "http://www.opengis.net/def/crs/EPSG/
0/3877", "http://www.opengis.net/def/crs/EPSG/0/3878", "http://
www.opengis.net/def/crs/EPSG/0/3879", "http://www.opengis.net/def/crs/EPSG/
0/3880", "http://www.opengis.net/def/crs/EPSG/0/3881", "http://
www.opengis.net/def/crs/EPSG/0/3882", "http://www.opengis.net/def/crs/EPSG/
0/3883", "http://www.opengis.net/def/crs/EPSG/0/3884", "http://
www.opengis.net/def/crs/EPSG/0/3885" ]
  } ]

it should returns somelink:

{
    "name" : "placenames",
    "title" : "PlaceNames",
    "description" : "NLS Finland GNR: Place names",
    "links" : [ {
      "href" : "https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/wfs3/v1/collections/placenames/items",
      "rel" : "item",
      "type" : "application/geo+json"
    } ],
    "crs" : [ "http://www.opengis.net/def/crs/EPSG/0/3067", "http://
www.opengis.net/def/crs/EPSG/0/4258", "http://www.opengis.net/def/crs/OGC/1.3/
CRS84", "http://www.opengis.net/def/crs/EPSG/0/3046", "http://www.opengis.net/
def/crs/EPSG/0/3047", "http://www.opengis.net/def/crs/EPSG/0/3048", "http://
www.opengis.net/def/crs/EPSG/0/3873", "http://www.opengis.net/def/crs/EPSG/
0/3874", "http://www.opengis.net/def/crs/EPSG/0/3875", "http://
www.opengis.net/def/crs/EPSG/0/3876", "http://www.opengis.net/def/crs/EPSG/
0/3877", "http://www.opengis.net/def/crs/EPSG/0/3878", "http://
www.opengis.net/def/crs/EPSG/0/3879", "http://www.opengis.net/def/crs/EPSG/
0/3880", "http://www.opengis.net/def/crs/EPSG/0/3881", "http://
www.opengis.net/def/crs/EPSG/0/3882", "http://www.opengis.net/def/crs/EPSG/
0/3883", "http://www.opengis.net/def/crs/EPSG/0/3884", "http://
www.opengis.net/def/crs/EPSG/0/3885" ]
  }

Note: the "name" member is something from draft. The final spec uses "id" (but 
the driver has still some backward compatibility hacks for that)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list