Aller au contenu

Publication en téléchargement

Configuration de la diffusion

La configuration centralise toutes les informations nécessaires à la diffusion de données sur les services. A ce moment, on va contrôler les paramètres et détecter les erreurs ou conflits potentiels :

  • nom de couche déjà pris (il doit y avoir unicité sur toutes les configurations DOWNLOAD de la plateforme)
  • doublon dans le nom des sous-couches (si on veut diffuser plusieurs données ARCHIVE au sein d'une même configuration)
/datastores/{datastore}/configurations
{
    "type": "DOWNLOAD",
    "name": "Limites administratives",
    "layer_name": "limites_administratives",
    "type_infos": {
        "title": "Limites administratives",
        "abstract": "Limites administratives, au format Shapefile, sur la France métropolitaine",
        "used_data": [
            {
                "sub_name": "departements",
                "title": "Données départementales",
                "abstract": "Départements et limites départementales, au format Shapefile, sur la France métropolitaine",
                "zone": "France métropolitaine",
                "format": "Shapefile",
                "stored_data": "{stored data}"
            }
        ]
    }
}
{
    "name": "Limites administratives",
    "layer_name": "limites_administratives",
    "type": "DOWNLOAD",
    "status": "UNPUBLISHED",
    "tags": {},
    "_id": "{configuration}",
    "metadata": [],
    "type_infos": {
        "title": "Limites administratives",
        "used_data": [
            {
                "sub_name": "departements",
                "title": "Données départementales",
                "format": "Shapefile",
                "zone": "France métropolitaine",
                "stored_data": "{stored data}",
                "abstract": "Départements et limites départementales, au format Shapefile, sur la France métropolitaine"
            }
        ],
        "abstract": "Limites administratives, au format Shapefile, sur la France métropolitaine"
    }
}

Si on ne précise pas de titre ou de résumé pour la donnée stockée diffusée, ce sera son nom qui sera utilisé.

Publication

À ce stade, aucune information n'a été envoyée aux serveurs de téléchargement assurant la diffusion. Cette synchronisation de la configuration sur les serveurs de diffusion, représentés par le point d'accès, se fait via la création d'une offre: la publication. Elle matérialise la présence d'une configuration sur un point d'accès.

Consultation des points de diffusion disponibles

/datastores/{datastore}

C'est le point d'accès de type DOWNLOAD qui va nous intéresser.

Création de l'offre

/datastores/{datastore}/configurations/{configuration}/offerings
{
    "visibility": "PRIVATE",
    "endpoint": "ae042611-13eb-4a18-8d04-9b7604a031cc",
    "open": true
}
{
    "visibility": "PRIVATE",
    "open": true,
    "available": true,
    "layer_name": "limites_administratives",
    "type": "DOWNLOAD",
    "status": "PUBLISHED",
    "configuration": {
        "name": "Limites administratives",
        "status": "PUBLISHED",
        "_id": "{configuration}"
    },
    "endpoint": {
        "name": "gpf-download",
        "_id": "ae042611-13eb-4a18-8d04-9b7604a031cc"
    },
    "urls": [],
    "_id": "{offering}"
}

Consultation du service de téléchargement

En consultant les capacités du service de téléchargement, on retrouve notre couche (on demande ici la réponse en JSON, c'est le format XML Atom par défaut).

https://data-qua.priv.geopf.fr/telechargement/capabilities
  • Accept = application/json
{
    "lang": "eng",
    "page": 0,
    "pagesize": 2147483647,
    "pagecount": 1,
    "totalentries": 13,
    "title": "The Title",
    "subtitle": "The subtitle",
    "id": "https://data-qua.priv.geopf.fr/telechargement/capabilities",
    "rights": "the rights",
    "updated": "2023-03-27T00:00:00Z",
    "author": {
        "name": "The author",
        "email": "author@example.com"
    },
    "link": [
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/capabilities?lang=fra",
            "hreflang": "fra",
            "rel": "alternate",
            "type": "application/atom+xml",
            "title": "Le titre"
        },
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/capabilities?lang=eng",
            "hreflang": "eng",
            "rel": "alternate",
            "type": "application/atom+xml",
            "title": "The Title"
        },
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/capabilities",
            "rel": "self",
            "type": "application/atom+xml",
            "title": "This document"
        }
    ],
    "entry": [
        ...
        {
            "title": "Limites administratives",
            "id": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives",
            "summary": "Limites administratives, au format Shapefile, sur la France métropolitaine",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives",
                    "rel": "alternate",
                    "type": "application/atom+xml"
                }
            ],
            "category": [
                {
                    "term": "https://epsg.io/2154",
                    "label": "EPSG:2154"
                }
            ],
            "zone": [
                {
                    "term": "France métropolitaine",
                    "label": "France métropolitaine"
                }
            ],
            "format": [
                {
                    "term": "Shapefile",
                    "label": "Shapefile"
                }
            ]
        }
        ...
    ]
}

Si on veut avoir le contenu de notre ressource de téléchargement limites_administratives, on suit le lien dans l'entrée, c'est à dire les sous-ressources. Dans notre cas, on a une seule sous ressource, departements.

