CLIMADA & OpenStreetMap

CLIMADA provides some ways to make use of the entire OpenStreetMap data world and to use those data within the risk modelling chain of CLIMADA as exposures.

This tutorial will walk you through the two major parts in detail: * Getting the data * Converting it into a useful Exposures() format or refining existing coarse-scale LitPop() exposures for impact calculations.

The openstreetmap module hence contains two sub-modules:

  • osm_dataloader.py, which handles the loading of raw map data and the extraction of specific info into useful geodataframe formats

  • osm_exposuremaker.py, which deals with the step of converting map info into a climada.exposures instance as well as some links to the LitPop exposure.

Outline

  • Part 1: Downloading OSM Data

    • 1.1 From extracting data in country-wise data-dumps obtained from Geofabrik

    • 1.2 From exracting data in custom-cut data dumps obtained from the planet file

    • 1.3 From direct API-queries over the overpass-api.

  • Part 2: Converting OSM Data to CLIMADA Exposures

    • 2.1 Setting up a new Exposures instance using OSM data

    • 2.2 Using OSM data as stencils to downscale LitPop exposure instances

## Part 1: Downloading OSM data

Which methods exist for getting data and which one is right for my query?

This module (osm_dataloader.py) provides 3 “pathways” to obtain OSM data in useable geodataframe format:

Two pathways first download all map raw data witin a certain geographic area that is on OSM, in the OSM-specific data format (osm.pbf). Then, an SQL query extracts only the info that is wanted and loads it into memory. They only differ in terms of the size of the raw data: Either countries are downloaded (from a daily-updated provider, Geofabrik.de), or the entire planet file is downloaded once, and sub-files with raw data for any desired custom-made region are cut out form this planet file. The query/extraction process afterwards is the same.

The other pathway directly and selectively loads the desired info from the overpass-turbo API, without downloading the complete raw data dumps beforehand. This is however heavily constrained in terms of download quota and not very stable.

They pathways are illustrated below. The described functionalities are contained in 3 classes: * OSMRaw - methods to download raw map datafiles from servers, at country or planet-scale. * OSMFileQuery - methods to extract specific info from the raw files and assemble them into gdfs. * OSMApiQuery - methods to directly load specific map info & assemble into gdfs, via the overpass-turbo API.

image-2.png

A few words on the OSM data world, OSM overpass-turbo, Overpass QL & OSM data structures (nodes, ways, relations)

OSM tags, key-value pairs, and quick overview on “what’s out there” Check out https://taginfo.openstreetmap.org/ for finding the key-value pairs (“tags”) you’re looking for. You will need to know this for specifying your query (at least in the API-pathway). Check out https://overpass-turbo.eu/ for a fast visual overview on results that your query will yield.

The OSM API (overpass): The OSM API has constraints on how much can be downloaded at once (reached quite fast, especially around mid-day / early afternoon..). This is why providers (such as Geofabrik) exist that generate data daily data dumps of all the OSM data that exists. For the API downloading strategy, wait-times are implemented in the querying, but re-consider your strategy if you run into a time-out error. Overpass Query language, which is needed to query directly from the OSM API can be a bit cryptic. The majority of what you will need is transformed in the OSMApiQuery class automatically. For more, check out the detailed read-the-docs: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL

OSM data structures: Elements are the basic components of OpenStreetMap’s conceptual data model of the physical world. Elements are of three types:

  • nodes (defining points in space),

  • ways (defining linear features and area boundaries), and

  • relations (which are sometimes used to explain how other elements work together).

Check out https://wiki.openstreetmap.org/wiki/Elements for more info.

### Part 1.1: Extracting info from country-wise raw data dumps

In this example, we download the data dump for a country (Honduras) from Geofabrik. While Geofabrik provides two formats: shapefiles (.shp) and protocol binary format (.pbf), the latter has much smaller file sizes. In the second step, specific info can be extracted from the raw files, unsing the OSMFileQuery. The query functions work for .pbf format only (since shapefiles can be directly read into gdfs and filtered afterwards).

[1]:
import matplotlib.pyplot as plt
import shapely
import contextily as ctx
from pathlib import Path

from climada_petals.entity.exposures.openstreetmap.osm_dataloader import OSMRaw, OSMApiQuery, OSMFileQuery
from climada import CONFIG

