Compare commits

...

3 Commits

6 changed files with 18 additions and 17 deletions

View File

@ -371,7 +371,7 @@ void QgsWfs3CollectionsHandler::handleRequest( const QgsServerApiContext &contex
} } }
},
{ "links", {
{ { "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::JSON ) ) }, { "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) }, { "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::GEOJSON ) }, { "title", title + " as GeoJSON" } }, { { "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::HTML ) ) }, { "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) }, { "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::HTML ) }, { "title", title + " as HTML" } } /* TODO: not sure what these "concepts" are about, neither if they are mandatory
{ { "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::GEOJSON ) ) }, { "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) }, { "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::GEOJSON ) }, { "title", title + " as GeoJSON" } }, { { "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::HTML ) ) }, { "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) }, { "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::HTML ) }, { "title", title + " as HTML" } } /* TODO: not sure what these "concepts" are about, neither if they are mandatory
{
{ "href", href( api, context.request(), QStringLiteral( "/%1/concepts" ).arg( shortName ) ) },
{ "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::item ) },
@ -442,9 +442,10 @@ void QgsWfs3DescribeCollectionHandler::handleRequest( const QgsServerApiContext
const std::string title { mapLayer->serverProperties()->wfsTitle().isEmpty() ? mapLayer->name().toStdString() : mapLayer->serverProperties()->wfsTitle().toStdString() };
const std::string itemsTitle { title + " items" };
const QString shortName { mapLayer->serverProperties()->shortName().isEmpty() ? mapLayer->name() : mapLayer->serverProperties()->shortName() };
const QString typeName = QString( shortName ).replace( ' ', '_' ).replace( ':', '-' ).replace( QChar( 0x2014 ) /* em-dash */, '-' );
json linksList = links( context );
linksList.push_back(
{ { "href", href( context, QStringLiteral( "/items" ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::JSON ) ) },
{ { "href", href( context, QStringLiteral( "/items" ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::GEOJSON ) ) },
{ "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) },
{ "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::GEOJSON ) },
{ "title", itemsTitle + " as " + QgsServerOgcApi::contentTypeToStdString( QgsServerOgcApi::ContentType::GEOJSON ) }
@ -460,7 +461,7 @@ void QgsWfs3DescribeCollectionHandler::handleRequest( const QgsServerApiContext
);
linksList.push_back(
{ { "href", parentLink( context.request()->url(), 3 ).toStdString() + "?request=DescribeFeatureType&typenames=" + QUrlQuery( shortName ).toString( QUrl::EncodeSpaces ).toStdString() + "&service=WFS&version=2.0"
{ { "href", parentLink( context.request()->url(), 3 ).toStdString() + "?request=DescribeFeatureType&typename=" + QUrlQuery( typeName ).toString( QUrl::EncodeSpaces ).toStdString() + "&service=WFS&version=2.0"
},
{ "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::describedBy ) },
{ "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::XML ) },

View File

@ -38,7 +38,7 @@ Content-Type: application/json
"type": "text/html"
},
{
"href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.json",
"href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.geojson",
"rel": "items",
"title": "A Layer1 with a short name items as GEOJSON",
"type": "application/geo+json"
@ -50,7 +50,7 @@ Content-Type: application/json
"type": "text/html"
},
{
"href": "http://server.qgis.org/?request=DescribeFeatureType&typenames=layer1_with_short_name&service=WFS&version=2.0",
"href": "http://server.qgis.org/?request=DescribeFeatureType&typename=layer1_with_short_name&service=WFS&version=2.0",
"rel": "describedBy",
"title": "Schema for A Layer1 with a short name",
"type": "application/xml"
@ -58,4 +58,4 @@ Content-Type: application/json
],
"timeStamp": "2019-07-05T12:27:07Z",
"title": "A Layer1 with a short name"
}
}

View File

@ -43,7 +43,7 @@ Content-Type: application/json
"type": "text/html"
},
{
"href": "http://server.qgis.org/wfs3/collections/points/items.json",
"href": "http://server.qgis.org/wfs3/collections/points/items.geojson",
"rel": "items",
"title": "points items as GEOJSON",
"type": "application/geo+json"
@ -55,7 +55,7 @@ Content-Type: application/json
"type": "text/html"
},
{
"href": "http://server.qgis.org/?request=DescribeFeatureType&typenames=points&service=WFS&version=2.0",
"href": "http://server.qgis.org/?request=DescribeFeatureType&typename=points&service=WFS&version=2.0",
"rel": "describedBy",
"title": "Schema for points",
"type": "application/xml"
@ -63,4 +63,4 @@ Content-Type: application/json
],
"timeStamp": "2019-07-05T12:27:07Z",
"title": "points"
}
}

View File

@ -27,11 +27,11 @@
<link rel="self" href="http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9.html" title="Feature collection as HTML" type="text/html">
<link rel="items" href="http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.json" title="A test wfs vector layer èé items as GEOJSON" type="application/geo+json">
<link rel="items" href="http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.geojson" title="A test wfs vector layer èé items as GEOJSON" type="application/geo+json">
<link rel="items" href="http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.html" title="A test wfs vector layer èé items as HTML" type="text/html">
<link rel="describedBy" href="http://server.qgis.org/?request=DescribeFeatureType&typenames=testlayer%20èé&service=WFS&version=2.0" title="Schema for A test wfs vector layer èé" type="application/xml">
<link rel="describedBy" href="http://server.qgis.org/?request=DescribeFeatureType&typename=testlayer%20èé&service=WFS&version=2.0" title="Schema for A test wfs vector layer èé" type="application/xml">
@ -113,7 +113,7 @@
<li><a rel="items" href="http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.json">A test wfs vector layer èé items as GEOJSON</a></li>
<li><a rel="items" href="http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.geojson">A test wfs vector layer èé items as GEOJSON</a></li>

View File

@ -38,7 +38,7 @@ Content-Type: application/json
"type": "text/html"
},
{
"href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.json",
"href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.geojson",
"rel": "items",
"title": "A test wfs vector layer èé items as GEOJSON",
"type": "application/geo+json"
@ -50,7 +50,7 @@ Content-Type: application/json
"type": "text/html"
},
{
"href": "http://server.qgis.org/?request=DescribeFeatureType&typenames=testlayer%20èé&service=WFS&version=2.0",
"href": "http://server.qgis.org/?request=DescribeFeatureType&typename=testlayer%20èé&service=WFS&version=2.0",
"rel": "describedBy",
"title": "Schema for A test wfs vector layer èé",
"type": "application/xml"

View File

@ -29,7 +29,7 @@ Content-Type: application/json
"id": "testlayer èé",
"links": [
{
"href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.json",
"href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.geojson",
"rel": "items",
"title": "A test wfs vector layer èé as GeoJSON",
"type": "application/geo+json"
@ -70,7 +70,7 @@ Content-Type: application/json
"id": "layer1_with_short_name",
"links": [
{
"href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.json",
"href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.geojson",
"rel": "items",
"title": "A Layer1 with a short name as GeoJSON",
"type": "application/geo+json"
@ -187,4 +187,4 @@ Content-Type: application/json
}
],
"timeStamp": "2019-07-05T12:27:07Z"
}
}