Skip to content

Commit

Permalink
V79
Browse files Browse the repository at this point in the history
- Minor changes in dummy removal function
  • Loading branch information
digitaldutch committed Mar 16, 2024
1 parent 86ea8bb commit 1d04062
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import locale
import psutil

version = 78
version_date = '16 January 2024'
version = 79
version_date = '16 March 2024'

locale.setlocale(locale.LC_ALL, 'nl_NL')

Expand Down
6 changes: 4 additions & 2 deletions database_sqlite/database_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,12 @@ def delete_no_longer_needed_bag_tables(self):
""")
self.commit()

def adressen_fix_bag_errors(self):
def adressen_remove_dummy_values(self):
# The BAG contains dummy values in some fields (bouwjaar, oppervlakte)
# See: https://geoforum.nl/t/zijn-dummy-waarden-in-de-bag-toegestaan/9091/5

# Amsterdam heeft een reeks van panden met dummy bouwjaar 1005
# https://www.amsterdam.nl/stelselpedia/bag-index/catalogus-bag/objectklasse-pand/bouwjaar-pand/
# Discussion: https://geoforum.nl/t/zijn-dummy-waarden-in-de-bag-toegestaan/9091/5
panden = self.fetchall(f"SELECT pand_id, bouwjaar FROM adressen WHERE bouwjaar=1005;")
aantal = len(panden)
utils.print_log(f"fix: test adressen met dummy bouwjaar 1005 in Amsterdam: {aantal: n}")
Expand Down
2 changes: 1 addition & 1 deletion import_bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main():
utils.print_log('addresses table is only created if active_only=True in config', True)
else:
db_sqlite.create_adressen_from_bag()
db_sqlite.adressen_fix_bag_errors()
db_sqlite.adressen_remove_dummy_values()
db_sqlite.test_bag_adressen()

if config.delete_no_longer_needed_bag_tables:
Expand Down
2 changes: 1 addition & 1 deletion readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ expect named
## What this parser does
This Python utility parses the BAG database and converts it into a clean, easy to read & use SQLite database.
Municipalities (gemeenten) and provinces (provincies) are added. Rijksdriehoekscoördinaten coordinates are converted
to standard WGS84 latitude and longitude coordinates. A few BAG bugs are fixed.
to standard WGS84 latitude and longitude coordinates. Invalid (dummy) bouwjaar and oppervlakte fields are removed.
Year of construction, floor area and intended use of buildings are also provided.
Several tables (nummers, verblijfsobjecten, panden, ligplaatsen and standplaatsen) are merged into a general 'adressen'
table. The SQLite database can be used directly, as a source to generate a *.csv file or to update your own addresses
Expand Down

0 comments on commit 1d04062

Please sign in to comment.