Djelmas
Joined: 16/12/2022 14:53:34
Messages: 1
Offline
|
I've noticed a different behavior for the départements of Dordogne (24) and Vaucluse (84) than for the other départements.
When I ask for a location, for instance in Isère, with http://api.geonames.org/countrySubdivisionJSON?formatted=true&lat=45.4&lng=6.8&username=xxx&level=2 I get an answer containing an array with both level 1 and level 2 administrative codes :
{
"adminCode2": "38",
"codes": [
{
"code": "ARA",
"level": "1",
"type": "ISO3166-2"
},
{
"code": "38",
"level": "2",
"type": "ISO3166-2"
}
],
"adminCode1": "84",
"adminName2": "Isère",
"distance": 0,
"countryCode": "FR",
"countryName": "France",
"adminName1": "Auvergne-Rhône-Alpes"
}
In Dordogne, and it's the same in Vaucluse, I get only level 1 in the codes array :
http://api.geonames.org/countrySubdivisionJSON?formatted=true&lat=45.4&lng=0.8&username=xxx&level=2
{
"adminCode2": "24",
"codes": [{
"code": "NAQ",
"level": "1",
"type": "ISO3166-2"
}],
"adminCode1": "75",
"adminName2": "Dordogne",
"distance": 0,
"countryCode": "FR",
"countryName": "France",
"adminName1": "Nouvelle-Aquitaine"
}
Of course I've changed my code to read the adminCode2 field, but I'm curious to know the reason behind this, if there's not a potential problem behind this different behaviours.
Thank you very much for any answer.
|