Zagreb/Import ZIPP Buildings

From OpenStreetMap Wiki
Jump to navigation Jump to search


Import of ZIPP buildings in Zagreb is an import of "City of Zagreb, City Office for the Strategic Planning and Development of the City" dataset covering Zagreb, Croatia. The import is currently (as of 27 November 2024) at the planning stage.

Goals

We want to import this dataset without removing former data about buildings. As Zagreb buildings are relatively well mapped, there is going to be much work in conflating already mapped buildings with import data.

Schedule

There is no rush in this, because quality of the import is much more important than getting the data quickly.

Import Data

The data is available on Github, on the official OSM-hr repo [1]. It is in GeoJSON format.

Background

Data source site: https://geoportal.zagreb.hr/
Data license: This data is licensed for use in OpenStreetMap project, it is obligatory to attribute the source (City of Zagreb, City Office for the Strategic Planning and Development of the City)
OSM attribution (if required): https://wiki.openstreetmap.org/wiki/Contributors#City_of_Zagreb
ODbL Compliance verified: yes

OSM Data Files

Still not created.

Import Type

This is for now a one time import, hopefully later checked once in a while.

Data Preparation

First the data will have to be converted into OSM XML:

docker run -v /path/to/folder/buildings-ot5-vjerski_objekti.geojson:/data/input.geojson janjko/geojsontoosm > /path/to/folder/output.osm

Files end up in a strange encoding after that, so they should be converted back to UTF-8.

Tagging Plans

The raw tags from the geojson will be mapped like this:

Old key Key to replace An example of a value
OBJECTID zipp_import_id 214588
Object_ID delete tag 0
ThematicUnit delete tag 2000
ObjectType delete tag 5
DataSource source:geometry Aerofotogrametrijsko i LiDAR snimanje 2012.
DataAcquisitionDate source:geometry:date 2012-03-26
DataChangeDate delete tag null or 2018\/10\/13 00:00:00
Contractor delete tag GDi GISDATA d.o.o.
Area delete tag 59
INSPIRE_LULC delete tag null
Shape_Length delete tag 53.809160264912691
Shape_Area delete tag 59.28182603425725
PROMJENA delete tag null or 1

Sed command that applies all the changes to the .osm file:

docker run -v /path/to/folder/:/data alpine sed -E 's/(<node|<way|<relation)/\1 timestamp=\"2020-08-216T00:00:00Z\" version=\"1\"/g;s/<tag k=.(Object_ID|ThematicUnit|ObjectType|DataChangeDate|Contractor|INSPIRE_LULC|Area|Shape_Length|Shape_Area|PROMJENA).[^>]*?>//g;s/OBJECTID/zzip_import_id/g;s/DataSource/source:geometry/g;s/(<tag k=.)DataAcquisitionDate(. v=.)([0-9]{1,2})([0-9]{2})([0-9]{4})/\1source:geometry:date\2\5-\4\-\3/g;s/(.source:geometry:date. v=.[0-9]{4}-[0-9]{2}-)([0-9]{1}[^0-9]{1})/\10\2/g;' /data/geojsontoosmoutput.osm > /path/to/folder/sedoutput.osm

Splitting data into tiles

First the data will have to be converted into pbf:

osmosis --read-xml file=sedoutput.osm --write-pbf sedoutput.pbf

And then broken into tiles that represent the Tasking Manager tiles. This will be done with mapsplitter:

java -Xmx2G -jar .\mapsplit-all-0.2.1.jar -tvm -i sedoutput.pbf -o splitoutput.msf -z 14

Changeset Tags

Changeset tags are going to be:

comment=Manual import of buildings in Zagreb

bot=no

imagery_used=Zagreb 2018

source=Aerofotogrametrijsko i LiDAR snimanje 2012.

hashtags=#ZagrebBuildingImport

Data Transformation Results

Post a link to your OSM XML files.

Data Merge Workflow

Team Approach

This will be done as a team, on the Croatian Tasking manager. [2] It is still debated if it will be open to everyone or just the narrower team known to be seasoned mappers.

Workflow

The tools used in the import will be Tasking Manager and JOSM. Tasking manager will cover the area of the data, and will have a per task instruction with a link to the OSM XML file with import data. The link will load directly into JOSM. In JOSM, when possible, the building shape will be conflated with existing data. If there is the same building already in the database, the JOSM tool Replace geometry will be used. This tool is available with the utilsplugin2.

QA

The import is done in the Tasking Manager which has the "Validate" function. That way, each task tile will be seen by at least one other mapper.

See also

The email to the Imports mailing list was sent on YYYY-MM-DD and can be found in the archives of the mailing list at [1].