Skip to content

Commit

Permalink
Merge pull request #3293 from dopplershift/update-shapes
Browse files Browse the repository at this point in the history
Update state and county shapefiles
  • Loading branch information
dopplershift authored Nov 28, 2023
2 parents ddd9fd5 + d0f3115 commit 70e4faf
Show file tree
Hide file tree
Showing 39 changed files with 63 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,10 @@ jobs:
run: |
set -o pipefail
codespell | reviewdog -efm='%f:%l: %m' -name=codespell -reporter=github-check -filter-mode=nofilter
- name: Check static data registry
# Don't skip if any other steps fail
if: always()
run: |
python -c "import pooch; pooch.make_registry('staticdata', 'src/metpy/static-data-manifest.txt')"
git diff --exit-code
2 changes: 2 additions & 0 deletions ci/linting_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ doc8==1.1.1
restructuredtext_lint==1.4.0

codespell==2.2.6

pooch==1.8.0
4 changes: 2 additions & 2 deletions src/metpy/plots/cartopy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MetPyMapFeature(Feature):
def __init__(self, name, scale, **kwargs):
"""Create MetPyMapFeature instance."""
import cartopy.crs as ccrs
super().__init__(ccrs.PlateCarree(), **kwargs)
super().__init__(ccrs.PlateCarree(globe=ccrs.Globe('NAD83')), **kwargs)
self.name = name

if isinstance(scale, str):
Expand All @@ -27,7 +27,7 @@ def geometries(self):

