Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mémoriser les coordonnées géocodées pour les champs de type adresse #10940

Open
ZeGuigui opened this issue Oct 15, 2024 · 0 comments
Open

Comments

@ZeGuigui
Copy link

ZeGuigui commented Oct 15, 2024

Dans une démarche on peut mettre des champs de type adresse. Ces champs utilisent l'API BAN pour leur remplissage.

Via l'API GraphQL on peut récupérer un certain nombre d'informations :

{
    "id": "Q2hhbXAtMjI4",
    "champDescriptorId": "Q2hhbXAtMjI4",
    "__typename": "AddressChamp",
    "label": "Adresse",
    "stringValue": "15 Rue de Vaugirard 75006 Paris",
    "updatedAt": "2024-10-15T14:48:38+02:00",
    "prefilled": false,
    "address": {
        "label": "15 Rue de Vaugirard 75006 Paris",
        "type": "housenumber",
        "streetAddress": "15 Rue de Vaugirard",
        "streetNumber": "15",
        "streetName": "Rue de Vaugirard",
        "postalCode": "75006",
        "cityName": "Paris",
        "cityCode": "75106",
        "departmentName": "Paris 6e Arrondissement",
        "departmentCode": "75",
        "regionName": "Île-de-France",
        "regionCode": "11"
    },
    "commune": {
        "name": "Paris",
        "code": "75106",
        "postalCode": "75006"
    },
    "departement": {
        "name": "Paris",
        "code": "75"
    }
}

Malheureusement ces informations ne contiennent pas les coordonnées géocodées fournies par l'API BAN :

{
    "type": "FeatureCollection",
    "version": "draft",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    2.337343,
                    48.849169
                ]
            },
            "properties": {
                "label": "15 Rue de Vaugirard 75006 Paris",
                "score": 0.9747818181818181,
                "housenumber": "15",
                "id": "75106_9624_00015",
                "name": "15 Rue de Vaugirard",
                "postcode": "75006",
                "citycode": "75106",
                "x": 651372.01,
                "y": 6861218.05,
                "city": "Paris",
                "district": "Paris 6e Arrondissement",
                "context": "75, Paris, Île-de-France",
                "type": "housenumber",
                "importance": 0.7226,
                "street": "Rue de Vaugirard"
            }
        }
    ],
    "attribution": "BAN",
    "licence": "ETALAB-2.0",
    "query": "15 rue de vaugirard 75006 paris",
    "limit": 5
}

Serait il possible d'ajouter le champs geometry retourné par l'API BAN dans ce qui est stocké pour les champs adresse ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant