|
2 | 2 | from pathlib import Path
|
3 | 3 | import pytest
|
4 | 4 |
|
5 |
| -from hydrodiy.gis.oz import REGIONS, HAS_PYSHP, ozlayer, ozcities |
| 5 | +from hydrodiy.gis.oz import REGIONS, HAS_PYSHP, ozlayer, ozcities, CAPITAL_CITIES |
6 | 6 | from hydrodiy.plot import putils
|
7 | 7 |
|
8 | 8 | import numpy as np
|
@@ -80,7 +80,7 @@ def test_ozlayer_proj():
|
80 | 80 | plt.savefig(fp)
|
81 | 81 |
|
82 | 82 |
|
83 |
| -def test_ozcities(): |
| 83 | +def test_ozcities_kw(): |
84 | 84 | """ Test plotting oz cities """
|
85 | 85 | plt.close("all")
|
86 | 86 | fig, ax = plt.subplots()
|
@@ -141,6 +141,39 @@ def test_ozcities_proj():
|
141 | 141 | plt.savefig(fp)
|
142 | 142 |
|
143 | 143 |
|
| 144 | +def test_ozcities_manual(): |
| 145 | + """ Test plotting oz cities using filter """ |
| 146 | + plt.close("all") |
| 147 | + fig, ax = plt.subplots() |
| 148 | + lines = ozlayer(ax, "ozcoast50m", \ |
| 149 | + color="k", lw=0.5, fixed_lim=False) |
| 150 | + |
| 151 | + cities = dict( |
| 152 | + Sydney=[-33.86785, 151.20732], \ |
| 153 | + Melbourne=[ -37.814, 144.96332], \ |
| 154 | + Brisbane=[-27.46794, 153.02809], \ |
| 155 | + Perth=[-31.95224, 115.8614], \ |
| 156 | + Adelaide=[-34.92866, 138.59863], \ |
| 157 | + Canberra=[-35.28346, 149.12807], \ |
| 158 | + Newcastle=[-32.92953, 151.7801], \ |
| 159 | + Wollongong=[-34.424, 150.89345], \ |
| 160 | + Geelong=[-38.14711, 144.36069], \ |
| 161 | + Hobart=[-42.87936, 147.32941], \ |
| 162 | + Townsville=[-19.26639, 146.80569], \ |
| 163 | + Cairns=[-16.92366, 145.76613], \ |
| 164 | + Ballarat=[-37.56622, 143.84957], \ |
| 165 | + Toowoomba=[-27.56056, 151.95386], \ |
| 166 | + Darwin=[-12.46113, 130.84185], \ |
| 167 | + Mandurah=[-32.5269, 115.7217], \ |
| 168 | + Mackay=[-21.15345, 149.16554], \ |
| 169 | + Bundaberg=[-24.86621, 152.3479] |
| 170 | + ) |
| 171 | + c = {n: (cc[1], cc[0]) for n, cc in cities.items()} |
| 172 | + elems = ozcities(ax, cities=c) |
| 173 | + |
| 174 | + fp = FIMG / "ozcities_manual.png" |
| 175 | + plt.savefig(fp) |
| 176 | + |
144 | 177 |
|
145 | 178 |
|
146 | 179 |
|
0 commit comments