Skip to content

Commit 70a1325

Browse files
committed
udpdate codebase
1 parent 7d0fbee commit 70a1325

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

developer_notes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## What is it?
44

55
- The repository is useful for creating _static_ and _dynamic_ maps with pins. Each pin has a quanitity and tag associated with it. The tag also determines the color of the pin e.g. [here](https://map.chemotion.scc.kit.edu/) the tags are 'Planned usage', 'Test usage' etc and the quantity is visible by hovering over the pins.
6-
- The repository consists primarly of a single python script called [`generate_map.py`](generate_map.py). When given a single argument `germany`, it produces a static map of Germany with instances marked on it. Otherwise it produces a static map of European countries as well as a dynamic map of the world with instances marked on it.
6+
- The repository consists primarily of a single python script called [`generate_map.py`](generate_map.py). When given a single argument `germany`, it produces a static map of Germany with instances marked on it. Otherwise it produces a static map of European countries as well as a dynamic map of the world with instances marked on it.
77
- The workflow is supported by data in the [`data`](data) folder.
88
- The workflow is automated for GitHub actions using [`map_workflow`](.github/workflows/map_workflow.yml) file.
99

@@ -56,7 +56,7 @@ This can be done by adding JSON entries to the [data/plotted_locations.json](dat
5656
},
5757
```
5858

59-
where `common_name` is the name of the city/region (in language of your choice), `id_name` is the standard name of the city/region (in Europe) according to the NUTS standard or, for places outside Europe, the `name` as used by Natural Earth geojson (most likely the common English name), `stage` is the key that corresponds to `stage` variable in the script, `num_users` is the number of users in that location -- which then appears on the map -- and `country_code` is the [two letter country code as defined by ISO](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
59+
where `common_name` is the name of the city/region (in language of your choice), `id_name` is the standard name of the city/region (in Europe) according to the NUTS standard or, for places outside Europe, the `ls_name` as used by Natural Earth geojson (most likely the common English name), `stage` is the key that corresponds to `stage` variable in the script, `num_users` is the number of users in that location -- which then appears on the map -- and `country_code` is the [two letter country code as defined by ISO](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
6060

6161
### Changing appearence
6262

generate_map.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
color_based_on = "NUTS_NAME"
2828
map_filename = "germany.svg"
2929
elif no_germany:
30-
legend_location = (0.8, 0.25)
30+
legend_location = (0.8, 0.4)
3131
color_based_on = "CNTR_CODE"
3232
map_filename = "restofeur.svg"
3333
else:
34-
legend_location = (0.5, 0.7)
34+
legend_location = (0.8, 0.4)
3535
color_based_on = "CNTR_CODE"
3636
map_filename = "europe.svg"
3737

@@ -98,7 +98,7 @@
9898
# try and get location from the european city list
9999
geometry = eur_location[eur_location.NUTS_NAME == row.id_name].geometry
100100
if geometry.empty: # if not then check international cities list
101-
geometry = int_location[int_location.name == row.id_name].geometry
101+
geometry = int_location[int_location.ls_name == row.id_name].geometry
102102
if geometry.empty: # if still not found then raise error
103103
raise IndexError(
104104
"Could not place the following location on map: "+row.common_name)
@@ -125,7 +125,8 @@
125125
eur_country.CNTR_CODE)].to_crs("EPSG:3857")
126126

127127
# plot countries map
128-
fig, ax = plt.subplots(1, figsize=(10, 10), tight_layout=True)
128+
fig, ax = plt.subplots(1, tight_layout=True,
129+
figsize=((12, 12) if only_germany else (20, 20)))
129130
ax = eur_country.plot(ax=ax, column=color_based_on,
130131
cmap='tab20', edgecolor='w')
131132
# plot the patches

0 commit comments

Comments
 (0)