How to import Urban SDK's CSV data into QGIS and display it as a layer.
1.0 Introduction
Comma Separated Value (CSV) files
Urban SDK provides all platform data as comma separated value (CSV) files and stores the geometry for each road segment or point within the "geometry" field of the file.
💡Tip: Providing data in CSV is one of the most efficient formats for storing and sharing large datasets and often requires significantly less storage space than other spatial formats like Shapefile, or GeoJson. Furthermore, CSV data has the advantage that it can be opened by most spreadsheet software such as Excel, without the need for complex data science tools.
Well-Known Text (WKT)
Each CSV downloaded from Urban SDK includes a "geometry" field that stores the vector geometry of each road segment in Well-Known Text (WKT) format which is a text markup language used for representing vector geometry objects, spatial reference systems of spatial objects, and transformations between spatial reference systems.
Coordinate Reference System (CRS)
All of Urban SDK's data is set to a common coordinate reference system (CRS) which is WGS 84 (EPSG:4326). "WGS" stands for World Geodetic System established in 1984, which comprises a standard coordinate frame for the Earth and a datum/reference. The system is used globally and is the default projection for many geographic information systems (GIS), including QGIS. It is necessary to set to this CRS in QGIS to be able to visually display Urban SDK's data.
2.0 Importing Data into QGIS
Step 1 - Open Delimited Text Layer Dialogue
Once you have opened QGIS, go to the "Layer" menu at the top, select "Add Layer", and then choose "Add Delimited Text Layer..." (see image above).
Step 2 - Select & Add File
To import and add the file as a layer within QGIS use the following steps within the Delimited Text dialogue (as shown in the image above):
- Select the CSV file within your file explorer.
- Set the file format to CSV
- Set the geometry definition to Well-Known Text (WKT) and set the "geometry" field within the CSV file, and set the type to "Detect". If "Detect" does not work, you can set it to "Line".
- Set the Geometry coordinate reference system (CRS) to WGS 84 (EPSG:4326). This ensures that QGIS will interpret the imported data appropriately for visualizing it spatially on a global map.
- Click the "Add" button at the bottom of the dialogue screen to add it to your map. Depending on the size of your file this may take a few minutes.
💡Tip: If you intend to make modifications to the layer, such as deleting road segments, or adding your own features to the layer, it is suggested that you save the layer as a GeoJson or Shapefile (see the instructions below).
3.0 Converting a CSV to another spatial format
Should you need to convert downloaded CSV data to another format, you can do this in QGIS using the following steps:
- Right click the CSV layer you imported into QGIS and navigate to "Export" and select "Save Features As..." (as shown in the image above).
- Select the file format you would like to save the data as. We suggest selecting either GeoJSON, or ESRI Shapefile if you intend on using this data in other GIS software.
- You will need to set a file name and save location for the file to be able to click ok at the bottom of the dialogue page.
- Choose whether you want to add the newly created file as a layer within QGIS by checking the "Add saved file to map" box, and then click "OK" to create the file. You should now see the newly created file within the folder you selected as the save location.
💡Tip: files saved as a GeoJSON will only be one file, while files saved as an ESRI Shapefile will have multiple files. To share Shapefiles you will need to zip these files together as they are necessary for import into GIS software.