DATA_DIR = CONFIG.exposures.openstreetmap.local_data.dir()
[2]:
# download osm.pbf file for Honduras from geofabrik (checks if file honduras-latest.osm.pbf already exists)
OSMRaw().get_data_geofabrik('HND', file_format='pbf', save_path=DATA_DIR)
2021-10-19 10:21:58,148 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - file already exists as /Users/evelynm/climada/data/openstreetmap/honduras-latest.osm.pbf
[3]:
# Initiate a OSMFileQuery instance with path to the downloaded file
HNDFileQuery = OSMFileQuery(Path(DATA_DIR,'honduras-latest.osm.pbf'))

Extracting critical infrastructures with pre-written filequery wrappers

For critical infrastructures, a set of wrappers exist that perform the query under the hood. They collect a range of applicable tags from openstreetmap that go under the respective infrastructure type and load all of them into one dataframe. The reported columns and tags that are queried can be inspected (and modified) in the dictionary DICT_CIS_OSM:

[4]:
from climada_petals.entity.exposures.openstreetmap.osm_dataloader import DICT_CIS_OSM
[5]:
# check available critical infrastructure types:
DICT_CIS_OSM.keys()
[5]:
dict_keys(['education', 'healthcare', 'water', 'telecom', 'road', 'rail', 'air', 'gas', 'oil', 'power', 'wastewater', 'food'])
[6]:
# lets extract all roads from the Honduras file, via the CI-wrapper
gdf_roads = HNDFileQuery.retrieve_cis('road')
2021-10-19 10:22:05,698 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - query is finished, lets start the loop
extract points: 0it [00:00, ?it/s]
2021-10-19 10:22:07,204 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - query is finished, lets start the loop

extract multipolygons: 0it [00:17, ?it/s]
2021-10-19 10:22:43,021 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - query is finished, lets start the loop

extract lines: 100%|█████████████████████████████████████████████████████████████████████| 5628/5628 [00:04<00:00, 1297.12it/s]
[7]:
# plot results
ax = gdf_roads.set_crs(epsg=4326).to_crs(epsg=3857).plot(figsize=(15, 15), alpha=1, markersize=5, color='blue',
                    edgecolor='blue', label='roads HND')
handles, labels = ax.get_legend_handles_labels()
ax.legend(handles=handles, loc='upper left')
ax.set_title('Roads Honduras', fontsize=25)
ctx.add_basemap(ax)
plt.show()
../_images/tutorial_climada_exposures_openstreetmap_20_0.png

Extracting any other info from the data dump

Any other tags that are available on openstreetmap can also be queried with the retrieve() method. Two variables have to be specified: osm_keys, a list with all the columns to report in the gdf, and osm_query, a string of key-value constraints to apply during the search.

The osmconf.ini file - need to know: The retrieve function needs a configuration file, where it is specified for which geometry types it should look, given which key or key-value pair. The osmconf.ini file is located under ~\exposures\openstreetmap\osmconf.ini. All more common keys or key-value pairs have been included in this file, but it is worth checking that your query doesn’t contain any unknown ones. Else, enter it in the respective paragraph:

For example under [points], in the attributes= section, all the keys / key-value pairs are reported that should be extracted, if they have a point geometry. You can see that the key building exists both in the points as well as in the multipolygons section, meaning that the query will extract all instances of building in a raw file that are of type point or multipolygon.

[4]:
# Forests in HND.
osm_keys = ['landuse']
osm_query = "landuse='forest'"
gdf_forest = HNDFileQuery.retrieve('multipolygons', osm_keys, osm_query)
2021-10-19 13:28:12,479 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - query is finished, lets start the loop
extract multipolygons: 100%|████████████████████████████████████████████████████████████████| 689/689 [00:04<00:00, 154.88it/s]
[5]:
# Plot results
ax = gdf_forest.set_crs(epsg=4326).to_crs(epsg=3857).plot(figsize=(15, 15), alpha=1, markersize=5, color='blue',
                    edgecolor='blue', label='forests HND')
handles, labels = ax.get_legend_handles_labels()
ax.legend(handles=handles, loc='upper left')
ax.set_title('Forests Honduras', fontsize=25)
ctx.add_basemap(ax)
plt.show()
../_images/tutorial_climada_exposures_openstreetmap_23_0.png

### Part 1.2 Extracting info from custom-cut raw data dumps

Instead of retrieving all the applicable data within a country raw data file, we can cut out any desired shape or bounding box from the entire planet file (has to be downloaded first once, ca. 60 GB) and then perform an extraction on this sub-file.

