Automated edits/CatAtom3Dfix
This is the proposal of an automated edit to fix the missing building parts in the Spanish Cadastre/Buildings Import.
Who
- Source code: https://github.com/OSM-es/CatAtom3Dfix
- Operator: User:Javiersanp
- Edits account: User: catatom3dfix
- Contact: Javier Sánchez <javiersanp at gmail dot com>
Motivation
In march 2021, a request was made in the import list regarding this import and the Simple_3D_Buildings tagging scheme. Untill then some building parts were been considered not needed because they only contains tags for the building:levels and building:levels:underground tags already present in the building outline (see Reduction of building parts). Nevertheless, the standard says that the entire building outline should be filled with building parts.
This issue was discussed in the talk-es list and fixed in version 1.3 of CatAtom2Osm.
Newer import projects conforms to Simple 3D schema, but many on going projects are very difficult to rebuild and there are a big amount of buildings already imported with the outline not filled.
Operation
The code search for the imported buildings and generates the missing building part. It operates on a changeset basis (one new fixs changeset for every historically imported changeset).
It has four stages that will run in parallel.
List
Get the identifiers of the Spanish Cadastre Buildings Import changesets from Planet.osm/full.
Download
For each import changeset, download the current buildings data to a OSM XML file. It needs a call to the API to get the ids of the buildings and its parts and another to Overpass API for their current versions.
Process
For each of the previous files, generates a OsmChange file with the missing building parts.
For each building, it substracts all the parts. If the resulting geometry is not empty and different from the original, the building outline is not fully filled and goes to the output file. This will exclude buildings with only one level (no building:parts in it) and those created with the fixed CatAtom2Osm tool. The new building parts will be defined referencing the existing nodes and ways (if used in multipolygon relations).
Upload
Uploads each OsmChange file content to OSM in a single request to the API.
The new changesets will be uploaded using the catatom3dfix account with this tags:
- comment: Fixes #Spanish_Cadastre_Buildings_Import Simple 3D Buildings for cs <id>
- source: Dirección General del Catastro
- mechanical: yes
- url: https://wiki.openstreetmap.org/Automated_edits/catatom3dfix
Samples
Here you can find a random sample of results. These files include the existing nodes so they can be opened in Josm for review. The final files will include only new elements for creation and don't edit any existing object.
Some funcional tests have been carried out.
The first changeset 103419851 (achavi, OSMLab) have been uploaded for testing.
Scope
The Spanish Cadastre Buildings Import is in progress using this Task Manager. The import had 12212 changesets (see here) as of 2021/04/05.
Consultation
- https://lists.openstreetmap.org/pipermail/talk-es/2021-April/017706.html
- https://lists.openstreetmap.org/pipermail/imports/2021-April/006600.html
- https://wiki.openstreetmap.org/wiki/Spanish_Cadastre/Buildings_Import/Results
Frequency
Once to fixs the data already imported . Then occasionally until all the buildings of projects in progress made with previous versions of CatAtom2Osm are fixed.
Status
Started
- First run: 2021-05-05T06:44:36Z - 2021-05-14T07:18:20Z. First turn with fails.
- Second run: 2021-05-26T12:23:46Z - 2021-05-27T09:56:43Z Fixed imported as of 2021-04-05.
- Third run: 2021-05-30T19:58:10Z - 2021-06-02T11:31:25Z. Fixed missing changesets with mixed source as of 2021-05-09 16:06:04+00:00.
- 4th: 2021-06-03T12:55:53Z - 2021-06-07T07:37:23Z. Rescue missing conflated buildings
- 2021-08-03T06:55:54Z - 2021-08-03T20:18:02Z.
- 2021-11-18T19:35:17Z - 2021-11-30T09:27:22Z
Quality Assurance
Check issues on osmose.
Some bugs occurred in the the first run. Thanks to users 'marc__marc' and 'L___I' for their contribution.
- Some relations without members: fixed, check
- Tag type=multipolygon in some ways: fixed, check
- Some ways without tags that are not members of any relation: fixed, check
- Some duplicated ways and relations: fixed
A perfect geometry without topological errors in the buildings and its parts is necessary for the tool to work properly. The tool is used to detect these problems. Challenge for manual correction.