Proposed import of Buildings from MML MTK

Goal

Import missing buildings. One municipality at a time, most likely.

License

Data owner has given permission for import, even data itself is under CC4.0. See Fi:Avustajat - OpenStreetMap Wiki

Data

Maastotietokanta (MTK), mtkmaasto.gpkg, open data downloaded from Karttapaikka - Maanmittauslaitos . Has buildings as polygons. Field ‘käyttötarkoitus’ defines usage, most notable are

  • 1: permanent living
  • 2: commercial
  • 4: industrial
  • note: value can be off especially in tourism heavy areas, noted in Kolari / Ylläs.

Data will be replaced in autumn 2026 by ‘kansallinen maastotietokanta’ (KMTK). Changes are minimal for this usage:

  • layer name changes to ‘building part area’
  • field to ‘building function id’. values might change too.
  • new field ‘end_time’ possibly usable for filtering out old buildings, if those will be in new dataset.

Tools

QGIS, latest

QGIS plugin QuickOSM: to download current OSM data

ogr2osm: to convert data to .osm

JOSM: verify data

JOSM or .py: to upload data

Steps

Preparation

Download (about) current version of

  1. ‘Maastotietokanta’ to get the buildings.

  2. ‘Hallinnolliset aluejaot’ to get municipalities as vector polygons.

Download current OSM data

Install and open QuickOSM plugin. Make Quick query.

Keys:

In: Municipality, in this sample case ‘Rovaniemi’

Export data to geopackage.

Find missing buildings

Add MTK Buildings and Municipalities as a layers.

First select a municipality.

Then Toolbox > Select by location

  • ‘rakennus’
  • are within
  • ‘kunta’
  • selected features only

Now selection contains all buildings within selected municipality. Sample data: Rovaniemi, 58k buildings.

Again Toolbox > Select by location

  • ‘rakennus’
  • intersect
  • ‘OSM buildings’
  • remove from current selection

Wait. On modern mac it took 1h20, barely using any computing power :(

Sample data: 40k features selected = 40k buildings missing from OSM.

Export selected features > save as geopackage. optional: Discard unnecessary fields.

Verify visually by comparing current OSM buildings and exported file.

Convert to .osm

“it is possible to 1) export data from QGIS in suitable format (geopackage, shape file, GeoJSON or KML) convert to OSM XML with Ogr2osm 2) upload to OSM with bulk_upload.py or similar tools.” says QGIS - OpenStreetMap Wiki

Install ogr2osm.

Goal is to tag field ‘kayttotarkoitus’ to ‘building’:

  • 1: apartment
  • 2: commercial
  • 4: industrial
  • else: yes

so make a translation file:

import ogr2osm

class mtkbuildings(ogr2osm.TranslationBase):
    def filter_tags(self, attrs):
        if not attrs:
            return

        tags = {}
        if 'kayttotarkoitus' in attrs:
            if attrs['kayttotarkoitus'].strip() == '1':
                tags['building'] = 'residential'
            elif attrs['kayttotarkoitus'].strip() == '2':
                tags['building'] = 'commercial'
            elif attrs['kayttotarkoitus'].strip() == '4':
                tags['building'] = 'industrial'
            else:
                tags['building'] = 'yes'
        tags['source'] = 'National Land Survey of Finland'
        return tags

Run.

Verify data in JOSM. Menu > imagery > OSM and Aerial/orto/satellite, then compare.

Optional: also check in text editor:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="ogr2osm 1.2.1" upload="false">
<node visible="true" id="-1" lat="66.803101117" lon="25.274039664"/>
<node visible="true" id="-2" lat="66.803178473" lon="25.273984186"/>
...
<way visible="true" id="-180321"><nd ref="-180317"/><nd ref="-180318"/><nd ref="-180319"/><nd ref="-180320"/><nd ref="-180317"/><tag k="building" v="yes"/><tag k="source" v="National Land Survey of Finland"/></way>
<way visible="true" id="-180326"><nd ref="-180322"/><nd ref="-180323"/><nd ref="-180324"/><nd ref="-180325"/><nd ref="-180322"/><tag k="building" v="commercial"/><tag k="source" v="National Land Survey of Finland"/></way>
...