To cut out shapes from the planet.osm.pbf file, we use command line tool osmosis under the hood. The desired shapes have to be provided as .poly files (See e.g. https://github.com/ElcoK/osm_clipper for admin3 to admin1 level shape conversions), whereas bounding boxes can be passed as lists ([xmin, ymin, xmax, ymax])

Osmosis likely needs to be installed first (works for Windows, Linux and Apple -https://wiki.openstreetmap.org/wiki/Osmosis/Installation)

Note 1 Downloads planet file at first call.

Note 2 Takes quite a while to cut out certain parts (up to an hour..)

[25]:
# Define a bbox around roughly Honduras, San Salvador & Nicaragua
bbox_customreg = [-90.043806, 10.939216, -83.116254, 15.956278]

# Specify filepaths for planet file and for new file
path_planet = Path(DATA_DIR, 'planet-latest.osm.pbf')
path_extract = Path(DATA_DIR, 'HND_NIC_SLV.osm.pbf')

OSMRaw().get_data_planetextract(shape=bbox_customreg,
                                path_extract=path_extract,
                                path_planet=path_planet)
2021-10-01 12:19:13,175 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - Extracted file already exists!

Now we can repeat a similar query (e.g. road data) for our newly cut-out data region.

[20]:
HndNicSlvFileQuery = OSMFileQuery(path_extract)
gdf_roads_HndNicSlv = HndNicSlvFileQuery.retrieve_cis('road')
extract points: 100%|████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00,  1.30it/s]
extract multipolygons: 100%|███████████████████████████████████████████████████████████████████████████| 49/49 [00:23<00:00,  2.09it/s]
extract lines: 100%|███████████████████████████████████████████████████████████████████████████| 18485/18485 [00:09<00:00, 2017.80it/s]
[23]:
# plot results
ax = gdf_roads_HndNicSlv.set_crs(epsg=4326).to_crs(epsg=3857).plot(figsize=(15, 15), alpha=1, markersize=5, color='blue',
                    edgecolor='blue', label='roads')
handles, labels = ax.get_legend_handles_labels()
ax.legend(handles=handles, loc='upper left')
ax.set_title('Roads within [-90.043, 10.939, -83.116, 15.956]', fontsize=25)
ctx.add_basemap(ax)
plt.show()
../_images/tutorial_climada_exposures_openstreetmap_29_0.png

### Part 1.3: Directly loading data from the overpass-API

At the moment, the OSMApiQuery class accepts both an area and a query condition as inputs.

Area can be a bounding box (xmin, ymin, xmax, ymax) or a polygon. The query conditions must be a string in the format '["key"]' or '["key"="value"]', etc. For more query syntaxes, have a look at the OverpassQL page.

Example: Buildings & Churches in the city of Zurich

[27]:
# reload required modules
import shapely
from climada_petals.entity.exposures.openstreetmap.osm_dataloader import OSMApiQuery
from climada import CONFIG

DATA_DIR = CONFIG.exposures.openstreetmap.local_data.dir()
[28]:
# Two area-formats that are accepted: a bounding box tuple or list (xmin, ymin, xmax, ymax) and polygons
area_bbox = (8.5327506, 47.368260, 8.5486078, 47.376877)
area_poly = shapely.geometry.Polygon([(8.5327506, 47.368260), (8.5486078, 47.376877), (8.5486078, 47.39)])

# Two examples for query conditions:
condition_church = '["amenity"="place_of_worship"]'
condition_builidng = '["building"]'

# Initialize OSMApiQuery instances
zrh_churchquery_bbox = OSMApiQuery(area_bbox, condition_church)
zrh_buildingquery_poly = OSMApiQuery(area_poly, condition_builidng)

After instantiating the queries with an area and a query condition, the data can now be downloaded from the overpass-API. Depending on the time of the day and the size of the query, this can lead to overloads.

The following request should be small enough that it always works:

[29]:
gdf_zrh_churches = zrh_churchquery_bbox.get_data_overpass()
/Users/evelynm/climada_petals/climada_petals/entity/exposures/openstreetmap/osm_dataloader.py:659: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  data=np.array([data_id,data_geom,data_tags]).T,
[30]:
gdf_zrh_buildings = zrh_buildingquery_poly.get_data_overpass()
2021-10-01 14:21:16,477 - climada_petals.entity.exposures.openstreetmap.osm_dataloader - INFO - Empty geometry encountered.
/Users/evelynm/climada_petals/climada_petals/entity/exposures/openstreetmap/osm_dataloader.py:625: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  data=np.array([data_id,data_geom,data_tags]).T,
/Users/evelynm/climada_petals/climada_petals/entity/exposures/openstreetmap/osm_dataloader.py:568: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  data=np.array([data_id,data_geom,data_tags]).T,
/Users/evelynm/climada_petals/climada_petals/entity/exposures/openstreetmap/osm_dataloader.py:659: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  data=np.array([data_id,data_geom,data_tags]).T,

Let’s have look at our downloaded data. The downloaded data is assembled into a geodataframe with an osm_id column and a tags columns. The latter reports all the tags associated with the respective result.

[31]:
gdf_zrh_churches
[31]:
osm_id geometry tags
0 24701951 POLYGON ((8.54050 47.37097, 8.54058 47.37098, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
1 33854803 POLYGON ((8.54552 47.37404, 8.54552 47.37404, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
2 36916418 POLYGON ((8.54413 47.37017, 8.54405 47.37021, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
3 40478435 POLYGON ((8.54656 47.37475, 8.54628 47.37464, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
4 80338523 POLYGON ((8.53520 47.37333, 8.53494 47.37345, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
5 80340830 POLYGON ((8.53661 47.37279, 8.53676 47.37289, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
6 89469961 POLYGON ((8.53964 47.37177, 8.53929 47.37166, ... {'addr:housenumber': '2', 'addr:street': 'Münz...
7 89967877 POLYGON ((8.54120 47.36959, 8.54120 47.36962, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
8 112795856 POLYGON ((8.54317 47.36953, 8.54314 47.36952, ... {'addr:housenumber': '29', 'addr:street': 'Lim...
9 292437788 POLYGON ((8.54482 47.37039, 8.54477 47.37037, ... {'amenity': 'place_of_worship', 'building': 'y...
10 473379001 POINT (8.54548 47.37638) {'amenity': 'place_of_worship', 'denomination'...
11 2960912930 POINT (8.54500 47.37560) {'amenity': 'place_of_worship', 'name': 'Gemei...
[32]:
gdf_zrh_churches.plot()
[32]:
<AxesSubplot:>
../_images/tutorial_climada_exposures_openstreetmap_40_1.png
[33]:
gdf_zrh_buildings
[33]:
osm_id geometry tags
0 4633 POLYGON ((8.54832 47.37961, 8.54831 47.37936, ... {'addr:housename': 'ETH CHN', 'amenity': 'univ...
1 7565 GEOMETRYCOLLECTION EMPTY {'building': 'public', 'name': 'Kaspar Escher-...
2 405794 POLYGON ((8.54124 47.37587, 8.54119 47.37583, ... {'addr:city': 'Zürich', 'addr:country': 'CH', ...
3 4235320 POLYGON ((8.54372 47.37844, 8.54377 47.37804, ... {'building': 'yes', 'type': 'multipolygon'}
4 4281153 POLYGON ((8.53952 47.37959, 8.53952 47.37960, ... {'addr:housenumber': '2', 'addr:street': 'Muse...
... ... ... ...
1034 856356524 POLYGON ((8.53983 47.37719, 8.53980 47.37714, ... {'building': 'roof', 'layer': '1'}
1035 856356525 POLYGON ((8.53977 47.37709, 8.53974 47.37704, ... {'building': 'roof', 'layer': '1'}
1036 914770840 POLYGON ((8.54860 47.37776, 8.54856 47.37776, ... {'addr:housenumber': '2b', 'addr:street': 'Uni...
1037 914770854 POLYGON ((8.54855 47.37961, 8.54832 47.37961, ... {'addr:city': 'Zürich', 'addr:housenumber': '2...
1038 4838594360 POINT (8.54019 47.37789) {'building': 'kiosk', 'level': '-2', 'name': '...

1039 rows × 3 columns

[34]:
gdf_zrh_buildings.plot()
[34]:
<AxesSubplot:>
../_images/tutorial_climada_exposures_openstreetmap_42_1.png

## Part 2: CLIMADA Exposures from OSM data

As from this stage on, the user has geodataframe(s) at their hand with point, polygon and / or line geometries, the tutorial in climada_python/doc/tutorial/entity_exposures_lines_polygons gives detailed info on how to generally handle those types within CLIMADA exposures.

For completeness, a short demo will still be given here using OSM data.

Disclaimer As of the current state (Oct. 2021), the lines & polygons functionalities work only on climada_python branch feature/lines_polygons_exp. Hence you need to be on this branch to execute the following cells.

### Part 2.1: Setting up a high-res CLIMADA exposure from scratch with point, line & polygon data from OSM

The general steps are the following to create exposures from line or polygon data from OSM:

  1. Lines / Polygons to points: Specify a metre distance into which lines are split, or a m2 area into which polygons are split, to get an interpolated gdf.

  2. Valuation: Indicate a value per meter or m2, or use LitPop asset values to re-distribute proportionally.

  3. Point-Exposure is ready to use

  4. Re-aggregation to intial shapes after impact calculation.

Example 1: CLIMADA exposure from OSM polygon-data (buildings)

We will take the previously loaded gdf of buildings in Zurich (gdf_zrh_buildings) as input. Assuming that 1 m2 of building area has a value of (arbitrary) 5400 $ (m2_value), we can set up a CLIMADA point exposure for one point per 50m2 (m2_per_point) using the respective Exposures method set_from_polygons :

Note The following cells rely on functions from a climada-python branch that is work-in-progress. If you want to execute them, please switch to branch feature/lines_polygons_exp on climada_python.

[35]:
"""
from climada.entity.exposures import Exposures

# gdf needs to be in a projected CRS (lat/lon) to allow for constructing metre-based grids
gdf_zrh_buildings = gdf_zrh_buildings.set_crs(epsg=4326)

exp_buildings_zrh = Exposures()
# one point per 50m2, 5400$/m2 assumed value, all points same value ('cnst'):
exp_buildings_zrh.set_from_polygons(gdf_zrh_buildings, m2_per_point=50, m2_value=5400, disagg_values='cnst')
"""
2021-10-01 14:22:07,492 - climada.util.coordinates - INFO - Empty geometries encountered. Skipping those.
2021-10-01 14:22:07,510 - climada.util.coordinates - INFO - Got an empty geometry. Returning None.
2021-10-01 14:22:07,584 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,595 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,598 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,605 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,610 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,612 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,616 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,617 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,621 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,629 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,632 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,636 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,654 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,656 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,692 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,695 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,701 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,706 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,711 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,762 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,771 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,777 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,782 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,788 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,835 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,837 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,838 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,852 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,862 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,869 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,876 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,879 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,883 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,889 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,899 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,903 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,907 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,914 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,917 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,926 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,934 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,944 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,947 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,964 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,967 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,971 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,976 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,980 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,982 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,984 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,986 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,989 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,992 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,994 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:07,997 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,000 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,004 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,007 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,010 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,013 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,026 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,030 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,035 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,037 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,038 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,041 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,044 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,046 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,050 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,052 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,056 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,059 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,063 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,070 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,072 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,075 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,077 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,079 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,082 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,086 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,088 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,092 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,096 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,118 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,122 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,125 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,126 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,131 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,138 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,141 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,158 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,160 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,163 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,165 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,170 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,171 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,173 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,175 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,177 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,179 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,182 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,186 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,187 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,189 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,191 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,193 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,197 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,202 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,204 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,206 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,208 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,209 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,211 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,216 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,223 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,225 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,226 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,228 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,230 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,236 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,237 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,240 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,242 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,248 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,250 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,261 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,263 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,265 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,267 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,270 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,272 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,275 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,277 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,285 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,308 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,312 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,315 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,320 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,323 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:08,708 - climada.entity.exposures.base - INFO - Setting latitude and longitude attributes.
[36]:
"""
# Looking at the newly constructed exposure
exp_buildings_zrh.gdf.plot('value')
"""
[36]:
<AxesSubplot:>
../_images/tutorial_climada_exposures_openstreetmap_50_1.png

Instead of just assuming an arbitrary m2-value for the asset valuation, we can also use an estimate from LitPop, by specifiying the respective kwargs in the set_from_polygons method:

[37]:
"""
from climada.entity.exposures import Exposures

# gdf needs to be in a projected CRS (lat/lon) to allow for constructing metre-based grids
gdf_zrh_buildings = gdf_zrh_buildings.set_crs(epsg=4326)

exp_buildings_zrh = Exposures()
# one point per 50m2, value per point taken from LitPop estimate ('litpop'),
# for an area lying in Switzerland (`CHE`):
exp_buildings_zrh.set_from_polygons(gdf_zrh_buildings, m2_per_point=50, disagg_values='litpop', countries='CHE')
"""
2021-10-01 14:22:19,149 - climada.util.coordinates - INFO - Empty geometries encountered. Skipping those.
2021-10-01 14:22:19,168 - climada.util.coordinates - INFO - Got an empty geometry. Returning None.
2021-10-01 14:22:19,242 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,252 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,255 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,262 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,266 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,268 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,272 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,274 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,277 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,285 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,288 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,292 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,311 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,312 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,346 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,349 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,353 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,358 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,362 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,411 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,421 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,427 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,433 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,440 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,488 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,490 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,492 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,506 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,516 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,524 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,533 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,535 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,539 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,544 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,554 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,559 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,563 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,569 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,571 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,581 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,585 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,597 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,602 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,621 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,624 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,629 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,634 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,638 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,639 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,642 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,643 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,646 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,649 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,651 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,653 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,656 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,661 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,664 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,667 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,670 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,683 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,687 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,693 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,694 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,696 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,699 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,701 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,704 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,710 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,713 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,716 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,719 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,723 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,727 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,729 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,731 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,733 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,735 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,739 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,742 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,745 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,748 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,752 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,774 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,777 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,779 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,780 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,785 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,791 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,795 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,812 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,815 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,818 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,821 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,825 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,826 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,828 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,830 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,833 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,835 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,837 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,841 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,843 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,845 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,847 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,850 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,854 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,859 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,861 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,863 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,865 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,867 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,869 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,873 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,880 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,882 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,884 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,886 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,888 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,893 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,895 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,897 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,900 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,907 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,909 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,921 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,923 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,925 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,927 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,931 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,933 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,935 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,938 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,944 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,967 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,971 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,973 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,978 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:19,981 - climada.util.coordinates - INFO - Chosen resolution too coarse for polygon.
                    Assigning one representative point instead
2021-10-01 14:22:20,444 - climada.entity.exposures.litpop.litpop - INFO -
 LitPop: Init Exposure for country: CHE (756)...

2021-10-01 14:22:20,447 - climada.entity.exposures.litpop.gpw_population - INFO - GPW Version v4.11
2021-10-01 14:22:22,031 - climada.util.finance - INFO - GDP CHE 2014: 7.344e+11.
2021-10-01 14:22:22,717 - climada.util.finance - INFO - GDP CHE 2015: 7.021e+11.
2021-10-01 14:22:22,762 - climada.entity.exposures.base - INFO - Hazard type not set in impf_
2021-10-01 14:22:22,763 - climada.entity.exposures.base - INFO - category_id not set.
2021-10-01 14:22:22,764 - climada.entity.exposures.base - INFO - cover not set.
2021-10-01 14:22:22,765 - climada.entity.exposures.base - INFO - deductible not set.
2021-10-01 14:22:22,765 - climada.entity.exposures.base - INFO - centr_ not set.
2021-10-01 14:22:25,656 - climada.entity.exposures.base - INFO - Setting latitude and longitude attributes.
[38]:
"""# Looking at the newly constructed exposure
exp_buildings_zrh.gdf.plot('value')
"""
[38]:
<AxesSubplot:>
../_images/tutorial_climada_exposures_openstreetmap_53_1.png

### Part 2.2: Refining LitPop - Cutting out low value areas using OSM info

The idea behind this “reverse approach” to the one demonstrated before is to use OpenStreetMap info as a “stencil” for downscaling the coarser LitPop asset values (roughly 1x1km2), by defining low-value areas, and allocating all LitPop values to the remaining area.

There are in turn several methods on how the allocation is done: * equally spreading out the gridcell value on all the “valid” areas * re-locating LitPop values based on nearest-neighbour centroids

Example for cutting out “low-value” features from LitPop cells

“Low value features” in terms of asset values, i.e. natural areas, etc. can be found on OSM under the following keys and key-value pairs (not extensive list): * ‘natural’, * ‘water’, * ‘waterway’, * ‘landuse=forest’, * ‘landuse=farmland’, * ‘landuse=grass’, * ‘wetland’

[39]:
# Load required packages:

[ ]:
# One command does it all (getting LitPop Exp, re-assigning values, converting back into exposure format)

Example for assigning high-value features to LitPop cells

[ ]: