gpscoordinatesprojcompletion

Coordinates from API : https://adresse.data.gouv.fr/api-doc/adresse


i'm using this API for autocompletion of address (for France only) : https://adresse.data.gouv.fr/api-doc/adresse

You can try it at the end of the page. If you try to find an address (for example : 1 Quai de l'Horloge 75001 Paris), you can see the result :

[
  {
    "label": "1 Quai de l'Horloge 75001 Paris",
    "score": 0.9609863636363636,
    "housenumber": "1",
    "id": "75101_4655_00001",
    "name": "1 Quai de l'Horloge",
    "postcode": "75001",
    "citycode": "75101",
    "x": 651991.6,
    "y": 6862012.62,
    "city": "Paris",
    "district": "Paris 1er Arrondissement",
    "context": "75, Paris, Île-de-France",
    "type": "housenumber",
    "importance": 0.57085,
    "street": "Quai de l'Horloge"
  }
]

I'm interested in the coordinates, provided by x and y. The doc says : "WGS84, legal projection", but I don't understand exactly what it means, and I would like to get it as latitude and longitude, as used by Google Maps or many GPS system.

Does someone knows what is this format and how to convert it ? I tried many things with proj4 with WGS84 UTM, and more tests, but I could never get the correct location on a map or a GPS.

Thank you for your help


Solution

  • The document you link has:

    x : coordonnées géographique en projection légale

    So looking for the French legal projection in Wikipedia: https://fr.wikipedia.org/wiki/Syst%C3%A8me_de_coordonn%C3%A9es_(cartographie)#Les_codes_EPSG , we get:

    RGF93
    Réseau Géodésique Français 1993
    6171 (système géocentrique), 4965 (3D), 4171 (2D) Système français légal (décret 2000-1276 du 26 décembre 2000). Identique à l'ETRS89 au 1/1/1993. Compatible avec le WGS84 pour des précisions égales ou supérieures à 10 m (c'est-à-dire 15 m etc.).

    So, it is just compatible with WGS84: it means that you can convert one to the other (and vice-versa) without problems (so practically, using same reference data).

    I have no idea on where you got UTM (which it is old, and not so useful for countries).

    So now you have the EPSG codes to put into proj to convert coordinates. Note: some tools invert x and y and/or lat/long. So test with few coordinates, to see if you get expected values.

    Note: I think there may be several projections, depending on "continental/Europen France" and other territories. I think it is the reason to use a generic "legal" in the name, without giving details.