.osm file 23 MB

Upload to OSM

First set was uploaded with JOSM.

1 Like

More comparision on other areas. All light outlines are missing buildings.

Make sure to double check the spelling for keys so nothing gets left out accidentally.

Is it possible to have the new outlines overlaid on aerial imagery as well? Obviously the images may be outdated, but at least a few spot checks might be good, to demonstrate with more confidence that this generally produces correct results (no systematic errors in coordinate projection etc.).

1 Like

sure, here is some from city centrum and some from SE and SW

1 Like

See wiki for status Buildings import 2026 from NLS - OpenStreetMap Wiki

This was probably an oversight in the discussion here but please…

… don’t add a source tag to every single building, it is sufficient to have that on the changeset.

3 Likes

Thank you for the good work!

1 Like

Some manual work needed, as some generated ways crosses itself and seem to prevent rendering. See example:

https://tools.geofabrik.de/osmi/?view=areas&lon=26.21740&lat=66.00645&zoom=19

(zoom out to find the others)

or this specific example:

Only five of those, though.

.

1 Like

Process version 2 tested and now doing whole Finland at once with local extracts. This is super fast compared to v1, takes only minutes for whole country. Still to see if JOSM can handles this :D

Coming soon: Large imports to finish the the work; process v2 docs; minor building imports too (this current import focused on buildings with käyttötarkoitus <= 4); update-imports at regular intervals like month/half a year.

Status: Finished the initial import! Yesterday and today around 580 000 buildings.

Note: JOSM first uploaded nodes, and ways only at last. This combined to OSM API rate limit made imports looks like mess (only nodes at first) untill all uploads were finished hours later, today.

Still some work to do:

  • Some duplicates possible (~10-20) due to OSM API rate limit stopped the uploads and other users made changes in between. Feel free to fix anything you find.
  • At least one non-existing (already demolished) building was imported due Topo Database I used was 1,5 years old - thanks for noting @Tuplanolla . I will download fresh one and make automated comparision to remove non-existing. But as usual, feel free to fix anything you find.

New process description https://wiki.openstreetmap.org/wiki/Import_with_QGIS_-_case_buildings_Finland_2026_Sept . Way, way easier and 100x faster than one in the first post.

1 Like

At least one non-existing (already demolished) building was imported due Topo Database I used was 1,5 years old - thanks for noting @‍Tuplanolla . I will download fresh one and make automated comparision to remove non-existing. But as usual, feel free to fix anything you find.

Unfortunately the MTK/Topo database isn’t always completely up-to-date, with this school building (old item, new imported item) demolished last year still appearing in it. Would it perhaps be possible to also check for overlapping [was:building] areas?

New process description https://wiki.openstreetmap.org/wiki/Import_with_QGIS\_-\_case_buildings_Finland_2026_Sept . Way, way easier and 100x faster than one in the first post.

Thanks for the interesting write-up. Discourse seems to have gotten a bit too enthusiastic with escaping links, here’s the (hopefully) working one: https://wiki.openstreetmap.org/wiki/Import_with_QGIS_-_case_buildings_Finland_2026_Sept

This import is adding back already demolished buildings! NSL database is not that up to date so please please take this in to acocunt!

1 Like

Sorry for re-adds. I will do recheck and cleaning against lifecycle tags

2 Likes

@frspp Please describe what is the process for ensuring non-existant buildings (i.e. previously removed from OSM) are not added back via the mass import? I read quickly through the wiki docs you had linked, but did not find the answer in the process description.

When this mass import was re-started I started getting messages from OSM trails mappers (not hanging in this forum) expressing frustration on the mass import creating havoc in the OSM DB. OSM trails mappers remember still all too well an incident from a few years back when an over-eager new mapper started “improving” OSM trails based on MML DB - took a lot of effort from the trails mapping community to fix all the damage done.