https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives
  • Accept = application/json
{
    "lang": "eng",
    "page": 0,
    "pagesize": 1,
    "pagecount": 1,
    "totalentries": 1,
    "title": "Limites administratives",
    "subtitle": "Limites administratives, au format Shapefile, sur la France métropolitaine",
    "id": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives",
    "link": [
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives?lang=default",
            "hreflang": "default",
            "rel": "alternate",
            "type": "application/atom+xml",
            "title": "Limites administratives"
        },
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives",
            "rel": "self",
            "type": "application/atom+xml",
            "title": "This document"
        },
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/capabilities",
            "rel": "up",
            "type": "application/atom+xml"
        }
    ],
    "entry": [
        {
            "title": "Données départementales",
            "id": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives/departements",
            "summary": "Départements et limites départementales, au format Shapefile, sur la France métropolitaine",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives/departements",
                    "rel": "section",
                    "type": "application/atom+xml",
                    "title": "Données départementales"
                }
            ],
            "category": [
                {
                    "term": "https://epsg.io/2154",
                    "label": "EPSG:2154"
                }
            ],
            "zone": [
                {
                    "term": "France métropolitaine",
                    "label": "France métropolitaine"
                }
            ],
            "format": [
                {
                    "term": "Shapefile",
                    "label": "Shapefile"
                }
            ]
        }
    ]
}

Pour connaître les fichiers téléchargeables, on va pouvoir demander le contenu de la sous ressource en suivant le lien de l'entrée.

https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives/departements
  • Accept = application/json
{
    "lang": "eng",
    "page": 0,
    "pagesize": 10,
    "pagecount": 1,
    "totalentries": 10,
    "title": "Données départementales",
    "subtitle": "Départements et limites départementales, au format Shapefile, sur la France métropolitaine",
    "id": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives/departements",
    "link": [
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives/departements?lang=default",
            "hreflang": "default",
            "rel": "alternate",
            "type": "application/atom+xml",
            "title": "Données départementales"
        },
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives/departements",
            "rel": "self",
            "type": "application/atom+xml",
            "title": "This document"
        },
        {
            "href": "https://data-qua.priv.geopf.fr/telechargement/resource/limites_administratives",
            "rel": "up",
            "type": "application/atom+xml"
        }
    ],
    "entry": [
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.prj",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.prj",
                    "rel": "alternate",
                    "type": "image/x-prj",
                    "length": 449,
                    "md5": "a125df3368127b8203a6c823c4e2b881"
                }
            ],
            "format": [
                {
                    "term": "image/x-prj",
                    "label": "image/x-prj"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.cpg",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.cpg",
                    "rel": "alternate",
                    "type": "image/x-cpg",
                    "length": 6,
                    "md5": "ed16c6bc54359dade2e7fafa83607f16"
                }
            ],
            "format": [
                {
                    "term": "image/x-cpg",
                    "label": "image/x-cpg"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.shx",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.shx",
                    "rel": "alternate",
                    "type": "application/octet-stream",
                    "length": 868,
                    "md5": "1b4b27aa51e8c981c80fc009c5612f36"
                }
            ],
            "format": [
                {
                    "term": "application/octet-stream",
                    "label": "application/octet-stream"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.cpg",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.cpg",
                    "rel": "alternate",
                    "type": "image/x-cpg",
                    "length": 6,
                    "md5": "ed16c6bc54359dade2e7fafa83607f16"
                }
            ],
            "format": [
                {
                    "term": "image/x-cpg",
                    "label": "image/x-cpg"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.prj",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.prj",
                    "rel": "alternate",
                    "type": "image/x-prj",
                    "length": 449,
                    "md5": "a125df3368127b8203a6c823c4e2b881"
                }
            ],
            "format": [
                {
                    "term": "image/x-prj",
                    "label": "image/x-prj"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.shp",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.shp",
                    "rel": "alternate",
                    "type": "application/x-shapefile",
                    "length": 2527748,
                    "md5": "afd8b8f3d13da008b5305fe49e8ccab3"
                }
            ],
            "format": [
                {
                    "term": "application/x-shapefile",
                    "label": "application/x-shapefile"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.shp",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.shp",
                    "rel": "alternate",
                    "type": "application/x-shapefile",
                    "length": 3125208,
                    "md5": "ab9b820b4c50936862f45f21eb434d82"
                }
            ],
            "format": [
                {
                    "term": "application/x-shapefile",
                    "label": "application/x-shapefile"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.dbf",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/DEPARTEMENT.dbf",
                    "rel": "alternate",
                    "type": "application/octet-stream",
                    "length": 17186,
                    "md5": "d9c1ff8f8980daa8f9b969a429987673"
                }
            ],
            "format": [
                {
                    "term": "application/octet-stream",
                    "label": "application/octet-stream"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.shx",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.shx",
                    "rel": "alternate",
                    "type": "application/octet-stream",
                    "length": 72596,
                    "md5": "bcef9e262f77e5b1dcfe1eed5e14f935"
                }
            ],
            "format": [
                {
                    "term": "application/octet-stream",
                    "label": "application/octet-stream"
                }
            ]
        },
        {
            "id": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.dbf",
            "link": [
                {
                    "href": "https://data-qua.priv.geopf.fr/telechargement/download/limites_administratives/departements/LIMITE_DEPARTEMENT.dbf",
                    "rel": "alternate",
                    "type": "application/octet-stream",
                    "length": 2039048,
                    "md5": "d5b48ce0035f521dba949d29cf6c7770"
                }
            ],
            "format": [
                {
                    "term": "application/octet-stream",
                    "label": "application/octet-stream"
                }
            ]
        }
    ]
}

On retrouve nos 10 fichiers, avec leur taille et leur signature MD5, téléchargeables :