{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "16aa59a2", "metadata": {}, "source": [ "# Second Test\n", "This is the second test. You work in teams of two persons. Find your partner in the table below. Make sure to hand-in your finished test as a `.pdf` file (or a zip folder containing the `.ipynb` file and the images) via e-mail. \n", "\n", "**Please provide sufficient screenshots and documentation for each of your steps.**\n", "\n", "These two files contain the geometries for your region:\n", "- urban_centers_grid_test_02.geojson\n", "- urban_centers_test_02.geojson\n", "\n", "Please hand in your results by `2024-01-12 18:00`.\n", "\n", "| Group | People | Region | Points |\n", "|-------| ------ |------- | ---- |\n", "| 01 | Tim + Clara | Southport | 57 + 30 = 87 | \n", "| 02 | Hannah + Lars | Ellesmere Port | 70 + 30 = 100 | \n", "| 03 | Johanna + Joel | Chester | 62 + 30 = 92 | \n", "| 04 | Teo + Matthias | Shrewsbury | 55 + 26 = 81 |\n", "| 05 | Lara + Maxi | Telford | 60 + 30 = 90 |\n", "| 06 | Celina + Max | Blackburn | 70 + 30 = 100 |\n", "| 07 | Amir + Philipp T. | Crewe | 52 + 30 = 82 | \n", "| 08 | Vincent + Sebastian | Rishton | 57 + 30 = 87 |\n", "| 09 | Philipp H. + Simon | Bury | 60 + 25 = 85 |\n", "| 10 | Melissa + Tobi | Burnley | 66 + 26 = 92 |" ] }, { "cell_type": "markdown", "id": "b7a2eaa9", "metadata": {}, "source": [ "## Completeness (70P)\n", "\n", "### Download and Prepare Data (10P)\n", "Download the reference dataset (Microsoft Global ML Building Footprints) containing buildings through [GitHub](https://github.com/microsoft/GlobalMLBuildingFootprints) and prepare the data for your area of interest.\n", "\n", "- Try to avoid downloading data for the entire country.\n", "- You can use the file microsoft_buildings_coverage_england.geojson to find out which quadkeys / regions overlap with your study area.\n", "- Download the Microsoft Buildings only for these regions. Check this file in GitHub: https://github.com/microsoft/GlobalMLBuildingFootprints/blob/main/scripts/make-gis-friendly.py\n", "- You will find the download links in this file: https://minedbuildings.blob.core.windows.net/global-buildings/dataset-links.csv.\n", "- Then clip the building dataset to your area of interest.\n", "\n", "\n", "### Process Reference Data (10P)\n", "Count the number of buildings and the overall building area in square meters using the reference data set for each 1km x 1km grid cell.\n", "\n", "- Make sure to transform the Microsoft Buildings into an appropriate projection.\n", "- Select all 1km x 1km grid cells for your area of interest from the given file (urban_centers_grid_test_02.geojson).\n", "- For the counts/area statistics per grid cell you can rely on the building centroid geometry.\n", "\n", "### Query ohsome API (20P)\n", "Query the ohsome API to derive the number of buildings and overall building area in OSM for each 1km x 1km grid cell.\n", "\n", "- You have to send two queries.\n", "- Consider in your queries buildings with the tags `yes`, `house`, `residential` and `garage`.\n", "- Save your results into a geojson file.\n", "- You can use and adjust the code snipped below. \n", "\n", "```\n", "import pandas as pd\n", "import geopandas as gpd\n", "from ohsome import OhsomeClient\n", "client = OhsomeClient()\n", "\n", "# load the geojson file with geopandas\n", "bpolys = gpd.read_file(\"your_file.geojson\")\n", "display(bpolys)\n", "\n", "... here comes the code to query the ohsome API ...\n", "\n", "# export your results as a geojson file\n", "results_df.reset_index(inplace=True)\n", "results_df[\"idx\"] = results_df[\"boundary\"].astype(int)\n", "results_df.set_index(\"idx\", inplace=True)\n", "join_df = bpolys.join(results_df)\n", "join_df.to_file(\"your_output_file.geojson\", driver='GeoJSON')\n", "```\n", "\n", "\n", "### Describe and Visualize Results (25P)\n", "Report on the overall (sum) building count and building area for your entire area of interest. How complete are OSM buildings for your area of interest in regard to count based completeness and area based completeness measures? (10P)\n", "\n", "Visualize your results for the 1km x 1km grid on two maps. The symbology should be based on (A) the ration between OSM / reference building area and (B) the ration between OSM / reference building count. (15P)\n", "\n", "\n", "### Discussion (5P)\n", "How are the measures different for your area of interest? What could be a reason for this difference?\n" ] }, { "cell_type": "code", "execution_count": null, "id": "6b41f90d", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "63185a12", "metadata": {}, "source": [ "## Currentness (30P)\n", "\n", "### Download Data (15P)\n", "Derive the currentness of OSM data for all buildings in your area of interest. Use a snapshot based approach for this analysis. Download all OSM elements according to the filter definition used in part one of this test. Make sure that this download includes the timestamp the OSM element has been edited the last time.\n", "\n", "### Process Data (10P)\n", "Categorize OSM elements into five groups based on their last edit timestamp. Use `2016-01-01`, `2018-01-01`, `2020-01-01` and `2022-01-01` as the thresholds. How many elements have been edited for each category?\n", "\n", "\n", "### Visualize Results (5P)\n", "Visualize the results on a map." ] }, { "cell_type": "code", "execution_count": null, "id": "1ead285c", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 5 }