Puglia CTR Import

From OpenStreetMap Wiki
Jump to navigation Jump to search

About

The CTR (Carta Tecnica Regionale - Regional Technical Map) of Apulia, built in 2006 in the scale of representation of 1: 5,000, can be freely downloaded from SIT Puglia, at: http://www.sit.puglia.it/portal/portale_cartografie_tecniche_tematiche/Download/Cartografie from which you must select the IGM grid 1:50,000, divided into 64 smaller panels. In total, the CTR is composed of 2,296 panels. For each panel you can download the "Carta Tecnica Regionale in formato shape" corresponding to a zip file which includes three shapefiles for points, lines and polygons and a dwg file for annotations. The subject of this import are the footprints of buildings (along with other minor elements like fountains, pools, ponds, wells, etc.) contained in the polygons shapefile.

Goals

Among the various available data, we chose to import only the footprints of the buildings, which are contained in the layer described below in the tagging plans. The goal is to enrich the OSM database with buildings, currently almost entirely lacking in Puglia, except for the area of Lecce and surrounding towns, where the buildings have been imported from a release of CTR Puglia, issued by town of Lecce in CC by 4.0 (http://wiki.openstreetmap.org/wiki/Lecce).

Import Type

This import will not happen at once, but due to the amount of data it will be divided among several users, with dedicated accounts. Each Apulia CTR panel will be prepared and individually imported. We will also keep track of the uploads by an appropriate wiki page.

Import plan

This import will be distributed as follows:
- User corfede (with dedicated account corfedeimport): he will import the datas for the Province of Lecce, composed by IGM grids: 495, 496, 511, 512, 513, 525, 526, 527, 536, 536_bis, 537, 537_bis, containing a total of 420 smaller panels.
[more users can be added]

Schedule

The import will begin Monday, 11/09/2015 and will last until the completion, for an estimated duration of approximately one year.

Import data

The features contained in the shapefiles are characterized by fields "LAYER" and "DESCR", respectively containing the code and the description of the object type. In the following table there are all the codes of the objects contained in the polygon shapefiles. To each is given the description contained in the shapefile, and the tag that is intended to apply.

Background

Data source site: http://www.sit.puglia.it/portal/portale_cartografie_tecniche_tematiche/Download/Cartografie
Data license: Open by default
Type of license: CC-BY 4.0
OSM attribution: http://wiki.openstreetmap.org/wiki/Contributors#Puglia
ODbL Compliance verified: yes

Workflow data preparation and upload

Below the workflow, from the download of the Apulia CTR to the final upload into OSM.

1) Download the zip file from Apulia SIT website (eg. 511101_ctr.zip, where 511 is the number of IGM 1:50.000 grid and 101 is the number of panel).

2) Extract the polygonal shapefile (eg. CTR_511101_pol).

3) Run the OGR2OSM script for the conversion from shape to osm, by the command line:

 python C:\OGR2OSM\ogr2osm.py C:\CTR_Puglia\511101.shp -t C:\CTR_Puglia\tag.py -o C:\CTR_Puglia\511101.osm -e 32633 --no-upload-false 

The Python script will erase all the feature that we don't want to import and will assign correct tags, as explained in tagging plans.

4) Load OSM file in JOSM and launch the validator to fix any errors and warnings and simplify geometry if needed, but first of all you have to select and delete all the untagged geometries ("atri/cavedio"). Geometry simplification can be done with plugin "Simplify Area", with these settings: angle treshold=5, angle factor=1.0, area treshold=5.0, area factor=1.0, distance treshold=3, distance factor=3, merge nearby nodes treshold=0.2.

5) Before the final upload to OSM, you must download the interested area and run again the JOSM validator, to check for interferences with pre-existing buildings, highways, etc. Furthermore, the cut geometries at the edge of the single panel must be manually merged with the closest ones.

Tagging plans

