Skip to content

Commit

Permalink
Merge pull request #236 from BaseAdresseNationale/mmortier/addokBANID
Browse files Browse the repository at this point in the history
ajout du banId  à l'export addok
  • Loading branch information
mmortier authored Aug 29, 2023
2 parents 501b11b + ce9ca4b commit 3ec7410
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/distribute/writers/addok.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function getCenterProps(commune, numeros) {

function buildMunicipality(commune, numeros = []) {
const {x, y, lon, lat} = getCenterProps(commune, numeros)
const districtIdBan = numeros[0].banIdDistrict || null

return {
id: commune.code,
banId: districtIdBan,
type: 'municipality',
name: commune.nom,
postcode: commune.codesPostaux,
Expand All @@ -63,6 +65,7 @@ function buildStreet(voie, forceAddOldCity = false) {
[numero.numero || '0', numero.suffixe].filter(Boolean).join(''),
{
id: numero.cleInterop,
banId: numero.banId || null,
x: numero.x,
y: numero.y,
lon: numero.lon,
Expand All @@ -85,6 +88,7 @@ function computeCommonVoieProps(voie, forceAddOldCity = false) {

return {
id: voie.idVoie,
banId: voie.banId || null,
name: forceAddOldCity && voie.nomAncienneCommune ? `${voie.nomVoie} (${voie.nomAncienneCommune})` : voie.nomVoie,
postcode: voie.codePostal,
citycode: codeCommuneArrondissement ? [commune.code, codeCommuneArrondissement] : compact([commune.code, voie.codeAncienneCommune]),
Expand Down

0 comments on commit 3ec7410

Please sign in to comment.