Skip to content

Ontbrekende adressen na het uitvoeren van adres.sh #351

Closed

Description

@ypj0202

Nadat alle gegevens zijn geëxtraheerd, heb ik /bagv2/etl/adres.sh gedraaid om alleen de adresgegevens met postcode te extraheren. Ik ontdekte dat er 12632 postcodes ontbreken in tabel adres, maar dat ze wel bestaan in tabel nummberaanduiding. Hier zijn enkele voorbeelden van ontbrekende postcodes:

  • 2801RX
  • 1087CS
  • 1722WB
  • 1975KN
  • 1087CS

Speciaal voor: 1834VW, die kan worden gevonden door postnl

Enige assistentie zou op prijs worden gesteld :)

Activity

  1. justb4 commented on Jun 27, 2022

    @justb4
    Contributor

    adres.sh en dus adres-tabel.sql, o.a. om die reden, niet meer gebruikt. Het SQL script adres-tabel-plus.sql wordt eerst uitgevoerd. Vervolgens worden de andere twee adres-tabellen ('full' en 'basis') daarvan afgeleid. Het onderhouden van 3 verschillende adres-*.sql scripts bleek teveel verschillen op te leveren.

  2. frederikbosch commented on Sep 22, 2022

    @frederikbosch

    Voor een volledig postcode CSV extract, adviseer ik adres-full te gebruiken. De stappen zijn als volgt, maar ik zal een en ander nog in PR aanbieden.

    1. switch naar de master voor de nieuwe gemeentelijke indelingen
    2. voer CREATE EXTENSION tablefunc uit in je PostgreSQL database
    3. installeer python3-openpyxl en python3-xlrd
    4. voer de onderstaande commando's uit (-h en --username zelf toevoegen aan de psql regels)
    sh etl.sh -a bag_input_file=/tmp/lvbag-extract-nl.zip
    psql bagv2 -f sql/adres/adres-tabel-plus.sql
    psql bagv2 -f sql/adres/adres-plus2adres-full-tabel.sql
    psql bagv2 -f sql/adres/adres-full2csv.sql
    ls -alh /tmp/bagadres-full.csv
  3. eriksobolt commented on Mar 16, 2023

    @eriksobolt

    Ik probeer dit te doen maar het pand_id blijft leeg in de adres_plus tabel.

    Bij mij werkt het wel als ik de volgende code veranderd

    BEGIN;
      SELECT PRINT_NOTICE('start: 37c VBO_PANDGEGEVENS: '||current_time);
    drop  table if exists  VBO_PANDGEGEVENS;
    create table VBO_PANDGEGEVENS as
    SELECT
    	VBO.vbo_id,
    	VBO.typeadresseerbaarobject,
    	VBO.verblijfsobjectstatus,
    	VBO.aantalpnd_vbo as Aantal_pand_relaties_dit_VBO,
    	vbo.hoofdadres,
    	vbo.opp_verblijfsobject_m2,
    	VBO_WOON.woningtype as VBO_woningtype,
    	PND_act.woningtype,
      -- fix
      PND.pnd_id as PND_ID_UNIEK,
    	--case when VBO.aantalpnd_vbo = 1 then PND.pnd_id else  null end PND_ID_UNIEK,
    	case when VBO.aantalpnd_vbo = 1 then  PND.aantalvbo_pnd else  null end aantal_vbo_relaties_dit_PND,
    	case when VBO.aantalpnd_vbo = 1  and  PND.aantalvbo_pnd = 1 then  1 else  0 end VBO_PND_1_op_1,
    	case when VBO.aantalpnd_vbo = 1  and  PND.aantalvbo_pnd = 1 then   PND.max_vbo_id else  null end VBO_ID_PND_VBO_1_op_1,
    	case when VBO.aantalpnd_vbo = 1  then  pnd_act.opp_pand else null end as opp_pand,
    	case when VBO.aantalpnd_vbo = 1  and pnd_act.opp_pand  >0 then  round(pnd.Sum_Oppervlakte_alle_VBO_in_PAND/pnd_act.opp_pand ,2) else null end Verhouding_OPP_VBO_OPP_PND,
    	case when VBO.aantalpnd_vbo = 1  then  PND_ACT.Omtrek_Pand else null end Omtrek_Pand,
    	case when VBO.aantalpnd_vbo = 1 THEN PND_ACT.pandstatus ELSE NULL END pandstatus ,
    	case when VBO.aantalpnd_vbo = 1 then PND_ACT.bouwjaar else null end bouwjaar
    FROM
    	vbo_actueelbestaand_met_aantal_verbonden_pnd VBO
    	left outer join   pnd_actueelbestaand_met_aantal_vbo PND on    VBO.max_pnd_id = PND.pnd_id
    	left outer join   pandactueelbestaand_plus_woningtype PND_ACT on PND.pnd_id = PND_ACT.identificatie
    	left outer join   vbo_woningtype VBO_WOON  on VBO_WOON.VBO_id =  VBO.vbo_id;
      --20200531: Query returned successfully: 9282292 rows affected, 01:15 minutes execution time.
    COMMIT;
    
    
  4. locked and limited conversation to collaborators on Sep 6, 2024
  5. converted this issue into a discussion #392 on Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions