Zanzibar Typology QGIS Map Guidelines
There is a QGIS project that connects to a sqlite database to render all OSM data.
It contains map layers of:
- Architectural Typology
- Architectural Style
- Building Condition
- Urban Typology
- A base layer with roads and building outlines
JOSM File
In Josm download the area you want to turn into a map. The whole Ng'ambo area is too big to download at once (especially if you include Stone Town). You can download different pieces. For this, just move the map around, and re-press the download button. The download tool will draw a square over the visible area for you. Once you have selected several areas, they show as seperate layers in the layer tool.
Select one layer, and in the Edit menu, choose 'Merge Layers'. Merge all your layers until there is 1 left.
Then, in the File menu, select 'Save As...' and save all the data as a file, eg. Ngambo.josm
This .josm file is the input for the next step in QGIS.
SQLite Database
You need to (re) create the database to get the latest information. There is a Nice tutorial on LearnOSM that explains how this works.
The database file should be called Ngambo.osm.db and be located in the same folder as the QGIS project file.
You need to export 3 topologies to SQLite.
buildings
Call the table 'buildings', Export type is 'Polygons'.
Click the 'Load from Database button, and select the following fields:
- addr:city
- addr:country
- addr:housename
- addr:housenumber
- addr:postcode
- addr:street
- alt_name
- amenity
- architect
- building
- building:architecture
- building:architecture:historic
- building:architecture:typology
- building:colour
- building:condition
- building:levels
- building:material
- building:structure
- historic
- name
- office
- old_name
- religion
- roof:colour
- roof:material
- roof:shape
- roof:structure
- shop
- start_date
- tourism
- website
- wikipedia
- wikidata
roads
Call the table 'roads', Export type is 'Polylines'.
Click the 'Load from Database button, and select the following fields:
- "highway" > Check 'Not Null'
- "name"
- "smoothness"
- "surface"
- "barrier"
- "width"
waterways
Call the table 'roads', Export type is 'Polylines'.
Click the 'Load from Database button, and select the following fields:
- "waterway" > Check 'Not Null'
- "name"
urbantypologies
Call the table 'urbantypologies', Export type is 'Polygons'.
Click the 'Load from Database button, and select the following fields:
- "urban:typology" > not null
naturalareas
Call the table 'naturalareas', Export type is 'Polygons'.
Click the 'Load from Database button, and select the following fields:
- "natural" > not null
- name
leisureareas
Call the table 'leisureareas', Export type is 'Polygons'.
Click the 'Load from Database button, and select the following fields:
- "leisure" > not null
- name
- sport
tourismareas
Call the table 'tourismareas', Export type is 'Polygons'.
Click the 'Load from Database button, and select the following fields:
- "tourism" > not null
- name
landuse
Call the table 'landuse', Export type is 'Polygons'.
Click the 'Load from Database button, and select the following fields:
- "landuse" > not null
- name
shops
Call the table 'shops', Export type is 'Points'.
Click the 'Load from Database button, and select the following field:
- "shop" > not null
trees
Call the table 'trees', Export type is 'Points'.
Click the 'Load from Database button, and select the following fields:
- "natural" > not null
- leaf_type
- circumference
- height
- genus
- leaf_cycle
Buildings with Shops
Unless there is a very clear mixed usage of a building (say: floor 1 is shop, floor 2 is hotel) we tag the main building with the main functonality and then add POI shop= (mostly) to indicate little shops or windows from which items are sold. In order to display this, we need to generate a new shapefile.
- Click Vector > Data Management Tools > Join Attributes by Location
- In the first field select 'Buildings'
- In the second field select 'Shops'
- Select 'take attributes of the first located feature'
- Create the file 'BuildingWithShops\BuildingWithShops.shp' where 'BuildingWithShops' is a subfolder from where the QGIS project is
- Select 'Keep all records (etc.)
- Click OK
- Don't add the layer when suggested, it is already there.
You might have to save the project and re-open to see the new data.
If you delete this layer, you need to re-add this flter:
("building" LIKE '%;%' AND "building" != 'commercial') OR ("shop" IS NOT NULL AND "building" != 'commercial') OR ("shop_2" IS NOT NULL AND "building" != 'commercial')
ToDo
- Create proper Print Composers
- Create black & white print Styles
- Create 1 (python?) script that downloads the OSM file and completely regenerates the new sqllite db file.
Open Issues
Data Ranges
To store the dates of contruction we use the Date namespace on construction=*. During transformation of the data from .osm to sqlite format the result of this is that every namespace generates one column (if selected). This is impossible to work with. Suggestion: Write a script that processes the .osm file and transforms contruction:1960-1970 formatted keys into 2 columns contructon_start and contruction_end with the respective values.