Layer SHP Descrizione SHP Tag Note
34770000 Serbatoio,Torre Piezometrica man_made=water_tower
35630000 antenna telecomunicazioni man_made=tower + tower:type=communication
31670000 atrio (cavedio) Da trasformare in multipoligoni. Lasciare senza tag.
31620000 baracca building=shed
34540000 cabina acquedotto building=yes + pipeline=substation + type=water https://wiki.openstreetmap.org/wiki/Proposed_features/PipelineExtension#Facilities.2C_Substations
35180000 cabina elettrica di trasformazione building=yes + power=substation
35540000 cabina gas building=yes + pipeline=substation + type=gas https://wiki.openstreetmap.org/wiki/Proposed_features/PipelineExtension#Facilities.2C_Substations
31340000 campanile man_made=tower + tower:type=bell_tower + building=bell_tower
31410000 campo sportivo coperto building=sport + leisure=sports_centre
31210000 capannone building=industrial
31220000 capannone agricolo building=farm_auxiliary
31214000 capannone diroccato abandoned:building=yes
31211000 capannone in costruzione building=construction
31350000 cappella cimitero building=yes Edicola funeraria, comunque inserita all'interno di un landuse=cemetery
31540000 castello historic=castle + building=castle
35610000 centralina telecom building=yes + name=Centralina Telecom Necessita di un tag migliore per inserirlo nello schema della rete telefonica italiana
31310000 chiesa building=church + amenity=place_of_worship + religion=christian
31311000 chiesa in costruzione building=construction
31740000 ciminiera man_made=chimney
31110000 edificio civile building=yes
31114000 edificio diroccato abandoned:building=yes
31600000 edificio generico building=yes
31111000 edificio in costruzione building=construction
31110100 edificio interrato building=yes + building:levels:underground=1
34320000 faro man_made=lighthouse
34740000 fontana rappresentabile amenity=fountain
31780000 monumento rappresentabile historic=memorial Monumento commemorativo
31640000 pensilina building=roof + layer=1
34780000 piscina leisure=swimming_pool + access=private
34750000 pozzo rappresentabile man_made=water_well
31730000/34790000 serbatoio man_made=storage_tank
31610000 serra building=greenhouse
31720000 sylos man_made=silo
31330000 tabernacolo building=chapel + amenity=place_of_worship + religion=christian Trattasi di cappella religiosa, a differenza di quanto suggerito dalla descrizione
31430000 tendone pressurizzato building=sport + covered=yes
31630000 tettoia building=roof + layer=1
31530000 torre man_made=tower + building=tower
35160000 traliccio rappresentabile power=tower
31420000 tribuna campo sportivo building=grandstand
31130000 trullo historic=building + building=trullo
31114000 Pagghiara historic=building + building=pajaru
34710000 vasca rappresentabile landuse=reservoir
35110000 stazione elettrica power=substation
35200000 traliccio impianto eolico power=generator + generator:source=wind
31550000 Area portico building=roof + layer=1 Porticato/pensilina
31560000 area sottopassaggio building=yes + layer=1 Trattasi di aree edificate, attraversate da passaggio pedonale o carrabile.
31570000 area aggetto building=roof + layer=1 Pensilina
31680000 lucernaio Non importare, eliminare geometrie
32510000 casello Non importare, eliminare geometrie
34760000 diga Non importare, eliminare geometrie
32240000 banchina marciapiede di binario Non importare, eliminare geometrie
32450000 rampa Non importare, eliminare geometrie
32580000 scala chiusa Non importare, eliminare geometrie
31510000 muro Non importare, eliminare geometrie
33110000 muro spessore rappresentabile Non importare, eliminare geometrie
33110000 muro in calce in spessore Non importare, eliminare geometrie
33110081 muro divisorio non qualificato Non importare, eliminare geometrie
33120000 muro a secco spessore rappresentabile Non importare, eliminare geometrie
33120000 muro a secco in spessore Non importare, eliminare geometrie
34650000 salina Non importare, eliminare geometrie
34660000 palude Non importare, eliminare geometrie
87210000 area incolto Non importare, eliminare geometrie
87330000 area viale tagliafuoco Non importare, eliminare geometrie
87340000 bosco macchia mediterranea Non importare, eliminare geometrie
87350000 bosco misto Non importare, eliminare geometrie
87360000 bosco di conifere Non importare, eliminare geometrie
87410000 area Seminativi Non importare, eliminare geometrie
87420000 area arborato Non importare, eliminare geometrie
87430000 area Risaie Non importare, eliminare geometrie
87440000 area canneto Non importare, eliminare geometrie
87450000 area pascolo Non importare, eliminare geometrie
87460000 area Uliveti Non importare, eliminare geometrie
87470000 area Vigneti Non importare, eliminare geometrie
87480000 area agrumeti Non importare, eliminare geometrie
87490000 area Frutteti Non importare, eliminare geometrie
87510000 area giardino non qualificato Non importare, eliminare geometrie
87510010 area Orto-Vivaio Non importare, eliminare geometrie
87700000 bosco di latifoglie Non importare, eliminare geometrie
87720000 area pascolo cespugliato Non importare, eliminare geometrie