# Ensure that the associated files are in the cache
fname = f'{self.name}_{self.scaler.scale}'
for extension in ['.dbf', '.shx']:
for extension in ['.cpg', '.dbf', '.prj', '.shx']:
get_test_data(fname + extension, as_file_obj=False)
path = get_test_data(fname + '.shp', as_file_obj=False)
return iter(tuple(shapereader.Reader(path).geometries()))
Expand Down
48 changes: 30 additions & 18 deletions src/metpy/static-data-manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,34 @@ station_data.txt 3c1b71abb95ef8fe4adf57e47e2ce67f3529c6fe025b546dd40c862999fc5ff
stations.txt 22b52d8f10c236ef5b2d25c4b6f67e2a3ed9798a0c2e16ceb2031ea377d72945
timeseries.csv 2d79f8f21ad1fcec12d0e24750d0958631e92c9148adfbd1b7dc8defe8c56fc5
us_cities.zip fe08a30a5d65a84365e083549718dff223f22f84812e2eec90c0d00df856df82
us_counties_20m.dbf b5eeaa4769f25324d52933a6067e9a90315a77fefcdbefd0c7d99e94fd0cbb41
us_counties_20m.shp 8acb8bfbcf670028f7ce6c1c11ae08b21844b1c882c26ef397df33231831dee9
us_counties_20m.shx 131ccb63c365415c81c4fcd686b2bcbb9166e3a3d1fe97c1a5fc28344036a4ae
us_counties_500k.dbf 8cb3e42c3d951cf5b15e395bee61eb1ad50c0470bd0937e7288526605bf1ab85
us_counties_500k.shp 06463cf329d6f412d7f3323748225aca1ca495a8c04af58cfaf169fc3a8c8df4
us_counties_500k.shx aa301ee507e17bcd84a0792648eaea17a5efd7b274d14689a285603c0a61a8ba
us_counties_5m.dbf f7e5b7cb1da1a306652b4ca94212a91b4e08006691366ede1bca57c1b31018a4
us_counties_5m.shp be255ca37625e5feef7808ef996e803c6412ee67e52c29ee0b603b569eba083c
us_counties_5m.shx 7412c519095b9d2c3d3bf0e681f784f2b44fb4b4b6ce58d5b60fcd740dab2895
us_states_20m.dbf f0bdd4b4e28f874a725041bc141991773f503d04372a3b03cc0b6a37426bbc50
us_states_20m.shp 9e3a98552c6ab4d7d2039acfaaf5953c7d55c45f60aa78cf4800107517c28e65
us_states_20m.shx 6c3a86e50b460dcb81556fd3480700051afd3c88c159dee2aae2b59c3fd84e09
us_states_500k.dbf 13d63f8ab31963d93982a559ad7539bffc7fe08787326bea6d9b2eb7cfdfb64c
us_states_500k.shp 206d5f423c430b33d607f4efde8c63dfe4a93fda98b53011cf3077a1b6a6dc85
us_states_500k.shx 815827b21eda32c062e5f641d52b66dfcc68bb9dc97b86bf008f34bd8735e08f
us_states_5m.dbf b3d04bbea008b33a5e7e8e14b1b8cc19bdd7c06754ddabb1e2f73c2ca0d79288
us_states_5m.shp 62e8684263aa8c7dd8c69a467dd0ed54f3a882a89487e8e5d430063ae925f68f
us_states_5m.shx c0f853272c7b9902073242de57a8d2ba7a446904da0d9e7cc98b538cc20a59d6
us_counties_20m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824
us_counties_20m.dbf d75f7b87f5bd384c95236caa1525d0704d3232e85a7ac55992370083d0509f0b
us_counties_20m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd
us_counties_20m.shp c95f3659d205787a6eeca270642255941a11b19b5d604a91d42304a7ad47108a
us_counties_20m.shx 8b83a347a417fedaac4b46ada2205918279297639f434dfea245712f90e5d7c7
us_counties_500k.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824
us_counties_500k.dbf 465be482a7bbf16070e0af6b087dbd2edc332182a34725581a63b7160e8d6d3e
us_counties_500k.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd
us_counties_500k.shp eda039434f2e64f4ee5324b36c5fe5216e8911f489767a8fc17dc4875742c924
us_counties_500k.shx 5ef30b33c6080876c166cdd6f730fcc5522bafb69f1c2bf4e567cf74435d450d
us_counties_5m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824
us_counties_5m.dbf aaa4b176083097a67b1fa25ecc03a4279acf6ab44720e79248c0eeff0f74e64a
us_counties_5m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd
us_counties_5m.shp 74ab399b8fdebf77d31a80bf6fedf1ef3ee55d5e5cdc912b6330b48521dc7fe4
us_counties_5m.shx 27fb6114207766baab256e70d1830bcfe9668048b84c9407d8d55f4096e16daa
us_states_20m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824
us_states_20m.dbf 04e3caf5dfc140ee152bb7fc52ba2ce41c9f5f4c80078a1060a1edb1c5d779a0
us_states_20m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd
us_states_20m.shp 8f9a030ff97a5ecce6c7c98fd43dd3e7ffe15ed61a43d6e5981a13990f0b8232
us_states_20m.shx b9ecf37f30dbd1b35ad11dae9d1807487cddea94276cf388064c09680f94c12c
us_states_500k.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824
us_states_500k.dbf 47b3d04db6c0408851b4c75d2635e9d06764fa18fc9cd9d6be54755334a0df35
us_states_500k.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd
us_states_500k.shp 438b67af3be55c210f70789a0ba4eb8ac2518ee4424f633590ead19d1f962c3e
us_states_500k.shx 58cded58f24356e50135efe7f44b69b17ae5492b8a644fdd34292c2a16b46851
us_states_5m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824
us_states_5m.dbf 6a7710e15b095ecb0d3214f3778c2d2383329377d199387857fa0525953730f8
us_states_5m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd
us_states_5m.shp e175a60ccb482e01f8d2633d1c38acba5e2b06065d02dd34f7f94d00bbe345fb
us_states_5m.shx c8c81c45086d0169e4e84ad059268a2220e18c61d1543f8cb923e2512ab7cb11
wrf_example.nc dcc1444db327507730334fd94dcb223025f77791448dd394f3ba06391ddbf98f
1 change: 1 addition & 0 deletions staticdata/us_counties_20m.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file modified staticdata/us_counties_20m.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_counties_20m.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file modified staticdata/us_counties_20m.shp
Binary file not shown.
Binary file modified staticdata/us_counties_20m.shx
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_counties_500k.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file modified staticdata/us_counties_500k.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_counties_500k.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file modified staticdata/us_counties_500k.shp
Binary file not shown.
Binary file modified staticdata/us_counties_500k.shx
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_counties_5m.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file modified staticdata/us_counties_5m.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_counties_5m.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file modified staticdata/us_counties_5m.shp
Binary file not shown.
Binary file modified staticdata/us_counties_5m.shx
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_states_20m.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file modified staticdata/us_states_20m.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_states_20m.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file modified staticdata/us_states_20m.shp
Binary file not shown.
Binary file modified staticdata/us_states_20m.shx
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_states_500k.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file modified staticdata/us_states_500k.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_states_500k.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file modified staticdata/us_states_500k.shp
Binary file not shown.
Binary file modified staticdata/us_states_500k.shx
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_states_5m.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file modified staticdata/us_states_5m.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions staticdata/us_states_5m.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file modified staticdata/us_states_5m.shp
Binary file not shown.
Binary file modified staticdata/us_states_5m.shx
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plots/baseline/test_us_county_defaults.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plots/baseline/test_us_county_scales.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plots/baseline/test_us_states_scales.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions tests/plots/test_declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_declarative_four_dims_error():
pc.draw()


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.093)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.096)
@needs_cartopy
def test_declarative_contour():
"""Test making a contour plot."""
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_declarative_titles():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.098)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.101)
@needs_cartopy
def test_declarative_smooth_contour():
"""Test making a contour plot using smooth_contour."""
Expand Down Expand Up @@ -179,7 +179,7 @@ def test_declarative_smooth_contour():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.12)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.121)
@needs_cartopy
def test_declarative_smooth_contour_calculation():
"""Test making a contour plot using smooth_contour."""
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_declarative_smooth_contour_calculation():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.021)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.034)
@needs_cartopy
def test_declarative_smooth_contour_order():
"""Test making a contour plot using smooth_contour with tuple."""
Expand Down Expand Up @@ -250,7 +250,7 @@ def test_declarative_smooth_contour_order():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.059)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.063)
@needs_cartopy
def test_declarative_figsize():
"""Test having an all float figsize."""
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_declarative_figsize():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.032)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.039)
@needs_cartopy
def test_declarative_smooth_field():
"""Test the smoothing of the field with smooth_field trait."""
Expand Down Expand Up @@ -366,7 +366,7 @@ def test_declarative_contour_options():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.082)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.085)
@needs_cartopy
def test_declarative_layers_plot_options():
"""Test declarative layer options of edgecolor and linewidth."""
Expand Down Expand Up @@ -835,7 +835,7 @@ def test_latlon():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.342)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.343)
@needs_cartopy
def test_declarative_barb_options():
"""Test making a contour plot."""
Expand Down Expand Up @@ -1035,7 +1035,7 @@ def test_declarative_overlay_projections():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.026)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.047)
@needs_cartopy
def test_declarative_gridded_scale():
"""Test making a contour plot."""
Expand Down Expand Up @@ -1936,7 +1936,7 @@ def test_declarative_region_modifier_zoom_in():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.332)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.338)
@needs_cartopy
def test_declarative_region_modifier_zoom_out():
"""Test that '-' suffix on area string properly expands extent of map."""
Expand Down

0 comments on commit 70e4faf

Please sign in to comment.