I have a queryable API that returns one or more GeoJSON FeatureCollections. Currently the response looks something like this:
{
"success": {
"data": {
"layer1": {"type": "FeatureCollection"....},
"layer2": {"type": "FeatureCollection"....}
}
}
However, while trying to view the results in QGIS I realized this might not be the best approach (as QGIS doesn't allow you to specify an access key when adding a GeoJSON layer via a URI). I think this is generally a sensible design, except that I can't find any other examples of returning GeoJSON as part of a larger JSON structure.
Is there anything wrong with a GeoJSON feature (specifically a FeatureCollection, but really any type) being part of another "document"?
Though GeoJSON is JSON, I can also see a strong argument that if a user requests a resource as GeoJSON, it is rational to expect a valid GeoJSON document in return.