matplotlib-map-utils 3.0.1__py3-none-any.whl → 3.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matplotlib_map_utils/core/inset_map.py +64 -40
- matplotlib_map_utils/core/north_arrow.py +24 -9
- matplotlib_map_utils/core/scale_bar.py +266 -197
- matplotlib_map_utils/defaults/scale_bar.py +5 -0
- matplotlib_map_utils/validation/functions.py +3 -6
- matplotlib_map_utils/validation/inset_map.py +3 -0
- matplotlib_map_utils/validation/north_arrow.py +1 -0
- matplotlib_map_utils/validation/scale_bar.py +7 -4
- matplotlib_map_utils-3.1.1.dist-info/METADATA +1158 -0
- {matplotlib_map_utils-3.0.1.dist-info → matplotlib_map_utils-3.1.1.dist-info}/RECORD +13 -13
- matplotlib_map_utils-3.0.1.dist-info/METADATA +0 -437
- {matplotlib_map_utils-3.0.1.dist-info → matplotlib_map_utils-3.1.1.dist-info}/WHEEL +0 -0
- {matplotlib_map_utils-3.0.1.dist-info → matplotlib_map_utils-3.1.1.dist-info}/licenses/LICENSE +0 -0
- {matplotlib_map_utils-3.0.1.dist-info → matplotlib_map_utils-3.1.1.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
|
|
1
1
|
matplotlib_map_utils/__init__.py,sha256=2mL2sZOjfxC--EthFMTMuYh1uvozz-9PzM4EDprDicU,949
|
2
2
|
matplotlib_map_utils/core/__init__.py,sha256=mIn7x-LZlvNaYMcmjZXwnKNTirv3Vv2lAJodwRg_AdU,471
|
3
|
-
matplotlib_map_utils/core/inset_map.py,sha256
|
4
|
-
matplotlib_map_utils/core/north_arrow.py,sha256=
|
5
|
-
matplotlib_map_utils/core/scale_bar.py,sha256=
|
3
|
+
matplotlib_map_utils/core/inset_map.py,sha256=iJISV0gZ3OmhO-DzC5z5kH5qL8fpdqmHn5OkdhdtzAY,41561
|
4
|
+
matplotlib_map_utils/core/north_arrow.py,sha256=UDn0TBnLuhuONbibb_XT8C2HNSY6ONLCQgadR19WpmI,22846
|
5
|
+
matplotlib_map_utils/core/scale_bar.py,sha256=kM9WMwdpKJuShl8BkzsRcFhc0y-Kxu8wJpriz8iVYzk,67064
|
6
6
|
matplotlib_map_utils/defaults/__init__.py,sha256=_pegE5kv_sb0ansSF4XpWBRwboaP4zUjWY1KIGbK-TE,119
|
7
7
|
matplotlib_map_utils/defaults/inset_map.py,sha256=RNwaZqWjDjdNwPgmqx_cN9lQQ6DW_Db61peaeMRCPlc,1569
|
8
8
|
matplotlib_map_utils/defaults/north_arrow.py,sha256=uZb1RsUWxFTHywm8HATj_9iPF_GjCs_Z2HOn0JchjTY,8571
|
9
|
-
matplotlib_map_utils/defaults/scale_bar.py,sha256=
|
9
|
+
matplotlib_map_utils/defaults/scale_bar.py,sha256=422U5hBtLpXrWZuj7vOnZNmIWI_KnOgDIwRX__m4GCY,8345
|
10
10
|
matplotlib_map_utils/scratch/map_utils.py,sha256=j8dOX9uuotl9rRCAXapFLHycUwVE4nzIrqWYOGG2Lgg,19653
|
11
11
|
matplotlib_map_utils/scratch/north_arrow_old_classes.py,sha256=1xKQ6yUghX4BWzIv8GsGBHDDPJ8B0Na7ixdw2jgtTqw,50993
|
12
12
|
matplotlib_map_utils/utils/__init__.py,sha256=uUy0kUMMGrDpvo88J_OLk2dQI-UwCXclccaEyk8x5R0,41
|
13
13
|
matplotlib_map_utils/utils/usa.json,sha256=kLB9JXNSWf8VU-9XwXuMRAPKO-zA4aluQUEln7Ktc_s,26563
|
14
14
|
matplotlib_map_utils/utils/usa.py,sha256=7SlUdxtCan5PFNIoLe-HfOC5r2cxJAF-9QKhNIK71EI,16853
|
15
15
|
matplotlib_map_utils/validation/__init__.py,sha256=0fL3N63jxjRwTU44b7-6ZYZJfOT_0ac7dx7M6Gpu_5M,52
|
16
|
-
matplotlib_map_utils/validation/functions.py,sha256=
|
17
|
-
matplotlib_map_utils/validation/inset_map.py,sha256=
|
18
|
-
matplotlib_map_utils/validation/north_arrow.py,sha256=
|
19
|
-
matplotlib_map_utils/validation/scale_bar.py,sha256=
|
20
|
-
matplotlib_map_utils-3.
|
21
|
-
matplotlib_map_utils-3.
|
22
|
-
matplotlib_map_utils-3.
|
23
|
-
matplotlib_map_utils-3.
|
24
|
-
matplotlib_map_utils-3.
|
16
|
+
matplotlib_map_utils/validation/functions.py,sha256=IIT9DiPKVv_ZHUTC8FwXJPt2pzdQI-8zhx6SHqto65E,13020
|
17
|
+
matplotlib_map_utils/validation/inset_map.py,sha256=C5e_zOBKHqVNgufhwoIxu1OhlvXoaj70WxreW4BSfnA,6019
|
18
|
+
matplotlib_map_utils/validation/north_arrow.py,sha256=6D-uLiMmre0E9JwjR0BTWNZJyCqPuL0b3HGZ91UHoXw,10442
|
19
|
+
matplotlib_map_utils/validation/scale_bar.py,sha256=dYhiuqBV8wkMmFsR8p4RMbfBmN1DU--5cWU-Om9m7UY,18162
|
20
|
+
matplotlib_map_utils-3.1.1.dist-info/licenses/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
|
21
|
+
matplotlib_map_utils-3.1.1.dist-info/METADATA,sha256=AZQKlt58icL88wIRhSJwyEdU6XhEDwcr-zpiwBBsoQQ,63423
|
22
|
+
matplotlib_map_utils-3.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
matplotlib_map_utils-3.1.1.dist-info/top_level.txt,sha256=6UyDpxsnMhSOd9a-abQe0lLJveybJyYtUHMdX7zXgKA,21
|
24
|
+
matplotlib_map_utils-3.1.1.dist-info/RECORD,,
|
@@ -1,437 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: matplotlib-map-utils
|
3
|
-
Version: 3.0.1
|
4
|
-
Summary: A suite of tools for creating maps in matplotlib
|
5
|
-
Author-email: David Moss <davidmoss1221@gmail.com>
|
6
|
-
Project-URL: Homepage, https://github.com/moss-xyz/matplotlib-map-utils/
|
7
|
-
Project-URL: Bug Tracker, https://github.com/moss-xyz/matplotlib-map-utils/issues
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
|
10
|
-
Classifier: Operating System :: OS Independent
|
11
|
-
Classifier: Framework :: Matplotlib
|
12
|
-
Requires-Python: >=3.10
|
13
|
-
Description-Content-Type: text/markdown
|
14
|
-
License-File: LICENSE
|
15
|
-
Requires-Dist: matplotlib>=3.9.0
|
16
|
-
Requires-Dist: cartopy>=0.23.0
|
17
|
-
Requires-Dist: great-circle-calculator>=1.3.1
|
18
|
-
Dynamic: license-file
|
19
|
-
|
20
|
-

|
21
|
-
|
22
|
-
---
|
23
|
-
|
24
|
-
**Documentation:** See `docs` folder
|
25
|
-
|
26
|
-
**Source Code:** [Available on GitHub](https://github.com/moss-xyz/matplotlib-map-utils)
|
27
|
-
|
28
|
-
**Feedback:** I welcome any and all feedback! See the *Development Notes* below for more details.
|
29
|
-
|
30
|
-
---
|
31
|
-
|
32
|
-
### Introduction
|
33
|
-
|
34
|
-
`matplotlib_map_utils` is intended to be a package that provides various functions and objects that assist with the the creation of maps using [`matplotlib`](https://matplotlib.org/stable/).
|
35
|
-
|
36
|
-
As of `v3.x` (the current version), this includes three-ish elements:
|
37
|
-
|
38
|
-
* `north_arrow.py`, for adding a north arrow to a given plot.
|
39
|
-
|
40
|
-
* `scale_bar.py`, for adding a scale bar to a given plot.
|
41
|
-
|
42
|
-
* `inset_map.py`, for adding inset maps and detail/extent indicators to a given plot.
|
43
|
-
|
44
|
-
The three elements listed above are all intended to be high-resolution, easily modifiable, and context-aware, relative to your specific plot.
|
45
|
-
|
46
|
-
This package also contains a single utility object:
|
47
|
-
|
48
|
-
* `usa.py`, which contains a class that helps filter for states and territories within the USA based on given characteristics.
|
49
|
-
|
50
|
-
Together, these allow for the easy creation of a map such as the following:
|
51
|
-
|
52
|
-

|
53
|
-
|
54
|
-
---
|
55
|
-
|
56
|
-
### Installation
|
57
|
-
|
58
|
-
This package is available on PyPi, and can be installed like so:
|
59
|
-
|
60
|
-
```bash
|
61
|
-
pip install matplotlib-map-utils
|
62
|
-
```
|
63
|
-
|
64
|
-
The requirements for this package are:
|
65
|
-
|
66
|
-
* `python >= 3.10` (due to the use of the pipe operator to concatenate dictionaries and types)
|
67
|
-
|
68
|
-
* `matplotlib >= 3.9` (might work with lower versions but not guaranteed)
|
69
|
-
|
70
|
-
* `cartopy >= 0.23` (due to earlier bug with calling `copy()` on `CRS` objects)
|
71
|
-
|
72
|
-
---
|
73
|
-
|
74
|
-
### Package Structure
|
75
|
-
|
76
|
-
<details>
|
77
|
-
<summary><i>The package is arrayed in the following way:</i></summary>
|
78
|
-
|
79
|
-
```bash
|
80
|
-
package_name/
|
81
|
-
├── __init__.py
|
82
|
-
│
|
83
|
-
├── core/
|
84
|
-
│ ├── __init__.py
|
85
|
-
│ ├── inset_map.py
|
86
|
-
│ ├── north_arrow.py
|
87
|
-
│ ├── scale_bar.py
|
88
|
-
├── validation/
|
89
|
-
│ ├── __init__.py
|
90
|
-
│ ├── functions.py
|
91
|
-
│ └── inset_map.py
|
92
|
-
│ ├── north_arrow.py
|
93
|
-
│ └── scale_bar.py
|
94
|
-
├── defaults/
|
95
|
-
│ ├── __init__.py
|
96
|
-
│ ├── north_arrow.py
|
97
|
-
│ └── scale_bar.py
|
98
|
-
│ └── inset_map.py
|
99
|
-
├── utils/
|
100
|
-
│ ├── __init__.py
|
101
|
-
│ ├── usa.py
|
102
|
-
│ └── usa.json
|
103
|
-
```
|
104
|
-
|
105
|
-
Where:
|
106
|
-
|
107
|
-
* `core` contains the main functions and classes for each object
|
108
|
-
|
109
|
-
* `validation` contains type hints for each variable and functions to validate inputs
|
110
|
-
|
111
|
-
* `defaults` contains default settings for each object at different paper sizes
|
112
|
-
|
113
|
-
* `utils` contains utility functions and objects
|
114
|
-
|
115
|
-
</details>
|
116
|
-
|
117
|
-
---
|
118
|
-
|
119
|
-
### 🧭 North Arrow
|
120
|
-
|
121
|
-
<details>
|
122
|
-
<summary><i>Expand instructions</i></summary>
|
123
|
-
|
124
|
-
#### Quick Start
|
125
|
-
|
126
|
-
Importing the North Arrow functions and classes can be done like so:
|
127
|
-
|
128
|
-
```py
|
129
|
-
from matplotlib_map_utils.core.north_arrow import NorthArrow, north_arrow
|
130
|
-
from matplotlib_map_utils.core import NorthArrow, north_arrow # also valid
|
131
|
-
from matplotlib_map_utils import NorthArrow, north_arrow # also valid
|
132
|
-
```
|
133
|
-
|
134
|
-
The quickest way to add a single north arrow to a single plot is to use the `north_arrow` function:
|
135
|
-
|
136
|
-
```python
|
137
|
-
# Setting up a plot
|
138
|
-
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
|
139
|
-
# Adding a north arrow to the upper-right corner of the axis, without any rotation (see Rotation under Formatting Components for details)
|
140
|
-
north_arrow.north_arrow(ax=ax, location="upper right", rotation={"degrees":0})
|
141
|
-
```
|
142
|
-
|
143
|
-
An object-oriented approach is also supported:
|
144
|
-
|
145
|
-
```python
|
146
|
-
# Setting up a plot
|
147
|
-
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
|
148
|
-
# Creating a north arrow for the upper-right corner of the axis, without any rotation (see Rotation under Formatting Components for details)
|
149
|
-
na = north_arrow.NorthArrow(location="upper right", rotation={"degrees":0})
|
150
|
-
# Adding the artist to the plot
|
151
|
-
ax.add_artist(na)
|
152
|
-
```
|
153
|
-
|
154
|
-
Both of these will create an output like the following:
|
155
|
-
|
156
|
-

|
157
|
-
|
158
|
-
#### Customization
|
159
|
-
|
160
|
-
Both the object-oriented and functional approaches can be customized to allow for fine-grained control over formatting:
|
161
|
-
|
162
|
-
```python
|
163
|
-
north_arrow(
|
164
|
-
ax,
|
165
|
-
location = "upper right", # accepts a valid string from the list of locations
|
166
|
-
scale = 0.5, # accepts a valid positive float or integer
|
167
|
-
# each of the follow accepts arguments from a customized style dictionary
|
168
|
-
base = {"facecolor":"green"},
|
169
|
-
fancy = False,
|
170
|
-
label = {"text":"North"},
|
171
|
-
shadow = {"alpha":0.8},
|
172
|
-
pack = {"sep":6},
|
173
|
-
aob = {"pad":2},
|
174
|
-
rotation = {"degrees": 35}
|
175
|
-
)
|
176
|
-
```
|
177
|
-
|
178
|
-
This will create an output like the following:
|
179
|
-
|
180
|
-

|
181
|
-
|
182
|
-
Refer to `docs\howto_north_arrow` for details on how to customize each facet of the north arrow.
|
183
|
-
|
184
|
-
#### Rotation
|
185
|
-
|
186
|
-
The north arrow object is also capable of pointing towards "true north", given a CRS and reference point:
|
187
|
-
|
188
|
-

|
189
|
-
|
190
|
-
Instructions for how to do so can be found in `docs\howto_north_arrow`.
|
191
|
-
</details>
|
192
|
-
|
193
|
-
---
|
194
|
-
|
195
|
-
### 📏 Scale Bar
|
196
|
-
|
197
|
-
<details>
|
198
|
-
<summary><i>Expand instructions</i></summary>
|
199
|
-
|
200
|
-
#### Quick Start
|
201
|
-
|
202
|
-
Importing the Scale Bar functions and classes can be done like so:
|
203
|
-
|
204
|
-
```py
|
205
|
-
from matplotlib_map_utils.core.scale_bar import ScaleBar, scale_bar
|
206
|
-
from matplotlib_map_utils.core import ScaleBar, scale_bar # also valid
|
207
|
-
from matplotlib_map_utils import ScaleBar, scale_bar # also valid
|
208
|
-
```
|
209
|
-
|
210
|
-
There are two available styles for the scale bars: `boxes` and `ticks`. The quickest way to add one to a single plot is to use the `scale_bar` function:
|
211
|
-
|
212
|
-
```python
|
213
|
-
# Setting up a plot
|
214
|
-
# NOTE: you MUST set the desired DPI here, when the subplots are created
|
215
|
-
# so that the scale_bar's DPI matches!
|
216
|
-
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
|
217
|
-
# Adding a scale bar to the upper-right corner of the axis, in the same projection as whatever geodata you plotted
|
218
|
-
# Here, this scale bar will have the "boxes" style
|
219
|
-
scale_bar(ax=ax, location="upper right", style="boxes", bar={"projection":3857})
|
220
|
-
```
|
221
|
-
|
222
|
-
An object-oriented approach is also supported:
|
223
|
-
|
224
|
-
```python
|
225
|
-
# Setting up a plot
|
226
|
-
# NOTE: you MUST set the desired DPI here, when the subplots are created
|
227
|
-
# so that the scale_bar's DPI matches!
|
228
|
-
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
|
229
|
-
# Adding a scale bar to the upper-right corner of the axis, in the same projection as whatever geodata you plotted
|
230
|
-
# Here, we change the boxes to "ticks"
|
231
|
-
sb = ScaleBar(location="upper right", style="ticks", bar={"projection":3857})
|
232
|
-
# Adding the artist to the plot
|
233
|
-
ax.add_artist(sb)
|
234
|
-
```
|
235
|
-
|
236
|
-
Both of these will create an output like the following (function is left, class is right):
|
237
|
-
|
238
|
-

|
239
|
-
|
240
|
-
#### Customization
|
241
|
-
|
242
|
-
Both the object-oriented and functional approaches can be customized to allow for fine-grained control over formatting:
|
243
|
-
|
244
|
-
```python
|
245
|
-
scale_bar(
|
246
|
-
ax,
|
247
|
-
location = "upper right", # accepts a valid string from the list of locations
|
248
|
-
style = "boxes", # accepts a valid positive float or integer
|
249
|
-
# each of the follow accepts arguments from a customized style dictionary
|
250
|
-
bar = {"unit":"mi", "length":2}, # converting the units to miles, and changing the length of the bar (in inches)
|
251
|
-
labels = {"style":"major", "loc":"below"}, # placing a label on each major division, and moving them below the bar
|
252
|
-
units = {"loc":"text"}, # changing the location of the units text to the major division labels
|
253
|
-
text = {"fontfamily":"monospace"}, # changing the font family of all the text to monospace
|
254
|
-
)
|
255
|
-
```
|
256
|
-
|
257
|
-
This will create an output like the following:
|
258
|
-
|
259
|
-

|
260
|
-
|
261
|
-
Refer to `docs\howto_scale_bar` for details on how to customize each facet of the scale bar.
|
262
|
-
|
263
|
-
</details>
|
264
|
-
|
265
|
-
---
|
266
|
-
|
267
|
-
### 🗺️ Inset Map
|
268
|
-
|
269
|
-
<details>
|
270
|
-
<summary><i>Expand instructions</i></summary>
|
271
|
-
|
272
|
-
#### Quick Start
|
273
|
-
|
274
|
-
Importing the Inset Map functions and classes can be done like so:
|
275
|
-
|
276
|
-
```py
|
277
|
-
from matplotlib_map_utils.core.inset_map import InsetMap, inset_map, ExtentIndicator, indicate_extent, DetailIndicator, indicate_detail
|
278
|
-
from matplotlib_map_utils.core import InsetMap, inset_map, ExtentIndicator, indicate_extent, DetailIndicator, indicate_detail # also valid
|
279
|
-
from matplotlib_map_utils import InsetMap, inset_map, ExtentIndicator, indicate_extent, DetailIndicator, indicate_detail # also valid
|
280
|
-
```
|
281
|
-
|
282
|
-
The quickest way to add a single inset map to an existing plot is the `inset_map` function:
|
283
|
-
|
284
|
-
```python
|
285
|
-
# Setting up a plot
|
286
|
-
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
|
287
|
-
# Adding an inset map to the upper-right corner of the axis
|
288
|
-
iax = inset_map(ax=ax, location="upper right", size=0.75, pad=0, xticks=[], yticks=[])
|
289
|
-
# You can now plot additional data to iax as desired
|
290
|
-
```
|
291
|
-
|
292
|
-
An object-oriented approach is also supported:
|
293
|
-
|
294
|
-
```python
|
295
|
-
# Setting up a plot
|
296
|
-
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
|
297
|
-
# Creating an object for the inset map
|
298
|
-
im = InsetMap(location="upper right", size=0.75, pad=0, xticks=[], yticks=[])
|
299
|
-
# Adding the inset map template to the plot
|
300
|
-
iax = im.create(ax=ax)
|
301
|
-
# You can now plot additional data to iax as desired
|
302
|
-
```
|
303
|
-
|
304
|
-
Both of these will create an output like the following:
|
305
|
-
|
306
|
-

|
307
|
-
|
308
|
-
#### Extent and Detail Indicators
|
309
|
-
|
310
|
-
Inset maps can be paired with either an extent or detail indicator, to provide additional geographic context to the inset map
|
311
|
-
|
312
|
-
```python
|
313
|
-
indicate_extent(inset_axis, parent_axis, inset_crs, parent_crs, ...)
|
314
|
-
indicate_detail(parent_axis, inset_axis, parent_crs, inset_crs, ...)
|
315
|
-
```
|
316
|
-
|
317
|
-
This will create an output like the following (extent indicator on the left, detail indicator on the right):
|
318
|
-
|
319
|
-

|
320
|
-
|
321
|
-
Refer to `docs\howto_inset_map` for details on how to customize the inset map and indicators to your liking.
|
322
|
-
|
323
|
-
</details>
|
324
|
-
|
325
|
-
---
|
326
|
-
|
327
|
-
### 🛠️ Utilities
|
328
|
-
|
329
|
-
<details>
|
330
|
-
<summary><i>Expand instructions</i></summary>
|
331
|
-
|
332
|
-
#### Quick Start
|
333
|
-
|
334
|
-
Importing the bundled utility functions and classes can be done like so:
|
335
|
-
|
336
|
-
```py
|
337
|
-
from matplotlib_map_utils.utils import USA
|
338
|
-
```
|
339
|
-
|
340
|
-
As of `v2.1.0`, there is only one utility class available: `USA`, an object to help quickly filter for subsets of US states and territories. This utility class is still in beta, and might change.
|
341
|
-
|
342
|
-
An example:
|
343
|
-
|
344
|
-
```python
|
345
|
-
# Loading the object
|
346
|
-
usa = USA()
|
347
|
-
# Getting a list FIPS codes for US States
|
348
|
-
usa.filter(states=True, to_return="fips")
|
349
|
-
# Getting a list of State Names for states in the South and Midwest regions
|
350
|
-
usa.filter(region=["South","Midtwest"], to_return="name")
|
351
|
-
```
|
352
|
-
|
353
|
-
Refer to `docs\howto_utils` for details on how to use this class, including with `pandas.apply()`.
|
354
|
-
|
355
|
-
</details>
|
356
|
-
|
357
|
-
---
|
358
|
-
|
359
|
-
### Development Notes
|
360
|
-
|
361
|
-
#### Inspiration and Thanks
|
362
|
-
|
363
|
-
This project was heavily inspired by [`matplotlib-scalebar`](https://github.com/ppinard/matplotlib-scalebar/), and much of the code is either directly copied or a derivative of that project, since it uses the same "artist"-based approach.
|
364
|
-
|
365
|
-
Two more projects assisted with the creation of this script:
|
366
|
-
|
367
|
-
* [`EOmaps`](https://github.com/raphaelquast/EOmaps/discussions/231) provided code for calculating the rotation required to point to "true north" for an arbitrary point and CRS for the north arrow.
|
368
|
-
|
369
|
-
* [`Cartopy`](https://github.com/SciTools/cartopy/issues/2361) fixed an issue inherent to calling `.copy()` on `CRS` objects.
|
370
|
-
|
371
|
-
#### Releases
|
372
|
-
|
373
|
-
- `v1.0.x`: Initial releases featuring the North Arrow element, along with some minor bug fixes.
|
374
|
-
|
375
|
-
- `v2.0.0`: Initial release of the Scale Bar element.
|
376
|
-
|
377
|
-
- `v2.0.1`: Fixed a bug in the `dual_bars()` function that prevented empty dictionaries to be passed. Also added a warning when auto-calculated bar widths appear to be exceeding the dimension of the axis (usually occurs when the axis is <2 kilometers or miles long, depending on the units selected).
|
378
|
-
|
379
|
-
- `v2.0.2`: Changed f-string formatting to alternate double and single quotes, so as to maintain compatibility with versions of Python before 3.12 (see [here](https://github.com/moss-xyz/matplotlib-map-utils/issues/3)). However, this did reveal that another aspect of the code, namely concatenating `type` in function arguments, requires 3.10, and so the minimum python version was incremented.
|
380
|
-
|
381
|
-
- `v2.1.0`: Added a utility class, `USA`, for filtering subsets of US states and territories based on FIPS code, name, abbreviation, region, division, and more. This is considered a beta release, and might be subject to change later on.
|
382
|
-
|
383
|
-
- `v3.0.0`: Release of inset map and extent and detail indicator classes and functions.
|
384
|
-
|
385
|
-
- `v3.0.1`: Fixed a bug that led to an incorrect Scale Bar being rendered when using the function method (`scale_bar()`) on a plot containing raster data (see [here](https://github.com/moss-xyz/matplotlib-map-utils/issues/10) for details).
|
386
|
-
|
387
|
-
#### Future Roadmap
|
388
|
-
|
389
|
-
With the release of `v3.x`, this project has achieved full coverage of the "main" map elements I think are necessary.
|
390
|
-
|
391
|
-
If I continue development of this project, I will be looking to add or fix the following features:
|
392
|
-
|
393
|
-
* For all: switch to a system based on Pydantic for easier type validation
|
394
|
-
|
395
|
-
* **North Arrow:**
|
396
|
-
|
397
|
-
* Copy the image-rendering functionality of the Scale Bar to allow for rotation of the entire object, label and arrow together
|
398
|
-
|
399
|
-
* Create more styles for the arrow, potentially including a compass rose and a line-only arrow
|
400
|
-
|
401
|
-
* **Scale Bar:**
|
402
|
-
|
403
|
-
* Allow for custom unit definitions (instead of just metres/feet/miles/kilometres/etc.), so that the scale bar can be used on arbitrary plots (such as inches/cm/mm, mathmatical plots, and the like)
|
404
|
-
|
405
|
-
* Fix/improve the `dual_bars()` function, which currently doesn't work great with rotations
|
406
|
-
|
407
|
-
* Clean up the variable naming scheme (consistency on `loc` vs `position`, `style` vs `type`, etc.)
|
408
|
-
|
409
|
-
* Create more styles for the bar, potentially including dual boxes and a sawtooth bar
|
410
|
-
|
411
|
-
* **Inset Map:**
|
412
|
-
|
413
|
-
* Clean up the way that connectors are drawn for detail indicators
|
414
|
-
|
415
|
-
* New functionality for placing multiple inset maps at once (with context-aware positioning to prevent overlap with each other)
|
416
|
-
|
417
|
-
* **Utils:**
|
418
|
-
|
419
|
-
* (USA): Stronger fuzzy search mechanics, so that it will accept flexible inputs for FIPS/abbr/name
|
420
|
-
|
421
|
-
* (USA): More integrated class types to allow for a more fully-formed object model (USA being a `Country`, with subclasses related to `State` and `Territory` that have their own classes of attributes, etc.)
|
422
|
-
|
423
|
-
* (USA): Stronger typing options, so you don't have to recall which `region` or `division` types are available, etc.
|
424
|
-
|
425
|
-
Future releases (if the project is continued) will probably focus on other functions that I have created myself that give more control in the formatting of maps. I am also open to ideas for other extensions to create!
|
426
|
-
|
427
|
-
#### Support and Contributions
|
428
|
-
|
429
|
-
If you notice something is not working as intended or if you'd like to add a feature yourself, I welcome PRs - just be sure to be descriptive as to what you are changing and why, including code examples!
|
430
|
-
|
431
|
-
If you are having issues using this script, feel free to leave a post explaining your issue, and I will try and assist, though I have no guaranteed SLAs as this is just a hobby project.
|
432
|
-
|
433
|
-
---
|
434
|
-
|
435
|
-
### License
|
436
|
-
|
437
|
-
I know nothing about licensing, so I went with the GPL license. If that is incompatible with any of the dependencies, please let me know.
|
File without changes
|
{matplotlib_map_utils-3.0.1.dist-info → matplotlib_map_utils-3.1.1.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|