Python file rules

Versione v01 (20/10/2015).

'''
Puglia CTR Import v01 (20/10/2015)
'''
def filterFeature(ogrfeature, fieldNames, reproject):
    if not ogrfeature:
        return
    
    desc = ogrfeature.GetField('DESCR')
               
    if desc in ['banchina marciapiede di binario',
		'lucernaio',
		'casello',
		'diga',
		'rampa',
		'scala chiusa',
	        'muro',
		'muro spessore rappresentabile',
		'muro in calce in spessore',
		'muro divisorio non qualificato',
		'muro a secco spessore rappresentabile',
		'muro a secco in spessore',
		'salina',
		'palude',
		'area incolto',
		'area viale tagliafuoco',
		'bosco macchia mediterranea',
		'bosco misto',
		'bosco di conifere',
		'area Seminativi',
		'area arborato',
		'area Risaie',
		'area canneto',
		'area pascolo',
		'area Uliveti',
		'area Vigneti',
		'area agrumeti',
		'area Frutteti',
		'area giardino non qualificato',
		'area Orto-Vivaio',
		'bosco di latifoglie',
		'area pascolo cespugliato']:
        return None
    return ogrfeature
	
def filterTags(attrs):
    if not attrs:
        return
    tags = {}
	
	# Edifici
    if 'DESCR' in attrs:
        if attrs['DESCR'] == 'edificio civile': #edificio generico
			 tags['building'] = 'yes'	 
	elif attrs['DESCR'] == 'antenna telecomunicazioni': #antenna telecomunicazioni
			 tags['man_made'] = 'tower'
			 tags['tower:type'] = 'communication'
	elif attrs['DESCR'] == 'Area portico': #porticato
			 tags['building'] = 'roof'
			 tags['layer'] = '1'
	elif attrs['DESCR'] == 'area sottopassaggio': #fabbricato con attraversamento
			 tags['building'] = 'yes'
			 tags['layer'] = '1'
	elif attrs['DESCR'] == 'baracca': #baracca
			 tags['building'] = 'shed'
	elif attrs['DESCR'] == 'cabina acquedotto': #cabina acquedotto
			 tags['building'] = 'yes'
			 tags['pipeline'] = 'substation'
			 tags['type'] = 'water'
	elif attrs['DESCR'] == 'cabina elettrica di trasformazione': #cabina elettrica
			 tags['building'] = 'yes'
			 tags['power'] = 'substation'
	elif attrs['DESCR'] == 'cabina gas': #cabina gas
			 tags['building'] = 'yes'
			 tags['pipeline'] = 'substation'
			 tags['type'] = 'gas'
	elif attrs['DESCR'] == 'campanile': #campanile
			 tags['man_made'] = 'tower'
			 tags['tower:type'] = 'bell_tower'
			 tags['building'] = 'bell_tower'
	elif attrs['DESCR'] == 'campo sportivo coperto': #campo sportivo coperto
			 tags['leisure'] = 'sports_centre'
			 tags['building'] = 'sport'
	elif attrs['DESCR'] == 'capannone': #capannone industriale
			 tags['building'] = 'industrial'
	elif attrs['DESCR'] == 'capannone agricolo': #capannone agricolo
			 tags['building'] = 'farm_auxiliary'
	elif attrs['DESCR'] == 'capannone diroccato': #capannone diroccato
			 tags['abandoned:building'] = 'yes'
	elif attrs['DESCR'] == 'capannone in costruzione': #capannone in costruzione
			 tags['building'] = 'construction'
	elif attrs['DESCR'] == 'cappella cimitero': #edicola funeraria
			 tags['building'] = 'yes'
	elif attrs['DESCR'] == 'castello': #castello
			 tags['historic'] = 'castle'
			 tags['building'] = 'castle'
	elif attrs['DESCR'] == 'centralina telecom': #centralina telecom
			 tags['building'] = 'yes'
			 tags['name'] = 'Centralina Telecom'
	elif attrs['DESCR'] == 'chiesa': #chiesa
			 tags['building'] = 'church'
			 tags['religion'] = 'christian'	
			 tags['amenity'] = 'place_of_worship'
	elif attrs['DESCR'] == 'chiesa in costruzione': #chiesa in costruzione
			 tags['building'] = 'construction'
	elif attrs['DESCR'] == 'ciminiera': #ciminiera
			 tags['man_made'] = 'chimney'		 
	elif attrs['DESCR'] == 'edificio diroccato': #edificio abbandonato
			 tags['abandoned:building'] = 'yes'			
	elif attrs['DESCR'] == 'edificio generico': #edificio generico
			 tags['building'] = 'yes'		
	elif attrs['DESCR'] == 'edificio in costruzione': #edificio in costruzione
			 tags['building'] = 'construction'		
	elif attrs['DESCR'] == 'edificio interrato': #edificio interrato
			 tags['building'] = 'yes'
			 tags['building:levels:underground'] = '1'
	elif attrs['DESCR'] == 'faro': #faro
			 tags['man_made'] = 'lighthouse'
	elif attrs['DESCR'] == 'fontana rappresentabile': #fontana
			 tags['amenity'] = 'fountain'
	elif attrs['DESCR'] == 'monumento rappresentabile': #monumento
			 tags['historic'] = 'memorial'
	elif attrs['DESCR'] == 'Pagghiara': #pajara
			 tags['building'] = 'pajaru'
			 tags['historic'] = 'building'			 
	elif attrs['DESCR'] == 'pensilina': #pensilina
			 tags['building'] = 'roof'
			 tags['layer'] = '1'
	elif attrs['DESCR'] == 'piscina': #piscina
			 tags['leisure'] = 'swimming_pool'
			 tags['access'] = 'private'
	elif attrs['DESCR'] == 'pozzo rappresentabile': #pozzo
			 tags['man_made'] = 'water_well'	
	elif attrs['DESCR'] == 'serbatoio': #serbatoio
			 tags['man_made'] = 'storage_tank'
	elif attrs['DESCR'] == 'serra': #serra
			 tags['building'] = 'greenhouse'
	elif attrs['DESCR'] == 'sylos': #sylos
			 tags['man_made'] = 'silo'
	elif attrs['DESCR'] == 'Serbatoio, Torre Piezometrica': #torre piezometrica
			 tags['man_made'] = 'water_tower'
	elif attrs['DESCR'] == 'tabernacolo': #cappella
			 tags['building'] = 'chapel'
			 tags['religion'] = 'christian'	
			 tags['amenity'] = 'place_of_worship'
	elif attrs['DESCR'] == 'tendone pressurizzato': #tendone
			 tags['building'] = 'sport'
			 tags['covered'] = 'yes'
	elif attrs['DESCR'] == 'tettoia': #tettoia
			 tags['building'] = 'roof'
			 tags['layer'] = '1'
	elif attrs['DESCR'] == 'torre': #torre
			 tags['building'] = 'tower'
			 tags['man_made'] = 'tower'
	elif attrs['DESCR'] == 'tribuna campo sportivo': #tribuna campo sportivo
			 tags['building'] = 'grandstand'
	elif attrs['DESCR'] == 'trullo': #trullo
			 tags['historic'] = 'building'
			 tags['building'] = 'trullo'
	elif attrs['DESCR'] == 'vasca rappresentabile': #vasca
			 tags['landuse'] = 'reservoir'
	elif attrs['DESCR'] == 'stazione elettrica': #stazione elettrica
			 tags['power'] = 'substation'
	elif attrs['DESCR'] == 'traliccio impianto eolico': #eolico
			 tags['power'] = 'generator'
			 tags['generator:source'] = 'wind'
	elif attrs['DESCR'] == 'traliccio rappresentabile': #traliccio elettrico
			 tags['power'] = 'power'
	elif attrs['DESCR'] == 'area aggetto': #pensilina
			 tags['building'] = 'roof'
			 tags['layer'] = '1'
			
	return tags

Changeset Tags

Changesets will be tagged like that: CTR Puglia (http://www.sit.puglia.it/portal/portale_cartografie_tecniche_tematiche/Download/Cartografie CC-by 4.0)

QA

Add your QA plan here.